How to make connect message delayed? - 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: How to make connect message delayed? (
/showthread.php?tid=243827)
How to make connect message delayed? -
grand.Theft.Otto - 24.03.2011
Say when a player connects, it shows a textdraw or gametext on the screen, etc...
I want it to be delayed for maybe 5 seconds so the player can take a quick look before it puts the player into class selection.
Do I use SetTimer?
Re: How to make connect message delayed? -
Gamer_Z - 24.03.2011
Yes that can be used.
Re: How to make connect message delayed? -
Markx - 24.03.2011
Quote:
Originally Posted by gamer_Z
Yes that can be used.
|
not really, IMO, its better to use GameTextForPlayer
Re: How to make connect message delayed? -
Gamer_Z - 24.03.2011
He want's to delay the execution of code so the player screen will be 'frozen' for a while.. at least that is what I think he wants to do.
Re: How to make connect message delayed? -
grand.Theft.Otto - 24.03.2011
Yes, gamer_Z is correct.
Re: How to make connect message delayed? -
Gamer_Z - 24.03.2011
Yep then let's say, make a copy of your current 'public OnPlayerconnect...' and name it something like OnPlayerConnect2 and in OnPlayerConnect make a timer that calls OnPlayerConnect2 BUT do NOT use SETTIMER BUT INSTEAD USE SetTimerEx("OnPlayerConnect2",5000,0,"d",playerid) ;
example:
pawn Код:
public OnPlayerConnect(playerid)
{
SetTimerEx("OnPlayerConnect2",5000,0,"d",playerid);
return 1;
}
forward OnPlayerConnect2(playerid);
public OnPlayerConnect2(playerid)
{
//your original onplayerconnect code
}
Re: How to make connect message delayed? -
grand.Theft.Otto - 24.03.2011
Thanks. But it delays 5 seconds AFTER the player is in class selection, not when they are on the Santa Marina Beach background.
Do you know why?
Re: How to make connect message delayed? -
Gamer_Z - 24.03.2011
Maybe it's the client that after load it goes to another 'default' location? Or your code is maybe wrong.