SA-MP Forums Archive
logged in - 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: logged in (/showthread.php?tid=199250)



logged in - Face9000 - 14.12.2010

Hi all,i've a problem with my account system.I need to make,if player isnt logged,he cant spawn.

So,in OnPlayerSpawn i've added this:

Код:
   IsLogged[playerid] = 0;
		{
			SendClientMessage(playerid, 0x33AA33AA, "[BotServ] You can't spawn if you arent logged in/registered.");
			SendClientMessage(playerid, 0xFF9900AA, "[BotServ] Use /login if you are registered and try to spawn again.");
			SendClientMessage(playerid, 0xFFFF00AA, "[BotServ] Or use /register to create a new account and try to spawn again.");
		}
But i still can spawn,even if im logged out..


Re: logged in - Steven82 - 14.12.2010

pawn Код:
public OnPlayerSpawn(playerid)
{
 if(IsLogged[playerid] == 0)
 {
 SendClientMessage(playerid, 0x33AA33AA, "[BotServ] You can't spawn if you arent logged in/registered.");
 SendClientMessage(playerid, 0xFF9900AA, "[BotServ] Use /login if you are registered and try to spawn again.");
 SendClientMessage(playerid, 0xFFFF00AA, "[BotServ] Or use /register to create a new account and try to   spawn again.");
return 0;
}
 return 1;
}



Re: logged in - Face9000 - 14.12.2010

Already tried,i get this:

Код:
C:\Documents and Settings\k\Desktop\SFWAR.pwn(456) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Edit,missed ;.

Thanks.


Re: logged in - Steven82 - 14.12.2010

Whats on line 456? "Ctrl + G"


Re: logged in - Face9000 - 14.12.2010

Ok it's compiled but i still can spawn....


Re: logged in - Steven82 - 14.12.2010

Show me the updated code snippet.


Re: logged in - Face9000 - 14.12.2010

That's all:

Код:
public OnPlayerSpawn(playerid)
{
  if(gTeam[playerid] == TEAM_SWAT)
  {
    SetPlayerColor(playerid, COLOR_GREEN);
  }
  if(gTeam[playerid] == TEAM_CHICKENS)
  {
    SetPlayerColor(playerid, COLOR_YELLOW);
  }
  if(gTeam[playerid] == TEAM_KAMIKAZERS)
  {
    SetPlayerColor(playerid, COLOR_RED);
  }
  if(gTeam[playerid] == TEAM_IMMIGRANTS)
  {
    SetPlayerColor(playerid, COLOR_CORAL);
  }
  if(gTeam[playerid] == TEAM_MEDICS)
  {
    SetPlayerColor(playerid, COLOR_ORANGE);
  }
  if(gTeam[playerid] == TEAM_FARMERS)
  {
    SetPlayerColor(playerid, COLOR_PINK);
  }
  if(gTeam[playerid] == TEAM_RICHS)
  {
    SetPlayerColor(playerid, COLOR_LIGHTBLUE);
  }
  if(gTeam[playerid] == TEAM_PILOTS)
  {
    SetPlayerColor(playerid, COLOR_GREY);
  }
if(IsLogged[playerid] == 0)
 {
 SendClientMessage(playerid, 0x33AA33AA, "[BotServ] You can't spawn if you arent logged in/registered.");
 SendClientMessage(playerid, 0xFF9900AA, "[BotServ] Use /login if you are registered and try to spawn again.");
 SendClientMessage(playerid, 0xFFFF00AA, "[BotServ] Or use /register to create a new account and try to   spawn again.");
return 0;
}
 return 1;
}



Re: logged in - Steven82 - 14.12.2010

You should try using "else if" same thing just add else before it then try it.


Re: logged in - blackwave - 14.12.2010

Did you define ?

pawn Код:
new IsLogged[MAX_PLAYERS];
And I think should the IsLogged the first condition of the OnPlayerSpawn, because if the player is one of these gTeam, he'll spawn, and will not spawn just if he's not from any.


Re: logged in - Steven82 - 14.12.2010

Quote:
Originally Posted by blackwave
Посмотреть сообщение
Did you define ?

And I think should the IsLogged the first condition of the OnPlayerSpawn, because if the player is one of these gTeam, he'll spawn, and will not spawn just if he's not from any.
Your right, i failed. Im sorry im just not with the today been kinda out of it, but that'll work.