Checking if someone is loged in before they spawn
#1

Im working on an admin system and I need to make it so if a player trys to spawn it checks if they're registered, if they are it needs to also check if they're logged in, if they're not logged in then it wont let them spawn..

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if (PInfo[playerid][Regged] == 1) return SendClientMessage(playerid,RED,"SERVER: You must login before you spawn!"
    return 1;
}
This is what i have so far, it checks if they're registered and if they are it sends them the message, but im unsure how to make it so if they arent registered it just lets them spawn and if they are and arent loged in it wont allow them.. I havent scripted in over a year so all this stuff is hard to remember.
Reply
#2

I've tried this.. and it still allows me to spawn when not logged in.
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if (PInfo[playerid][Regged] == 1 && PInfo[playerid][Logged] == 0) return SendClientMessage(playerid,RED,"SERVER: You must login before you spawn!");
    else
    return 1;
}
Reply
#3

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if(PInfo[playerid][Regged] == 1 && PInfo[playerid][Logged] == 0)
        return SendClientMessage(playerid,-1,"SERVER: You must login before you spawn!") & 0;
    return 1;
}
Reply
#4

Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)