Problem, please help - 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)
+--- Thread: Problem, please help (
/showthread.php?tid=632732)
Problem, please help -
Kraeror - 18.04.2017
Hello, I have problem with checking the players in the gang war! I made command and all works, but when I'm checking the players and if the players from the defender team are less then 2, it send me message! But now, when I write /GangWar, allways and anywhere I am and in the server are 2 players from the defender team, it send me the message! Please help me, here is the code:
Command:
Quote:
if(strcmp(cmd, "/GangWar", true) == 0)
{
for (new i = 0; i < MAX_TERRITORIES; i++)
{
if(GetTeamMembers(TerritoryInfo[i][TerritoryOwner]) < 2) return SendClientMessage(playerid, COLOR_RED, "No one is from the defender team!");
}
for (new i = 0; i < MAX_TERRITORIES; i++)
{
//Here is my code....
}
return 1;
}
|
stock:
Quote:
stock GetTeamMembers(teamid)
{
new tmemb = 0;
for(new t; t < MAX_PLAYERS; t++)
{
if(IsPlayerConnected(t) && PlayerInfo[t][pMember] == teamid)
{
tmemb++;
}
}
return tmemb;
}
|
Re: Problem, please help -
Marricio - 19.04.2017
You need to check if the player is in the territory first. That is the problem, do you store the minX, minY, maxX, maxY of each territory?
Re: Problem, please help -
Kraeror - 19.04.2017
Quote:
Originally Posted by Marricio
You need to check if the player is in the territory first. That is the problem, do you store the minX, minY, maxX, maxY of each territory?
|
Thanks you a lot!!!!!!!!!!! You helped me a lot i will REP+ you !!!