Quote:
Originally Posted by -xy!
|
Quote:
Originally Posted by Sly™
Quote:
Originally Posted by Seif_
Change the returns message to this:
pawn Код:
return SendClientMessage(playerid, color_here, "This team is full!"), 0;
It will return 0 so you can't spawn.
|
Would be easier to understand using this:
pawn Код:
return !SendClientMessage(playerid, color_here, "This team is full!");
The SendClientMessage returns 1 if message was received by the client and 0 if not. So, if the player didn't receive the message, let him spawn to avoid problems
|
I tried both way, but I'm still getting an error;
Код:
warning 209: function "OnPlayerRequestSpawn" should return a value
My Code;
Код:
public OnPlayerRequestSpawn(playerid)
{
for(new p = 0; p < GetMaxPlayers(); p++)
{
if (GetPlayerTeam(p) == TEAM_ARMY)
{
ArmyCount++;
}
else if (GetPlayerTeam(p) == TEAM_TERROR)
{
TerrorCount++;
}
}
if ((ArmyCount > TerrorCount) && GetPlayerTeam(playerid) == TEAM_ARMY)
return !SendClientMessage(playerid, COLOR_RED, ">> This team is full!");
else if ((TerrorCount > ArmyCount) && GetPlayerTeam(playerid) == TEAM_TERROR)
return !SendClientMessage(playerid, COLOR_RED, ">> This team is full!");
}
Thanks! (: