Posts: 330
Threads: 118
Joined: Jul 2010
Reputation:
0
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?
Posts: 6,129
Threads: 36
Joined: Jan 2009
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);
}