Spawn Point Wont chage
#1

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
Reply
#2

In OnPlayerSpawn, use SetPlayerPos function.
Reply
#3

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
Reply
#4

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
Reply
#5

Anyone help??
Reply
#6

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;
}
Reply
#7

I still spawn in old location
Reply
#8

anyone??
Reply
#9

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;
}
Reply
#10

Now it just stuck in login keeps repeating login
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)