Spawn Delay
#1

Hi guys.
Whenever someone in my server spawns for like a second, they are spawned at the "AddPlayerClass" x,y,z position. However after that they spawn at their previous position. I was just wondering if there is a way to be able to not spawn at the "AddPlayerClass" position and just straight away go to the previous position. Here is my AddPlayerClass code, and OnPlayerSpawn code.

PHP код:
for(new 1!= 311i++) AddPlayerClass(i, -1968.9745,137.8568,27.6875,88.8534000000); // This is under ongamemodeinit 
PHP код:
public OnPlayerSpawn(playerid)
{
       
SetPlayerInterior(playerid,0);
    
SetPlayerColor(playerid,COLOR_PLAYER);
    
TextDrawShowForPlayer(playerid,txtTimeDisp);
    
TextDrawShowForPlayer(playeridurlText);
    
TextDrawShowForPlayer(playeridJoinText);
    
SetPlayerPos(playeridPlayerInfo[playerid][pXPos], PlayerInfo[playerid][pYPos], PlayerInfo[playerid][pZPos]);
    
SetPlayerFacingAngle(playeridPlayerInfo[playerid][pAPos]); //Sets the player position to his last position
    
for(new i=0i<MAX_PLAYERSi++){TextDrawShowForPlayer(iZones[i]);}
    return 
1;

Any idea's would be greatly appreciated. Thanks for your time.
Reply
#2

Use SetSpawnInfo before you spawn the player.
Reply
#3

SetSpawnInfo is used once the player has logged in.

EDIT. I made OnPlayerRequestSpawn(playerid) etc.. And put the SetSpawnInfo in there and it works like charm.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)