Serverside for weapons
#4

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.
Reply


Messages In This Thread
Serverside for weapons - by jamal1992 - 31.08.2015, 19:57
Re: Serverside for weapons - by Logofero - 31.08.2015, 20:23
Re: Serverside for weapons - by Vince - 31.08.2015, 20:50
Re: Serverside for weapons - by Logofero - 31.08.2015, 21:05
Re: Serverside for weapons - by Logofero - 31.08.2015, 21:12
Re: Serverside for weapons - by Logofero - 31.08.2015, 21:18
Re: Serverside for weapons - by jamal1992 - 31.08.2015, 21:31
Re: Serverside for weapons - by jamal1992 - 31.08.2015, 21:40

Forum Jump:


Users browsing this thread: 1 Guest(s)