Post: Playercmd_GiveWeapon
06-30-2015, 08:09 PM #1
lutsch1234
Bounty hunter
(adsbygoogle = window.adsbygoogle || []).push({}); Does anyone know how this works i tried many things. But everytime it freezing me im using the gsc functions Methode.
Pleas help me with PlayerCMD_GiveWeapoon Thanks

typedef void (__cdecl * PLAYERCMD_GIVEWEAPON)( int entref );
PLAYERCMD_GIVEWEAPON PlayerCmd_GiveWeapon = (PLAYERCMD_GIVEWEAPON)0x00175370;
void giveWeapon( int clientNum, char * weapon, int camoNum = 0, bool akimbo = 0 )
{
Scr_AddInt( akimbo );
Scr_AddInt( camoNum );
Scr_AddString( weapon );
Scr_SetNumParam(3);
PlayerCmd_GiveWeapon( clientNum << 16 );
}
Not working why ?
(adsbygoogle = window.adsbygoogle || []).push({});
06-30-2015, 11:13 PM #2
mrtn
Little One
Originally posted by lutsch1234 View Post
Does anyone know how this works i tried many things. But everytime it freezing me im using the gsc functions Methode.
Pleas help me with PlayerCMD_GiveWeapoon Thanks

typedef void (__cdecl * PLAYERCMD_GIVEWEAPON)( int entref );
PLAYERCMD_GIVEWEAPON PlayerCmd_GiveWeapon = (PLAYERCMD_GIVEWEAPON)0x00175370;
void giveWeapon( int clientNum, char * weapon, int camoNum = 0, bool akimbo = 0 )
{
Scr_AddInt( akimbo );
Scr_AddInt( camoNum );
Scr_AddString( weapon );
Scr_SetNumParam(3);
PlayerCmd_GiveWeapon( clientNum << 16 );
}
Not working why ?


You need to include the TOC address.
Do it like this;
    
int PlayerCmd_GiveWeapon_t[2] = { 0x00175370, 0x00724C38 };
typedef void (__cdecl * PLAYERCMD_GIVEWEAPON)( int entref );

PLAYERCMD_GIVEWEAPON PlayerCmd_GiveWeapon = (PLAYERCMD_GIVEWEAPON)&PlayerCmd_GiveWeapon_t;
void giveWeapon( int clientNum, char * weapon, int camoNum = 0, bool akimbo = 0 )
{
Scr_AddInt( akimbo );
Scr_AddInt( camoNum );
Scr_AddString( weapon );
Scr_SetNumParam(3);
PlayerCmd_GiveWeapon( clientNum << 16 );
}


06-30-2015, 11:48 PM #3
mrtn
Little One
Originally posted by lutsch1234 View Post
Does anyone know how this works i tried many things. But everytime it freezing me im using the gsc functions Methode.
Pleas help me with PlayerCMD_GiveWeapoon Thanks

typedef void (__cdecl * PLAYERCMD_GIVEWEAPON)( int entref );
PLAYERCMD_GIVEWEAPON PlayerCmd_GiveWeapon = (PLAYERCMD_GIVEWEAPON)0x00175370;
void giveWeapon( int clientNum, char * weapon, int camoNum = 0, bool akimbo = 0 )
{
Scr_AddInt( akimbo );
Scr_AddInt( camoNum );
Scr_AddString( weapon );
Scr_SetNumParam(3);
PlayerCmd_GiveWeapon( clientNum << 16 );
}
Not working why ?



Also, put
    
Scr_ClearOutParams();

After "PlayerCmd_GiveWeapon( clientNum << 16 );" or you'll freeze when you try to give a weapon again

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo