SA-MP Forums Archive
Callback OnPlayerSpawn Doesnt work - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Callback OnPlayerSpawn Doesnt work (/showthread.php?tid=125600)



Callback OnPlayerSpawn Doesnt work - VonLeeuwen - 04.02.2010

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?


Re: Callback OnPlayerSpawn Doesnt work - Fj0rtizFredde - 04.02.2010

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


Re: Callback OnPlayerSpawn Doesnt work - VonLeeuwen - 04.02.2010

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


Re: Callback OnPlayerSpawn Doesnt work - Jedite kod Joa - 04.02.2010

i dont know what u want


Re: Callback OnPlayerSpawn Doesnt work - s0nic - 04.02.2010

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