[help] "Team is full." - 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: [help] "Team is full." (
/showthread.php?tid=84614)
[help] "Team is full." -
Marc_307 - 02.07.2009
Hello, does anybody know how to get an anti-spawn?
I mean if somebody wants to spawn, the team is full, he can't spawn by pressing SHIFT.
The player presses SHIFT, he can't spawn, a message appears ("Team is full.").
Do you understand?
Thanks for help.
Re: [help] "Team is full." -
HuRRiCaNe - 02.07.2009
post the script
Re: [help] "Team is full." -
Marc_307 - 02.07.2009
Here's a part of my script:
pawn Код:
#define TEAM_ALPHA 1
#define TEAM_GAMMA 2
new AlphaMembers;
new GammaMembers;
public OnPlayerSpawn(playerid)
{
switch(gClass[playerid])
{
case 0:
{
AlphaMembers++;
}
case 1:
{
GammaMembers++;
}
}
return 1;
}
Re: [help] "Team is full." -
Grim_ - 02.07.2009
You can try something like this, though don't know if it'll work.
pawn Код:
public OnPlayerSpawn(playerid)
{
switch(gClass[playerid])
{
case 0:
{
AlphaMembers++;
}
case 1:
{
GammaMembers++;
}
}
if(gClass[playerid] == 0) { if(AlphaMembers > GammaMembers) { SendClientMessage(playeird, color, "TeamFull!"); return 0; } }
else if(gClass[playerid] == 1) { if(GammaMembers > AlphaMembers) { SendClientMessage(playerid, color, "TeamFull!"); return 0; } }
return 1;
}
Re: [help] "Team is full." -
dice7 - 02.07.2009
Return 0; with an IF statement of something under public OnPlayerRequestSpawn(playerid)
Re: [help] "Team is full." -
Marc_307 - 02.07.2009
Ah, I understand. In my case it would be:
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
if(gClass[playerid] == 0)
{
if(AlphaMembers > GammaMembers)
{
SendClientMessage(playerid,COLOR, "Team is full!");
return 0;
}
}
else if(gClass[playerid] == 1)
{
if(GammaMembers > AlphaMembers)
{
SendClientMessage(playerid,COLOR, "Team is full.");
return 0;
}
}
return 1;
}
By the way, I found this at Wiki:
https://sampwiki.blast.hk/wiki/OnPlayerRequestSpawn
Thanks all for help!