10.04.2012, 12:15
Sure
// Loop through weapons - an example
if( GetPlayerWeaponState( playerid ) == WEAPONSTATE_NO_BULLETS )
{
// Reset the variable to false
}
You're correct on that. If someone runs out of ammo, the variable is still on true so he can spawn with cheats the same weapon.
I'd recommend to reset the variable to false. pawn Код:
|
If you hold down aim and fire, some weapons will stay in your hands, even when they've run out of ammo.
That'd cause some false bans ----- Also, updated. |
if(newkeys & KEY_FIRE) { new weaponid = GetPlayerWeapon(playerid); if( GetPlayerWeaponState(weaponid) == WEAPONSTATE_LAST_BULLET ) { SSWeapon[playerid][weaponid] = false; // SendClientMessage(playerid, 0xFF0000FF, "Weapon Empty Reseted-"); return 1; } }
I tried this under onplayerkeystate not working.
Код:
if(newkeys & KEY_FIRE) { new weaponid = GetPlayerWeapon(playerid); if( GetPlayerWeaponState(weaponid) == WEAPONSTATE_LAST_BULLET ) { SSWeapon[playerid][weaponid] = false; // SendClientMessage(playerid, 0xFF0000FF, "Weapon Empty Reseted-"); return 1; } } |
Originally Posted by Original Post
Oh, almost forgot! Be sure to give a parachute on spawn or script a workaround. Also for police cars and the caddy.
|