Yop all ,
Je release le rpc pour pouvoir faire un menu :
Je release le rpc pour pouvoir faire un menu :
Code:
public class Buttons
{
public static uint DpadUp = 1048576u;
public static uint DpadDown = 4194304u;
public static uint DpadRight = 2097152u;
public static uint DpadLeft = 8388608u;
public static uint Cross = 64u;
public static uint Circle = 32u;
public static uint Triangle = 16u;
public static uint Square = 128u;
public static uint R3 = 262144u;
public static uint R2 = 2u;
public static uint R1 = 8u;
public static uint L3 = 131072u;
public static uint L2 = 1u;
public static uint L1 = 4u;
public static uint Select = 65536u;
public static uint Start = 524288u;
}
private uint GTATextOffset = 0x1F9C084;
private uint GTAFunctionOffset = 0x1F9C797;
private uint GTAButtonsOffset = 0x1F0F390;
string BLUE = "~HUD_COLOUR_BLUE~";
string YELLOW = "~HUD_COLOUR_YELLOW~";
string RED = "~HUD_COLOUR_RED~";
string WHITE = "~HUD_COLOUR_WHITE~";
string GREEN = "~HUD_COLOUR_GREEN~";
string PURPLE = "~HUD_COLOUR_PURPLE~";
string PINK = "~HUD_COLOUR_PINK~";
string LIME = "~HUD_COLOUR_LIME~";
private bool IsCurrentMessage(string secondmessage)
{
byte[] AllTextBytes = PS3.GetBytes(GTATextOffset, secondmessage.Length + 1);
byte[] SecondMessageBytes = Encoding.ASCII.GetBytes(secondmessage);
Array.Resize(ref SecondMessageBytes, SecondMessageBytes.Length + 1);
if (AllTextBytes.SequenceEqual(SecondMessageBytes))
{
return true;
}
return false;
}
public bool ButtonPressed(uint Button)
{
bool result;
byte[] array = PS3.GetBytes(GTAButtonsOffset, 4);
Array.Reverse(array);
uint num = BitConverter.ToUInt32(array, 0);
if (num == Button)
{
result = true;
return result;
}
result = false;
return result;
}
private void SendMessageToGTA(string message)
{
byte[] MessageBytes = Encoding.ASCII.GetBytes(message);
Array.Resize(ref MessageBytes, MessageBytes.Length + 1);
PS3.SetMemory(GTATextOffset, MessageBytes);
byte[] StartFunction = new byte[] { 0x04 };
PS3.SetMemory(GTAFunctionOffset, StartFunction);
}
private void RemoveLastMessageFromGTA()
{
byte[] EndFunction = new byte[] { 0x02 };
PS3.SetMemory(GTAFunctionOffset, EndFunction);
}