[BUG] I can't understand how OnPlayerUpdate work!
#1

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);
    }
}
Reply
#2

You should really learn what OnPlayerUpdate callback is for. Check the wiki and forum.
Reply
#3

As long as you stand at this point you will be spammed with messages. If you leave, the messages will stop. Simple.
Reply
#4

SO FUNNY, I god damn know it.. ffs..
Reply
#5

Quote:
Originally Posted by ʂylaɾ
SO FUNNY, I god damn know it.. ffs..
And the reason why you made this topic is .... ??
Reply
#6

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


Forum Jump:


Users browsing this thread: 1 Guest(s)