What's new

Question C++ TakeWeap

G

GhostsXModder96

Newbie
Messages
13
Reaction score
2
Points
45
Sin$
0
I really can't get the take weapon working in c++.

Like giving glow stick.
First it takes weapon, then it gives weapon, the give weapon works fine, but take weapon doesn't.

I have this:
C:
typedef void (*BG_TakePlayerWeapon)(unsigned int pPS, unsigned int weaponIndex,int takeAwayAmmo);
BG_TakePlayerWeapon TakeWeap = (BG_TakePlayerWeapon)0x82210A28;

typedef int (*G_GetWeaponIndexForName)(const char *name);
G_GetWeaponIndexForName GetWeaponIndex = (G_GetWeaponIndexForName)0x82210640;

typedef DWORD (*plAyerState_t)(int clientNum);
plAyerState_t plAyerState = (plAyerState_t)0x821E66A8;

void GiveGlowStick(int Client)
{
if((int)(0x83109D9C) != 1)
    (int)(0x83109D9C) = 1;
TakeWeap(plAyerState(Client), GetWeaponIndex("semtex_mp"), 0);
TakeWeap(plAyerState(Client), GetWeaponIndex("c4_mp"), 0);
TakeWeap(plAyerState(Client), GetWeaponIndex("claymore_mp"), 0);
TakeWeap(plAyerState(Client), GetWeaponIndex("flare_mp"), 0);
TakeWeap(plAyerState(Client), GetWeaponIndex("frag_grenade_short_mp"), 0);
TakeWeap(plAyerState(Client), GetWeaponIndex("smoke_grenade_mp"), 0);
TakeWeap(plAyerState(Client), GetWeaponIndex("throwingknife_mp"), 0);
TakeWeap(plAyerState(Client), GetWeaponIndex("concussion_grenade_mp"), 0);
GiveWeap(Client, "lightstick_mp", false, true, false);
}

Doesn't work :cry: pls help.
 
Top Bottom
Login
Register