SpawnPlayer Doesn't work.
#1

I'm using SpawnPlayer(playerid); and it's not working.
I have both AddPlayerClass & SetSpawnInfo, but the function just isn't being called.
It keeps me at Skin selection screen. I feel like a newbie asking this question, but yeah what's going on here.
Reply
#2

Could you show some more code? Where are you calling SpawnPlayer?
Reply
#3

pawn Код:
if(dialogid == DIALOG_LOGIN)
    {
        if(response)
        {
            // Login Info here - Loads player files etc. Proceeds to spawn player below
 
                SendClientMessage(playerid,-1,"Thank you for coming back. You're now logged in.");
                SpawnPlayer(playerid);
            }
            else
            {
                format(string, sizeof(string), " {F81414}Welcome back {FFFFFF}%s\n{F81414}Please enter your current password below.", pName(playerid));
                ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{FFFFFF}Welcome back to LSL:RP", string, "Login", "Leave");
            }
        }
        else {
            SendClientMessage(playerid, C_WHITE, " You've been kicked. Reason: Invalid Password.");
            Kick(playerid);
        }
    }
Reply
#4

I don't see SetSpawnInfo above SpawnPlayer.
Reply
#5

Quote:
Originally Posted by -Luis
Посмотреть сообщение
I don't see SetSpawnInfo above SpawnPlayer.
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetSpawnInfo(playerid, 0, 0, 0.00, 0.00, 0.00, 0.00, 0, 0, 0, 0, 0, 0);
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
}
Reply
#6

Try setting above SpawnPlayer worked for me when I tried it.
Reply
#7

pawn Код:
if(dialogid == DIALOG_LOGIN)
    {
        if(response)
        {
            // Login Info here - Loads player files etc. Proceeds to spawn player below
 
                SendClientMessage(playerid,-1,"Thank you for coming back. You're now logged in.");
                SetSpawnInfo(playerid, 0, 0, 0.00, 0.00, 0.00, 0.00, 0, 0, 0, 0, 0, 0);
            }
            else
            {
                format(string, sizeof(string), " {F81414}Welcome back {FFFFFF}%s\n{F81414}Please enter your current password below.", pName(playerid));
                ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{FFFFFF}Welcome back to LSL:RP", string, "Login", "Leave");
            }
        }
        else {
            SendClientMessage(playerid, C_WHITE, " You've been kicked. Reason: Invalid Password.");
            Kick(playerid);
        }
    }
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SpawnPlayer(playerid);
    return 1;
}
Try that. Should work.
Reply
#8

Nope didn't work.

EDIT: Didn't see your post Topaz, let me try that.
Reply
#9

Tried what I said?
Reply
#10

Try placing SetSpawnInfo above SpawnPlayer( playerid ); in DIALOG_LOGIN. That should work.

pawn Код:
if(dialogid == DIALOG_LOGIN)
    {
        if(response)
        {
            // Login Info here - Loads player files etc. Proceeds to spawn player below
 
                SendClientMessage(playerid,-1,"Thank you for coming back. You're now logged in.");
                SetSpawnInfo(playerid, 0, 0, 0.00, 0.00, 0.00, 0.00, 0, 0, 0, 0, 0, 0);
                SpawnPlayer( playerid );
            }
            else
            {
                format(string, sizeof(string), " {F81414}Welcome back {FFFFFF}%s\n{F81414}Please enter your current password below.", pName(playerid));
                ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{FFFFFF}Welcome back to LSL:RP", string, "Login", "Leave");
            }
        }
        else {
            SendClientMessage(playerid, C_WHITE, " You've been kicked. Reason: Invalid Password.");
            Kick(playerid);
        }
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)