Why server send this command 2 times ? - 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)
+--- Thread: Why server send this command 2 times ? (
/showthread.php?tid=460845)
Why server send this command 2 times ? -
bustern - 30.08.2013
When player enter checkpoint the server use my script TWO times ?
PHP код:
#define Money 100
SendClientMessage(playerid, 0xFFFFFFF, "You earned 100$, keep working :-)");
GivePlayerMoney(playerid, Money);
I want to server send this only one time.
Re: Why server send this command 2 times ? -
Lynchos - 30.08.2013
Why dont you just do this?
Код:
SendClientMessage(playerid, 0xFFFFFFF, "You earned 100$, keep working :-)");
GivePlayerMoney(playerid, 100);
Instead of defining shitloads of stuff
Re: Why server send this command 2 times ? -
bustern - 30.08.2013
because i want to define
Re: Why server send this command 2 times ? -
Lynchos - 30.08.2013
Alright, can you send the whole OnPlayerEnterCheckpoint?
Re: Why server send this command 2 times ? -
RedJohn - 30.08.2013
Quote:
Originally Posted by Lynchos
Why dont you just do this?
Код:
SendClientMessage(playerid, 0xFFFFFFF, "You earned 100$, keep working :-)");
GivePlayerMoney(playerid, 100);
Instead of defining shitloads of stuff
|
Maybe he will sometimes repeat the same code in his gamemode or filterscript, and if he wants to change money amount he needs to search across his maybe 10000 lines gamemode to find that amount.
With define just change #define money and it's changed in all places inside his gamemode.
BTW: OnPlayerEnterCheckpoint is needed.