04.02.2012, 11:24
hi there, is there any function to get the weapon slot of the weapon that the player is currently holding?
new
Weapons = 0, Ammo, Msg[ 64 ];
for( new i = 0; i < 13; i ++ )
{
GetPlayerWeaponData( playerid, i, Weapons, Ammo );
if( Weapons != 0 )
{
format( Msg, sizeof( Msg ), "%d: %d (%d)", i, Weapons, Ammo );
SendClientMessage( playerid, -1, Msg );
}
}
pawn Код:
|
new
Weapons = 0, Ammo;
for( new i = 0; i < 13; i ++ )
{
GetPlayerWeaponData( playerid, i, Weapons, Ammo );
if(Weapons == GetPlayerWeapon(playerid))
{
printf("The slot is: %d", i);
}
}