Timer before spawn
#1

I've been having this bug when spawning and figured out that if I just let the map load before clicking spawn it fixes the problem. I want to add a timer for about 6 seconds when the player is on, OnPlayerRequestClass, which will not let them spawn until the six seconds have passed. Can anyone help me?
Reply
#2

You can return 0 in your OnPlayerRequestClass callback and initiate a timer to call SpawnPlayer() in '6 seconds'. An example of how to do this would be (as a snippet in your OnPlayerRequestClass callback):

pawn Код:
SetTimerEx("_timer_SpawnPlayer", 6000, false, "dd", playerid, classid);
return 0;
And as an external function (for the timer):

pawn Код:
forward _timer_SpawnPlayer(playerid, classid);
public _timer_SpawnPlayer(playerid, classid) {
   SetSpawnInfo() // You'll have to update this code yourself, to reflect the classes you've scripted. You can use the classid variable as a reference to which class the player chose
   return SpawnPlayer(playerid);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)