SA-MP Forums Archive
Registered account - 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: Registered account (/showthread.php?tid=200515)



Registered account - Face9000 - 18.12.2010

Hi all,i've a serious issue.

In my gm,everyone can play with the choosen name,i need to "If you arent logged,you cant spawn".

This is the variable i use for check login:

Код:
 if(IsLogged[playerid] == 1)
		{
// Logged In

Код:
 if(IsLogged[playerid] == 0)
		{
// Logged Out


Re: Registered account - Karlip - 18.12.2010

Is the Logged Out under OnPlayerRequestSpawn?


Re: Registered account - blackwave - 18.12.2010

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(IsLogged[playerid] == 0)
   {
      SendClientMessage(playerid, 0xB7FFFF, "You can't spawn yet");
      SetPlayerHealth(playerid, 0.0);
      ForceClassSelection(playerid);
   }
    return 1;
}
pawn Код:
public OnPlayerDisconnect(playerid,reason);
{
   IsLogged[playerid]=0;
   return 1;
}



Re: Registered account - admantis - 18.12.2010

Quote:
Originally Posted by blackwave
Посмотреть сообщение
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(IsLogged[playerid] == 0)
   {
      SendClientMessage(playerid, 0xB7FFFF, "You can't spawn yet");
      SetPlayerHealth(playerid, 0.0);
      ForceClassSelection(playerid);
   }
    return 1;
}
pawn Код:
public OnPlayerDisconnect(playerid,reason);
{
   IsLogged[playerid]=0;
   return 1;
}
its more easy with this

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if (LoggedIn[playerid] == 0) return SendClientMessage(playerid,COLOR_RED,"ERROR: You must log in before playing !");
    return 1;
}
Only 2 lines and no players harmed.


Re: Registered account - Face9000 - 18.12.2010

Thanks guys for the fast reply.Always the best!


Re: Registered account - Mean - 18.12.2010

Quote:
Originally Posted by admantis
Посмотреть сообщение
its more easy with this

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if (LoggedIn[playerid] == 0) return SendClientMessage(playerid,COLOR_RED,"ERROR: You must log in before playing !");
    return 1;
}
Only 2 lines and no players harmed.
It's return 0; there. So it prevents hom for spawning.