Checking if someone is loged in before they spawn - 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: Checking if someone is loged in before they spawn (
/showthread.php?tid=368032)
Checking if someone is loged in before they spawn -
Damienr95 - 11.08.2012
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.
Re: Checking if someone is loged in before they spawn -
Damienr95 - 11.08.2012
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;
}
Re: Checking if someone is loged in before they spawn -
Jefff - 11.08.2012
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;
}
Re: Checking if someone is loged in before they spawn -
Damienr95 - 11.08.2012
Thanks!