SA-MP Forums Archive
How to Force spawn a player. - 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: How to Force spawn a player. (/showthread.php?tid=310992)



How to Force spawn a player. - jueix - 14.01.2012

Okay lets say i don't want the player request class thing popping up and things. how will i make it so the player basicly force spawns?


Re: How to Force spawn a player. - iGetty - 14.01.2012

Under onplayerconnect:

pawn Code:
SpawnPlayer(playerid);



Re: How to Force spawn a player. - jueix - 14.01.2012

Quote:
Originally Posted by iGetty
View Post
Under onplayerconnect:

pawn Code:
SpawnPlayer(playerid);
thanks man =,)


Re: How to Force spawn a player. - jueix - 14.01.2012

Quote:
Originally Posted by iGetty
View Post
Under onplayerconnect:

pawn Code:
SpawnPlayer(playerid);
just tryed it didnt work =,(


Re: How to Force spawn a player. - iGetty - 14.01.2012

Hmmm. Are you using a login/register system at all?


Re: How to Force spawn a player. - Steven82 - 14.01.2012

If it's kicking you, you need to have SetSpawnInfo before SpawnPlayer and then it will work. Hope this helps!


Re: How to Force spawn a player. - jueix - 14.01.2012

Quote:
Originally Posted by iGetty
View Post
Hmmm. Are you using a login/register system at all?
no im not using a log in or register system.


Re: How to Force spawn a player. - iGetty - 14.01.2012

Try to do what Steven82 said.


Re: How to Force spawn a player. - jueix - 14.01.2012

Quote:
Originally Posted by iGetty
View Post
Try to do what Steven82 said.
Having problems getting it to spawn where i want them to spawn it spawns them in that field and not at the pos they were all ready at im using it like this

SetSpawnInfo( playerid, 0, 0, pos1, pos2, pos3, 269.15, 26, 36, 28, 150, 0, 0 );
SpawnPlayer(playerid);


Re: How to Force spawn a player. - Steven82 - 14.01.2012

Well try using this code:

pawn Code:
// create a new global varibale at top of script
// new FirstSpawn[MAX_PLAYERS char];
public OnPlayerConnect(playerid)
{
    TogglePlayerSpecating(playerid, 1);
    FirstSpawn{playerid} = 1;
    return 1;
}

public OnPlayerSpawn(playerid)
{
    if(FistSpwan{playerid} == 1)
    {
        FirstSpawn{playerid} = 0;
        SetPlayerPos(playerid, pos1, pos2, pos3); // put your postions in here too and see if that works.
        TogglePlayerSpectating(playerid, 0);
    }
    return 1;
}