Callback OnPlayerSpawn Doesnt work
#1

Hey,

I made a little script, and somehow the Callback OnPlayerSpawn doesn't work.
Here is my script (the parts which are relevant): http://pawn.pastebin.com/m1bd725a9

I'm sure its in the /login or /register command, as thats the only thing I created so far.

What's wrong, and how can I fix it?
Reply
#2

Try to put logged[playerid] = 0; in OnPlayerConnect? :P
Reply
#3

I tried it, didn't work, thanks for the help tho
Reply
#4

i dont know what u want
Reply
#5

You can try this:
pawn Код:
public OnPlayerSpawn(playerid)
{
    if (!logged[playerid])
    {
        SendClientMessage(playerid, COLOR_RED, "This server requires you to login before spawning. Please reconnect and use the /login command.");
        Kick(playerid);
        return 1;
    }
    return 1;
}
You can also try it OnPlayerRequestSpawn:
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if(!logged[playerid])
    {
        SendClientMessage(playerid,COLOR_RED,"Be aware: You are not logged in yet!");
        return 0;
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)