[BUG] I can't understand how OnPlayerUpdate work! - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [BUG] I can't understand how OnPlayerUpdate work! (
/showthread.php?tid=135960)
[BUG] I can't understand how OnPlayerUpdate work! -
Rand_Omar - 22.03.2010
Er... back again with a new bug (in my opinion)
When i try to use OnPlayerUpdate feature to make something automatically happen..
EX.: I've created a park, when you get near the gate you automatically pay $50, then the gate will open and you will enter, the gate will close in few seconds
Problem: Everything is working good, but.. i am getting spammed with the game texts and client messages..!!
pawn Код:
public OnPlayerUpdate(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 10, 1667.80, -1547.85, 13.38))
{
GameTextForPlayer(playerid, "You've paid a fee of $50 for entering the park!", 5000, 1);
MoveObject(LSCP1, 1668.717896, -1479.989502, 13.38, 1);
SendClientMessage(playerid, 0x8080FFFF, "Gate will close in few seconds");
GivePlayerMoney(playerid, -50);
SetTimer("LSCP1Timer", 7000, 0);
}
}
Re: [BUG] I can't understand how OnPlayerUpdate work! -
Correlli - 22.03.2010
You should really learn what OnPlayerUpdate callback is for. Check the wiki and forum.
Re: [BUG] I can't understand how OnPlayerUpdate work! -
MadeMan - 22.03.2010
As long as you stand at this point you will be spammed with messages. If you leave, the messages will stop. Simple.
Re: [BUG] I can't understand how OnPlayerUpdate work! -
Rand_Omar - 22.03.2010
SO FUNNY, I god damn know it.. ffs..
Re: [BUG] I can't understand how OnPlayerUpdate work! -
MadeMan - 22.03.2010
Quote:
Originally Posted by ʂylaɾ
SO FUNNY, I god damn know it.. ffs..
|
And the reason why you made this topic is .... ??
Re: [BUG] I can't understand how OnPlayerUpdate work! -
MenaceX^ - 22.03.2010
Because this public sends more than 40 packs per second, and it's like your 40 times at the same place so it checks 40 if's, and if you're where the IsPlayerRangeOfPoint stuff, it'll do actions for you 40 times.
Just make a variable.