SA-MP Forums Archive
Timer problem - 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: Timer problem (/showthread.php?tid=412597)



Timer problem - hydravink - 02.02.2013

So, I've got this problem, whenever a player connects, a message shows to everyone even though I made it so it shows for only the player.

Summary: 2 seconds after connecting, he will receive a message, but everyone gets it:

pawn Код:
public OnPlayerConnect(playerid)
{
    SetTimer("SendConnectingMessage", 2000, false);
    return 1;
}

forward SendConnectingMessage(playerid);
public SendConnectingMessage(playerid)
{
    SendClientMessage(playerid,  COLOR_WHITE,  "test"); //everyone on the server will get the message "test" after 2 seconds he connects, but it must be onlyfor the player that conected
}
Please help. Thank you.


Re: Timer problem - bensmart469 - 02.02.2013

Use SetTimerEx?


Re: Timer problem - hydravink - 02.02.2013

Why? Explain, I don't get it.


Re: Timer problem - Misiur - 02.02.2013

pawn Код:
SetTimer("SendConnectingMessage", 2000, false);
//to
SetTimerEx("SendConnectingMessage", 2000, false, "i", playerid);
https://sampwiki.blast.hk/wiki/SetTimerEx