06.12.2009, 13:42
Whole on player req spawn
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
foreach (Player, i)
{
Itter_Random(Player, i)
TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, i);
PlayerInfo[playerid][pSQLId] = INVALID_SQL_ID;
FindPlayerSQL(playerid);
if(PlayerInfo[playerid][pSQLId] > INVALID_SQL_ID)
{
gPlayerAccount[playerid] = 1;
ShowLoginDialog(playerid);
}
else
{
gPlayerAccount[playerid] = 0;
ShowRegDialog(playerid);
}
}
}
if(Classid[playerid] == 0 || Classid[playerid] == 1 || Classid[playerid] == 2 || Classid[playerid] == 3 || Classid[playerid] == 4)
{
if(TeamGrove > TeamLSPD && GroveTeam[playerid] == 0)
{
SendClientMessage(playerid,COLOR_RED, "[SYSTEM] In order to balance the teams, You Must Choose The LSPD");
return 0;
}
return 1;
}
if(Classid[playerid] == 5 || Classid[playerid] == 6 || Classid[playerid] == 7 || Classid[playerid] == 8 || Classid[playerid] == 9 || Classid[playerid] == 10)
{
if(TeamLSPD > TeamGrove && LSPDTeam[playerid] == 0)
{
SendClientMessage(playerid,COLOR_RED, "[SYSTEM] In order to balance the teams, You Must Choose The Grove Street");
return 0;
}
return 1;
}
if(Classid[playerid] == 3)
{
if(PlayerInfo[playerid][pPremium] < 1)
{
SendClientMessage(playerid, COLOR_RED, " You are not a Silver Or Gold Member. you cannot select this class");
return 0;
}
if(PlayerInfo[playerid][pPremium] >= 1)
{
SpawnPlayer(playerid);
return 1;
}
return 1;
}
if(Classid[playerid] == 4)
{
if(PlayerInfo[playerid][pPremium] < 2)
{
SendClientMessage(playerid, COLOR_RED, " You are not a Gold Member. you cannot select this class");
return 0;
}
if(PlayerInfo[playerid][pPremium] >= 2)
{
SpawnPlayer(playerid);
return 1;
}
return 1;
}
if(Classid[playerid] == 9)
{
if(PlayerInfo[playerid][pPremium] < 1)
{
SendClientMessage(playerid, COLOR_RED, " You are not a Silver or Gold Premium member. you cannot select this class");
return 0;
}
if(PlayerInfo[playerid][pPremium] >= 1)
{
SpawnPlayer(playerid);
return 1;
}
return 1;
}
if(Classid[playerid] == 10)
{
if(PlayerInfo[playerid][pPremium] < 2)
{
SendClientMessage(playerid, COLOR_RED, " You are not a Gold Premium member. you cannot select this class");
return 0;
}
if(PlayerInfo[playerid][pPremium] >= 2)
{
SpawnPlayer(playerid);
return 1;
}
return 1;
}
return 1;
}