Post: C# Coding Problem
08-21-2015, 12:28 PM #1
Albus
Do a barrel roll!
(adsbygoogle = window.adsbygoogle || []).push({});
Greeting.
Currently in the process of coding my RTM/RPC tool and have run in to some scripting errors. I have overcome all but this;


Apparently there is nothing to support "ReadFloatLength" so i can't use it. Sal

     public static float[] GetOrigin(uint Client)
{
return PS3.Extension.ReadFloatLength(0x110a29c + (Client * 0x3980), 3);
}

public static float[] GetAngles(uint Client)
{
return PS3.ReadfloatLength(0x110a3d8 + (Client * 0x3980), 3);
}


You must login or register to view this content.


Here is the Report when hovered over the script:

'PS3API' does not contain a definition for 'ReadFloatLength' and not extension method 'ReadFloatLength' accepting a first argument of type 'PS3API' could be found (are you missing a using directive or assembley reference?



Any help would be much appreciated.Gandalf the Grey



Yours Sincerely,
Albus
(adsbygoogle = window.adsbygoogle || []).push({});
08-21-2015, 12:43 PM #2
You're missing that function, apparently. You need to define it yourself or find a function here on NGU and put it into your application.
Most people call it "ReadSingle" but seems like two functions would do the exact same thing.
08-21-2015, 12:51 PM #3
Albus
Do a barrel roll!
Originally posted by John View Post
You're missing that function, apparently. You need to define it yourself or find a function here on NGU and put it into your application.
Most people call it "ReadSingle" but seems like two functions would do the exact same thing.


Thanks John!
Don't suppose you would be able to point me to a function would you?
08-21-2015, 12:57 PM #4
Originally posted by Albus View Post
Thanks John!
Don't suppose you would be able to point me to a function would you?


    
public static float[] ReadSingle(uint address, int length)
{
byte[] memory = PS3.Extension.ReadBytes(address, length * 4);
ReverseBytes(memory);
float[] numArray = new float[length];
for (int index = 0; index < length; ++index)
numArray[index] = BitConverter.ToSingle(memory, (length - 1 - index) * 4);
return numArray;
}
08-21-2015, 01:19 PM #5
Albus
Do a barrel roll!
Originally posted by John View Post
    
public static float[] ReadSingle(uint address, int length)
{
byte[] memory = PS3.Extension.ReadBytes(address, length * 4);
ReverseBytes(memory);
float[] numArray = new float[length];
for (int index = 0; index < length; ++index)
numArray[index] = BitConverter.ToSingle(memory, (length - 1 - index) * 4);
return numArray;
}


I forgot to mention that I'm a lil nooby at this.
Was i meant to change any of that code? as it changed nothing. Sal

You must login or register to view this content.
08-21-2015, 02:09 PM #6
Originally posted by Albus View Post
I forgot to mention that I'm a lil nooby at this.
Was i meant to change any of that code? as it changed nothing. Sal

You must login or register to view this content.

You'll also need this, I suppose
    
public static byte[] ReverseBytes(byte[] toReverse)
{
Array.Reverse(toReverse);
return toReverse;
}


And if you haven't already, change 'ReadFloatLength' to 'ReadSingle'
08-21-2015, 02:26 PM #7
Albus
Do a barrel roll!
Originally posted by John View Post
You'll also need this, I suppose
    
public static byte[] ReverseBytes(byte[] toReverse)
{
Array.Reverse(toReverse);
return toReverse;
}


And if you haven't already, change 'ReadFloatLength' to 'ReadSingle'



John, you are a Legend! *Pun not intended*
You are definitely going in the credits!

Just one last thing should do it!

i need a fix for these, if you wouldn't mind. (simple but I am still new at this..)
You must login or register to view this content.
You must login or register to view this content.
You must login or register to view this content.
You must login or register to view this content.
You must login or register to view this content.

You have been Such a great help Bro!
08-21-2015, 02:33 PM #8
Originally posted by Albus View Post
John, you are a Legend! *Pun not intended*
You are definitely going in the credits!

Just one last thing should do it!

i need a fix for these, if you wouldn't mind. (simple but I am still new at this..)
You must login or register to view this content.
You must login or register to view this content.
You must login or register to view this content.
You must login or register to view this content.
You must login or register to view this content.

You have been Such a great help Bro!

Change all of those from PS3.GetMemory to PS3.Extension.ReadBytes, and that should fix all of those problems.
And alright, not a problem, glad to help :p

The following user thanked John for this useful post:

Albus
08-21-2015, 04:20 PM #9
Jimmy
Supreme
Originally posted by Albus View Post
Greeting.
Currently in the process of coding my RTM/RPC tool and have run in to some scripting errors. I have overcome all but this;


Apparently there is nothing to support "ReadFloatLength" so i can't use it. Sal

     public static float[] GetOrigin(uint Client)
{
return PS3.Extension.ReadFloatLength(0x110a29c + (Client * 0x3980), 3);
}

public static float[] GetAngles(uint Client)
{
return PS3.ReadfloatLength(0x110a3d8 + (Client * 0x3980), 3);
}


You must login or register to view this content.


Here is the Report when hovered over the script:

'PS3API' does not contain a definition for 'ReadFloatLength' and not extension method 'ReadFloatLength' accepting a first argument of type 'PS3API' could be found (are you missing a using directive or assembley reference?



Any help would be much appreciated.Gandalf the Grey



Yours Sincerely,
Albus


Issue solved, closed.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo