SA-MP Forums Archive
OnPlayerRequestSpawn Problem - 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: OnPlayerRequestSpawn Problem (/showthread.php?tid=378750)



OnPlayerRequestSpawn Problem - Glint - 19.09.2012

Hello guys i have made a register / login system and now if i input the password in the login window falsely for 2 times the class selection window appears so if someone press on spawn he gets spawned so what i did is create a variable to check if the player is logged in or not and i put it under OnPlayerRequestSpawn
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if(IsLogged[playerid] == 0)
    {
        SendClientMessage(playerid, -1, "{FF5500}>{C3C3C3} You Can't Spawn Now");
    }
    else return 0;
    return 1;
}
It doesn't work the player can still spawn if he clicks Spawn!

thanks in advance guys.


Re: OnPlayerRequestSpawn Problem - C00K13M0N$73R - 19.09.2012

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if(IsLogged[playerid] == 0)
    {
        SendClientMessage(playerid, -1, "{FF5500}>{C3C3C3} You Can't Spawn Now");
    return 0;// We dont want him to spawn, we'll return 0
    }
    return 1;
}



Re: OnPlayerRequestSpawn Problem - XtremeR - 19.09.2012

use this
pawn Код:
TogglePlayerSpectating(playerid, 1);
it will remove your spawn button

rep++


Re: OnPlayerRequestSpawn Problem - Glint - 19.09.2012

Thanks both of you the code works perfectly now.