Post: [RELEASE]GivePlayerWeapon for 1.09
03-07-2014, 03:25 AM #1
Absolute Zero
Do your homework, fool.
(adsbygoogle = window.adsbygoogle || []).push({});
Give Player Weapon for Ghosts 1.09

Info:

Hey guys, just thought I would throw this out to whoever doesn't have it, pretty simple to update for 1.09. All you need to use this is PS3Lib and Choco's RPC (If you have different RPC you can edit it for that RPC). So yeah, here's the code below.

What Does This Do?

This allows you to give yourself (or another client) a gun in game, can be very useful when making client mods and mod menus. With this you can give yourself the walking Loki and other fun weapons.

How to Use:

Firstly, insert this somewhere in your coding:

     public static class Conversions
{
public static uint PlayerState = 0xF43B00;
public static byte[] ReverseBytes(byte[] input)
{
Array.Reverse(input);
return input;
}
}


That is for g_client. Next, add this:

    public static void SV_GameSendServerCommand(int Client, string Command)
{
RPC.Call(0x53D984, new object[]
{
Client,
0,
Command
});
}


That is the SV_GameSendServerCommand function for RPC. Lastly, add this:

    private void GiveWeapon(int client, int weapon, int ammo, int akimbo)
{
RPC.Call(0x290504, (uint)(Conversions.PlayerState + (client * 0x3700)), weapon, akimbo);
RPC.Call(0x244E84, (uint)(Conversions.PlayerState + (client * 0x3700)), weapon, 0, ammo, 1);
RPC.Call(0x53D984, client, 0, "a \"" + weapon + "\"");
}

That is the actual function that can give weapons in game. You use this by typing this into a button, checkbox, etc. Whatever you want to put it in:

    
GiveWeapon(0, (weapon id here), 999, 0);


Breakdown:
The 0 is the client number, so change it according to what client you want to use it for. The second part is where you put the weapon index number. There are threads with weapon ids all over NGU. For example though, 135 is the Maverick, 136 is the Ripper, and 137 is the Maverick A2. The third part where 999 is is the ammo. 999 is full ammo for the weapon, but you can mess with it as you so please. And finally, the 0 at the end represents akimbo. To set akimbo, simply set the 0 to a 1, or keep it at 0 for no akimbo.

Wrap Up:
That's basically it guys, hope this helps you develop bigger and better things and helps you learn. This is the way I do it, so please do not hate if there is an easier way. It works regardless, that is the point. Well, enjoy!

~Zero~

And because Christian requested, credits to him for giving me the AddAmmo address because I couldn't find it anywhere :/
(adsbygoogle = window.adsbygoogle || []).push({});

The following 6 users say thank you to Absolute Zero for this useful post:

Eddie Mac, K-9MEMBER, MaNamesTyler, Mango_Knife, Notorious, RatchetBooty
03-07-2014, 03:44 AM #2
RatchetBooty
Former Staff
Great tutorial for the newbs :yes: Keep it up bro! And whats you're skype? I want to ask you something!
03-07-2014, 03:46 AM #3
Absolute Zero
Do your homework, fool.
Originally posted by RatchetBooty View Post
Great tutorial for the newbs :yes: Keep it up bro! And whats you're skype? I want to ask you something!


Pm me man.
03-07-2014, 12:03 PM #4
Mango_Knife
In my man cave
Originally posted by ZeroNGU View Post
Give Player Weapon for Ghosts 1.09

Info:

Hey guys, just thought I would throw this out to whoever doesn't have it, pretty simple to update for 1.09. All you need to use this is PS3Lib and Choco's RPC (If you have different RPC you can edit it for that RPC). So yeah, here's the code below.

What Does This Do?

This allows you to give yourself (or another client) a gun in game, can be very useful when making client mods and mod menus. With this you can give yourself the walking Loki and other fun weapons.

How to Use:

Firstly, insert this somewhere in your coding:

     public static class Conversions
{
public static uint PlayerState = 0xF43B00;
public static byte[] ReverseBytes(byte[] input)
{
Array.Reverse(input);
return input;
}
}


That is for g_client. Next, add this:

    public static void SV_GameSendServerCommand(int Client, string Command)
{
RPC.Call(0x53D984, new object[]
{
Client,
0,
Command
});
}


That is the SV_GameSendServerCommand function for RPC. Lastly, add this:

    private void GiveWeapon(int client, int weapon, int ammo, int akimbo)
{
RPC.Call(0x290504, (uint)(Conversions.PlayerState + (client * 0x3700)), weapon, akimbo);
RPC.Call(0x244E84, (uint)(Conversions.PlayerState + (client * 0x3700)), weapon, 0, ammo, 1);
RPC.Call(0x53D984, client, 0, "a \"" + weapon + "\"");
}

That is the actual function that can give weapons in game. You use this by typing this into a button, checkbox, etc. Whatever you want to put it in:

    
GiveWeapon(0, (weapon id here), 999, 0);


Breakdown:
The 0 is the client number, so change it according to what client you want to use it for. The second part is where you put the weapon index number. There are threads with weapon ids all over NGU. For example though, 135 is the Maverick, 136 is the Ripper, and 137 is the Maverick A2. The third part where 999 is is the ammo. 999 is full ammo for the weapon, but you can mess with it as you so please. And finally, the 0 at the end represents akimbo. To set akimbo, simply set the 0 to a 1, or keep it at 0 for no akimbo.

Wrap Up:
That's basically it guys, hope this helps you develop bigger and better things and helps you learn. This is the way I do it, so please do not hate if there is an easier way. It works regardless, that is the point. Well, enjoy!

~Zero~


Was about to make this tutorial Winky Winky
But i see you made it so never mind Smile
But when 2 things:
1) ahh the offset G_GivePlayerWeapon already got released
2) I will add this tut to my thread Smile
3) Try this RPC: You must login or register to view this content.
its more faster and its for CEX and DEX.
03-07-2014, 12:05 PM #5
Absolute Zero
Do your homework, fool.
Originally posted by Knife View Post
Was about to make this tutorial Winky Winky
But i see you made it so never mind Smile
But when 2 things:
1) ahh the offset G_GivePlayerWeapon already got released
2) I will add this tut to my thread Smile
3) Try this RPC: You must login or register to view this content.
its more faster and its for CEX and DEX.


Oh haha I already have better RPC, I was just saying that for those who didn't and wanted to use this :P
03-07-2014, 12:05 PM #6
Absolute Zero
Do your homework, fool.
Originally posted by Knife View Post
Was about to make this tutorial Winky Winky
But i see you made it so never mind Smile
But when 2 things:
1) ahh the offset G_GivePlayerWeapon already got released
2) I will add this tut to my thread Smile
3) Try this RPC: You must login or register to view this content.
its more faster and its for CEX and DEX.


And also the function I used uses g_giveplayerweapon Smile
03-07-2014, 12:09 PM #7
Mango_Knife
In my man cave
Originally posted by ZeroNGU View Post
And also the function I used uses g_giveplayerweapon Smile


Yeah i know
This is how i coded it:

    
private void GiveWeapon(int client, int weapon, int ammo, int akimbo)
{
CallFunction(0x290504, (uint)(0xF43B00 + (client * 0x3700)), weapon, akimbo);
CallFunction(0x00244E84, (uint)(0xF43B00 + (client * 0x3700)), weapon, 0, ammo, 1);
CallFunction(0x53D984, client, 0, "a \"" + weapon + "\"");
}

//0x290504 - G_GivePlayerWeapon Offset
//0x00244E84 - Add_Ammo Offset
//0x53D984 - SV Offset
//0xF43B00 - G_Client Offset
//0x3700 - Index/Intervnal


You will need those offsets to spawn the Guns!
Exmple:
{
GiveWeapon((int)ClientInt, 134, 999, 0);
}

You can also use numericUpDown to clients Smile

Here are some weapons that i found if you want them Winky Winky
    
GiveWeapon(0, 20, 999, 0); - Machine Gun
GiveWeapon(0, 121, 999, 0); - Odin Smoke Gun
GiveWeapon(0, 37, 999, 0); - I.M.S
GiveWeapon(0, 120, 999, 0); - Loki 40mm
GiveWeapon(0, 118, 999, 0); - Loki 105mm
GiveWeapon(0, 119, 999, 0); - Odin Care Package Gun


THe "(0," Is the client so just change it Smile
Thanks to ItsLollo1000,Raz0rMind and me For some addresses Smile
03-07-2014, 12:33 PM #8
Absolute Zero
Do your homework, fool.
Originally posted by Knife View Post
Yeah i know
This is how i coded it:

    
private void GiveWeapon(int client, int weapon, int ammo, int akimbo)
{
CallFunction(0x290504, (uint)(0xF43B00 + (client * 0x3700)), weapon, akimbo);
CallFunction(0x00244E84, (uint)(0xF43B00 + (client * 0x3700)), weapon, 0, ammo, 1);
CallFunction(0x53D984, client, 0, "a \"" + weapon + "\"");
}

//0x290504 - G_GivePlayerWeapon Offset
//0x00244E84 - Add_Ammo Offset
//0x53D984 - SV Offset
//0xF43B00 - G_Client Offset
//0x3700 - Index/Intervnal


You will need those offsets to spawn the Guns!
Exmple:
{
GiveWeapon((int)ClientInt, 134, 999, 0);
}

You can also use numericUpDown to clients Smile

Here are some weapons that i found if you want them Winky Winky
    
GiveWeapon(0, 20, 999, 0); - Machine Gun
GiveWeapon(0, 121, 999, 0); - Odin Smoke Gun
GiveWeapon(0, 37, 999, 0); - I.M.S
GiveWeapon(0, 120, 999, 0); - Loki 40mm
GiveWeapon(0, 118, 999, 0); - Loki 105mm
GiveWeapon(0, 119, 999, 0); - Odin Care Package Gun


THe "(0," Is the client so just change it Smile
Thanks to ItsLollo1000,Raz0rMind and me For some addresses Smile


Ok, but there was really no need to post your entire thread inside mine :P
03-07-2014, 12:48 PM #9
Mango_Knife
In my man cave
Originally posted by ZeroNGU View Post
Ok, but there was really no need to post your entire thread inside mine :P


Haha i didnt just wanted to help :P
03-07-2014, 12:49 PM #10
Absolute Zero
Do your homework, fool.
Originally posted by Knife View Post
Haha i didnt just wanted to help :P


Even though there was no help needed, thanks for the attempt Smile

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo