21.07.2015, 20:48
Hello.
When we throw grenade and fast change weapon - grenade won't be throwned.
But.. OnPlayerKeyStateChange of course is called (KEY_FIRE).
It must be repaired..
Or is GTA:SA bug?
FIX:
When we throw grenade and fast change weapon - grenade won't be throwned.
But.. OnPlayerKeyStateChange of course is called (KEY_FIRE).
It must be repaired..
Or is GTA:SA bug?
FIX:
Код:
new throwned[MAX_PLAYERS]; public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { new weaponid = GetPlayerWeapon(playerid); if(newkeys & KEY_FIRE && weaponid == 16) { if(!throwned) { throwned = true; SendClientMessage(playerid, -1, "Grenade has been throwned."); } else { new weap[12], ammo[12]; for(new x = 0; x < 12; x++) { if(x == 8) continue; // No grenades GetPlayerWeaponData(playerid, x, weap[x], ammo[x]); } ResetPlayerWeapons(playerid); for(new x = 0; x < 12; x++) { if(x == 8) continue; // No grenades GivePlayerWeapon(playerid, weap[x], ammo[x]); } } } return 1; }