Post: Release: G_GivePlayerWeapon + Switch Weapon [1.06]
12-22-2013, 09:43 AM #1
ZeiiKeN
Group 935
(adsbygoogle = window.adsbygoogle || []).push({}); Hi,

I decided to share with you the G_GivePlayerWeapon for a given weapon to the desired client.

I have this long and I use it at the time via another method until choco are sharing rpc call.

You first need to follow this tutorial : You must login or register to view this content.

Fonctionnal in 1.06

Sorry for my bad english I'm french.

C#:

    uint SV_Gamesendservercommand = 0x5A610C;
uint PlayerState = 0xF12C80;
uint G_GivePlayerWeapon = 0x28C05C;
uint Add_Ammo = 0x241310;

public void SV_GameSendServerCommand(int Client, string Command)
{
GHOSTS.RPC.Call(SV_Gamesendservercommand, Client, 0, Command);
}

private void GiveWeapon(int client, int weapon, int ammo, int akimbo)
{
GHOSTS.RPC.Call(G_GivePlayerWeapon, (uint)(PlayerState + (client * 0x3600)), weapon, akimbo);
GHOSTS.RPC.Call(Add_Ammo, (uint)(PlayerState + (client * 0x3600)), weapon, 0, ammo, 1);
GHOSTS.RPC.Call(SV_Gamesendservercommand, client, 0, "a \"" + weapon + "\"");
}


Example How to use it for client 0:

    GiveWeapon(0, 67, 999, 0);


the first zero corresponds to the client 0, for change by 1 the client 1 so on.
67 Corresponds to the minigun weapon, change the index by that of another weapon.
999 given ammo.
the last zero is the weapon akimbo, 0 no akimbo weapon 1 for akimbo weapon.

Weapons Index:

    67 = MiniGun
37 = Walking IMS
113 = Mortar Strike
95 = Laptop
90 = Iphone :p


Credits:

ZeiiKeN ( Offsets And Tutorial )
Choco ( You must login or register to view this content.)
Im A Hooker ( SwitchWeapon )
(adsbygoogle = window.adsbygoogle || []).push({});

The following 17 users say thank you to ZeiiKeN for this useful post:

192.168.1.1, RawDog2002, BaSs_HaXoR, EG6, ImSooCool, InfinityISB4CK, ItsMagiicsz, M-alShammary, Mango_Knife, Notorious, PussayPatrol, SeeNoKey, Txctical, x_action_x, Fatality
12-24-2013, 11:56 PM #20
Je ne comprends pas pourquoi ça ne marche pas pour moi :(

Mon code :

You must login or register to view this content.

J'ai fais plusieurs essais, je n'ais pas d'erreurs, mais rien ne se passe :(
12-25-2013, 04:05 AM #21
Originally posted by ZeiiKeN View Post
Hi,

I decided to share with you the G_GivePlayerWeapon for a given weapon to the desired client.

I have this long and I use it at the time via another method until choco are sharing rpc call.

You first need to follow this tutorial : You must login or register to view this content.

Fonctionnal in 1.06

Sorry for my bad english I'm french.

C#:

    uint SV_Gamesendservercommand = 0x5A610C;
uint PlayerState = 0xF12C80;
uint G_GivePlayerWeapon = 0x28C05C;
uint Add_Ammo = 0x241310;

public void SV_GameSendServerCommand(int Client, string Command)
{
GHOSTS.RPC.Call(SV_Gamesendservercommand, Client, 0, Command);
}

private void GiveWeapon(int client, int weapon, int ammo, int akimbo)
{
GHOSTS.RPC.Call(G_GivePlayerWeapon, (uint)(PlayerState + (client * 0x3600)), weapon, akimbo);
GHOSTS.RPC.Call(Add_Ammo, (uint)(PlayerState + (client * 0x3600)), weapon, 0, ammo, 1);
GHOSTS.RPC.Call(SV_Gamesendservercommand, client, 0, "a \"" + weapon + "\"");
}


Example How to use it for client 0:

    GiveWeapon(0, 67, 999, 0);


the first zero corresponds to the client 0, for change by 1 the client 1 so on.
67 Corresponds to the minigun weapon, change the index by that of another weapon.
999 given ammo.
the last zero is the weapon akimbo, 0 no akimbo weapon 1 for akimbo weapon.

Weapons Index:

    67 = MiniGun
37 = Walking IMS
113 = Mortar Strike
95 = Laptop
90 = Iphone :p


Credits:

ZeiiKeN ( Offsets And Tutorial )
Choco ( You must login or register to view this content.)
Im A Hooker ( SwitchWeapon )


how would you take away a wepon?
12-25-2013, 08:57 PM #22
iDev
Grunt
Originally posted by seb5594 View Post
Not bad. Will be usefull for other ppl. Any Credits for Switchweapon?


You must login or register to view this content.


A list with all Weapon Ids you can add it to your post may be usefull for it Smile
You must login or register to view this content.

Just because you posted it on other website does not mean that everybody saw it there... i had it since TU2 and i immetialy understood its mission when i saw it, but i never tried it because i didnt use giving weapons with functions back then.
12-26-2013, 03:18 AM #23
I add rpc to my project but how to put this on vs13 Smile
12-26-2013, 08:32 AM #24
RawDog2002
NextGenUpdate Elite
nice on buddy

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo