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.
|
In this case, the speed is not so important. In addition, they
global and I can use these functions
filterscripts
If you use an array, then the function
GivePlayerValidWeapon
It will not be accessible from filterscript.