Post: Problem with GivePlayerWeapon BO2 RPC 1.18 [C#]
08-09-2014, 08:50 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); Hi Guys !

How are U ?

I have a problem in my tool ( C# ) !

I have do Choco's RPC, it's work, i can give weapon, but only at client 0, i have this function :

    
public static void GiveWeapon(int client, int weaponIndex)
{
{
Call(0x2a8364, new object[] { (uint)(0x1780f28 + (client * 0x580Cool Man (aka Tustin)), (uint)weaponIndex, 0 });
Call(0x1e6838, new object[] { (uint)(0x16b9f20 + (client * 0x580Cool Man (aka Tustin)), (uint)weaponIndex, 0, 0x270f, 1 });
}
}


And for giving weapon ( via listview ) i use this function :

    
private void mTARToolStripMenuItem_Click(object sender, EventArgs e)
{
for (int i = 0; i < this.listView1.Items.Count; i++)
{
if (this.listView1.Items[i].Selected == true)
{
GiveWeapon((0 * 0x580Cool Man (aka Tustin), 16);
}
}
}


When i use it, the client 0 have the weapon, but not me...

Why ? If you have a the solution at my problem i'll be very happy =D

RPC :

    
#region Call Function
private static void WriteSingle(uint address, float[] input)
{
int length = input.Length;
byte[] array = new byte[length * 4];
for (int i = 0; i < length; i++)
{
ReverseBytes(BitConverter.GetBytes(input[i])).CopyTo(array, (int)(i * 4));
}
PS3.SetMemory(address, array);
}
private static byte[] ReverseBytes(byte[] inArray)
{
Array.Reverse(inArray);
return inArray;
}
private static uint function_address = 0x7AA1E0;
public static int Call(uint func_address, params object[] parameters)
{
int length = parameters.Length;
int index = 0;
uint num3 = 0;
uint num4 = 0;
uint num5 = 0;
uint num6 = 0;
while (index < length)
{
if (parameters[index] is int)
{
PS3.Extension.WriteInt32(0x10020000 + (num3 * 4), (int)parameters[index]);
num3++;
}
else if (parameters[index] is uint)
{
PS3.Extension.WriteUInt32(0x10020000 + (num3 * 4), (uint)parameters[index]);
num3++;
}
else
{
uint num7;
if (parameters[index] is string)
{
num7 = 0x10022000 + (num4 * 0x400);
PS3.Extension.WriteString(num7, Convert.ToString(parameters[index]));
PS3.Extension.WriteUInt32(0x10020000 + (num3 * 4), num7);
num3++;
num4++;
}
else if (parameters[index] is float)
{
PS3.Extension.WriteFloat(0x10020024 + (num5 * 4), (float)parameters[index]);
num5++;
}
else if (parameters[index] is float[])
{
float[] input = (float[])parameters[index];
num7 = 0x10021000 + (num6 * 4);
WriteSingle(num7, input);
PS3.Extension.WriteUInt32(0x10020000 + (num3 * 4), num7);
num3++;
num6 += (uint)input.Length;
}
}
index++;
}
PS3.Extension.WriteUInt32(0x1002004C, func_address);
Thread.Sleep(20);
return PS3.Extension.ReadInt32(0x10020050);
}

public static void Enable_RPC()
{
if (PS3.Extension.ReadByte(function_address + 0xB) == 0xD0)
{
PS3.SetMemory(function_address, new byte[] { 0x4E, 0x80, 0x00, 0x20 });
Thread.Sleep(20);
byte[] memory = new byte[]
{ 0x7C, 0x08, 0x02, 0xA6, 0xF8, 0x01, 0x00, 0x80, 0x3C, 0x60, 0x10, 0x02, 0x81, 0x83, 0x00, 0x4C,
0x2C, 0x0C, 0x00, 0x00, 0x41, 0x82, 0x00, 0x64, 0x80, 0x83, 0x00, 0x04, 0x80, 0xA3, 0x00, 0x08,
0x80, 0xC3, 0x00, 0x0C, 0x80, 0xE3, 0x00, 0x10, 0x81, 0x03, 0x00, 0x14, 0x81, 0x23, 0x00, 0x18,
0x81, 0x43, 0x00, 0x1C, 0x81, 0x63, 0x00, 0x20, 0xC0, 0x23, 0x00, 0x24, 0xc0, 0x43, 0x00, 0x28,
0xC0, 0x63, 0x00, 0x2C, 0xC0, 0x83, 0x00, 0x30, 0xC0, 0xA3, 0x00, 0x34, 0xc0, 0xC3, 0x00, 0x38,
0xC0, 0xE3, 0x00, 0x3C, 0xC1, 0x03, 0x00, 0x40, 0xC1, 0x23, 0x00, 0x48, 0x80, 0x63, 0x00, 0x00,
0x7D, 0x89, 0x03, 0xA6, 0x4E, 0x80, 0x04, 0x21, 0x3C, 0x80, 0x10, 0x02, 0x38, 0xA0, 0x00, 0x00,
0x90, 0xA4, 0x00, 0x4C, 0x90, 0x64, 0x00, 0x50, 0xE8, 0x01, 0x00, 0x80, 0x7C, 0x08, 0x03, 0xA6,
0x38, 0x21, 0x00, 0x70, 0x4E, 0x80, 0x00, 0x20 };
PS3.SetMemory(function_address + 4, memory);
PS3.SetMemory(0x10020000, new byte[0x2854]);
PS3.SetMemory(function_address, new byte[] { 0xF8, 0x21, 0xFF, 0x91 });
}
else
{

}
}
public static int Init()
{
function_address = 0x7AA1E0;
Enable_RPC();
return 0;
}
#region SV_GameSendServerCommand
public static void SV_GameSendServerCommand(int client, string text, int type = 0)
{
Call(0x34A1DC, client, 0, (text));
}
#endregion
public static void GiveWeapon(int client, int weaponIndex)
{
{
Call(0x2a8364, new object[] { (uint)(0x1780f28 + (client * 0x580Cool Man (aka Tustin)), (uint)weaponIndex, 0 });
Call(0x1e6838, new object[] { (uint)(0x16B9F20 + (client * 0x580Cool Man (aka Tustin)), (uint)weaponIndex, 0, 0x270f, 1 });
}
}
#region iPrintln
public static void iPrintln(int client, string input)
{
SV_GameSendServerCommand(client, "< \"" + input + "\"");
}
#endregion
#region iPrintlnBold
public static void iPrintlnBold(int clientNumber, string input)
{
SV_GameSendServerCommand(clientNumber, "O \"" + input + "\"");
}
#endregion
public 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;
}
#endregion



Thank You for you're help !

PS : I'm not American sooooo, sorry for my bad English x)
(adsbygoogle = window.adsbygoogle || []).push({});
08-09-2014, 09:47 PM #2
Hi,

with you code you give the function no clientnumber - you send a hex to the function.
have a look on your code

--> look first on your function "GiveWeapon", it needs (int client, int weaponIndex)
--> GiveWeapon((0 * 0x580Cool Man (aka Tustin), 16); // with this you send GiveWeapon 0x5808, 16 to the function.
--> Function need GiveWeapon CLIENT WEAPONINDEX

change GiveWeapon((0 * 0x580Cool Man (aka Tustin), 16); to GiveWeapon(i , 16);

you get the clientnumber from selected row in listview

should work now Winky Winky
08-09-2014, 10:54 PM #3
xReaperv3
Bounty hunter
Originally posted by itzShades View Post
Hi,

with you code you give the function no clientnumber - you send a hex to the function.
have a look on your code

--> look first on your function "GiveWeapon", it needs (int client, int weaponIndex)
--> GiveWeapon((0 * 0x580Cool Man (aka Tustin), 16); // with this you send GiveWeapon 0x5808, 16 to the function.
--> Function need GiveWeapon CLIENT WEAPONINDEX

change GiveWeapon((0 * 0x580Cool Man (aka Tustin), 16); to GiveWeapon(i , 16);

you get the clientnumber from selected row in listview

should work now Winky Winky


0x5808 isnt a Weapon, it means the next client... Size of playerstate lol

Edit: GiveWeapon(listView1.FocusedItem.Index, 0x02);
08-09-2014, 10:57 PM #4
Hi thank you for you're answer, but i'have already use GiveWeapon(i,16) and my PS3 Freeze, i don't know why :(
08-09-2014, 11:03 PM #5
xReaperv3
Bounty hunter
Originally posted by Bobi061 View Post
Hi thank you for you're answer, but i'have already use GiveWeapon(i,16) and my PS3 Freeze, i don't know why :(


Hi, to get the current Index from your Listview you can do something like this:

GiveWeapon(listView1.FocusedItem.Index, 0x02); or only 2...

listView1.FocusedItem.Index = This is your current selected "Client" - you want to give a Weapon.
0x02 / 2 = Is the MP7, here is an Weapon List released, maybe this helps Smile
08-10-2014, 02:03 AM #6
Hash847
Purple God
for (int i = 0; i < this.listView1.Items.Count; i++)
{
if (this.listView1.Items.Selected == true)
{
GiveWeapon((0 * 0x580Cool Man (aka Tustin), 16);
}
}

this is your problem

"0 * 0x5808"

it already does it inside the function. remove that and it'll work fine. (client 0 works because 0 * anything will equal 0)
08-10-2014, 03:07 PM #7
Ethan
Ethan is awesome
Thread Moved To Mods & Glitch Questions
08-10-2014, 04:29 PM #8
Originally posted by Winter View Post
for (int i = 0; i < this.listView1.Items.Count; i++)
{
if (this.listView1.Items.Selected == true)
{
GiveWeapon((0 * 0x580Cool Man (aka Tustin), 16);
}
}

this is your problem

"0 * 0x5808"

it already does it inside the function. remove that and it'll work fine. (client 0 works because 0 * anything will equal 0)


If i remove this what i should wrote, the function need client, i understand then the interval is already in the function of giveweapon, but why, all i try did freeze my PS3 with the second client, on not the client 0, may be the function if not full ?
08-10-2014, 04:30 PM #9
Originally posted by xReaperv3 View Post
Hi, to get the current Index from your Listview you can do something like this:

GiveWeapon(listView1.FocusedItem.Index, 0x02); or only 2...

listView1.FocusedItem.Index = This is your current selected "Client" - you want to give a Weapon.
0x02 / 2 = Is the MP7, here is an Weapon List released, maybe this helps Smile


I've try this, work for client 0 but not client 1 etc .. :(
08-12-2014, 03:15 PM #10
Grrrr i'm alone with this problem x)

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo