Quote:
Originally Posted by Vince
PVars are way too slow, especially if coupled with format and OnPlayerUpdate. I'd rather use an array like:
pawn Код:
gPlayerWeaponData[MAX_PLAYERS][47]
And then use something like:
pawn Код:
SafeGivePlayerWeapon(playerid, weaponid, ammo) { gPlayerWeaponData[playerid][weaponid] = ammo; return GivePlayerWeapon(playerid, weaponid, ammo); }
Next, check the example for OnPlayerWeaponChange on the wiki page of OnPlayerUpdate (which regrettably also uses PVars, but that aside). If the player changes to a weapon for which he has no ammo then the weapon is being hacked in. Take note to exclude parachutes and detonators as these are given automatically by the game.
|
I make something like you tell me, thanks a lot !