18.05.2011, 14:54
Now im encountering 2 problems, im using this:
with a timer SetTimer("isPlayerInArea", 1000, 1);
What I want is, to allow weapons in MULTIPLE areas. So how do I add in another area where weapons wont be reset?
And second, because of the timer that checks every 1 second, the weapon (in this case id 26 sawn off shotgun) gets 500 bullets every 1 second. I don't want this to happen. How can I make that possible? If I remove the timer, the 'isplayerinarea' check doesn't work.
PHP код:
public isPlayerInArea()
{
new Float:X, Float:Y, Float:Z;
for(new i=0; i < MAX_PLAYERS; i++)
{
GetPlayerPos(i, X, Y, Z);
if (X <= 2806.4766 && X >= 2566.6860 && Y <= -2332.2461 && Y >= -2562.3301)
{
GivePlayerWeapon(i, 26, 500);
}
else
{
ResetPlayerWeapons(i);
}
}
}
What I want is, to allow weapons in MULTIPLE areas. So how do I add in another area where weapons wont be reset?
And second, because of the timer that checks every 1 second, the weapon (in this case id 26 sawn off shotgun) gets 500 bullets every 1 second. I don't want this to happen. How can I make that possible? If I remove the timer, the 'isplayerinarea' check doesn't work.