OnPlayerRequestSpawn Problem
#1

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

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

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

rep++
Reply
#4

Thanks both of you the code works perfectly now.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)