SA-MP Forums Archive
Spawn Point Wont chage - 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: Spawn Point Wont chage (/showthread.php?tid=403681)



Spawn Point Wont chage - Stefan_Merce - 31.12.2012

Well yes i tried to change the spawn point but it wont change i done /save spawn and put the code where it says
addplayerclass


Re: Spawn Point Wont chage - Konstantinos - 31.12.2012

In OnPlayerSpawn, use SetPlayerPos function.


Re: Spawn Point Wont chage - JaKe Elite - 31.12.2012

AddPlayerClass - add a skin that can be choose in OnPlayerRequestClassSelection

So you need to put SetPlayerPos on OnPlayerSpawn.
Don't forget to set player's interior. to 0


Re: Spawn Point Wont chage - Stefan_Merce - 31.12.2012

here is the code
public OnPlayerSpawn(playerid)
{
// Anti F4 Bug - Logging/Registering
if(!PlayerInfo[playerid][pLoggedIn] && !IsPlayerNPC(playerid))
{
if(IsPlayerNPC(playerid)) return 1;
SetPlayerPos(playerid, 1975.203002, 3779.311523, -50.243506);
SetPlayerCameraPos(playerid, 1975.203002, 3779.311523, 100.243506);
SetPlayerCameraLookAt(playerid, 1975.203002, 3779.311523, -0.243506);
SetSpawnInfo(playerid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
new file[64];
format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
// Player isn't banned
if(dini_Int(file, "AdminAccount") == 1)
{
format(file, sizeof(file), "users/%s.ini",RPNU(playerid));
SetPlayerName(playerid, dini_Get(file, "OldName"));
format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
ShowDialog(playerid, 2);




i want to change it to this
(0,-179.8350,1087.3606,19.7422,241.9190,0,0,0,0,0,0); // spawn


Re: Spawn Point Wont chage - Stefan_Merce - 31.12.2012

Anyone help??


Re: Spawn Point Wont chage - Threshold - 31.12.2012

pawn Код:
public OnPlayerSpawn(playerid)
{
// Anti F4 Bug - Logging/Registering
if(!PlayerInfo[playerid][pLoggedIn] && !IsPlayerNPC(playerid))
{
if(IsPlayerNPC(playerid)) return 1;
SetPlayerPos(playerid, -179.8350,1087.3606,19.7422);
SetPlayerFacingAngle(playerid, 241.9190);
SetPlayerCameraPos(playerid, 1975.203002, 3779.311523, 100.243506);
SetPlayerCameraLookAt(playerid, 1975.203002, 3779.311523, -0.243506);
SetTimerEx("ResetCam", 5000, false, "i", playerid);
//Remove SetSpawnInfo
//Code continues...
return 1;
}

//At the bottom of your script
forward ResetCam(playerid);
public ResetCam(playerid)
{
    SetCameraBehindPlayer(playerid);
    return 1;
}



Re: Spawn Point Wont chage - Stefan_Merce - 31.12.2012

I still spawn in old location


Re: Spawn Point Wont chage - Stefan_Merce - 31.12.2012

anyone??


Re: Spawn Point Wont chage - Threshold - 31.12.2012

Oh lol... wasn't reading the whole code.
Try this:
pawn Код:
public OnPlayerSpawn(playerid)
{
// Anti F4 Bug - Logging/Registering
if(IsPlayerNPC(playerid)) return 1;
if(PlayerInfo[playerid][pLoggedIn])
{
SetPlayerPos(playerid, -179.8350,1087.3606,19.7422);
SetPlayerFacingAngle(playerid, 241.9190);
SetPlayerCameraPos(playerid, 1975.203002, 3779.311523, 100.243506);
SetPlayerCameraLookAt(playerid, 1975.203002, 3779.311523, -0.243506);
SetTimerEx("ResetCam", 5000, false, "i", playerid);
//Remove SetSpawnInfo
//Code continues...
return 1;
}

//At the bottom of your script
forward ResetCam(playerid);
public ResetCam(playerid)
{
    SetCameraBehindPlayer(playerid);
    return 1;
}



Re: Spawn Point Wont chage - Stefan_Merce - 31.12.2012

Now it just stuck in login keeps repeating login