PDA

View Full Version : Missing a bracket.


Jimmi
29/07/2015, 03:22 AM
please help:
if(strcmp(cmd, "/rivalwar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5 || PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6)
{
if(PlayerInfo[playerid][pRank] >= 5)
{
if(IsPlayerInArea(playerid,TurfInfo[1][MinX],TurfInfo[1][MinY],TurfInfo[1][MaxX],TurfInfo[1][MaxY]))
{
if(TurfInfo[1][CodTime] <= 0)
{
if(TurfInWar[1] == 0)
{
new cYakuza;
new cLaCosaNostra;
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pMember] == 6 || PlayerInfo[i][pLeader] == 6)
{
cYakuza++;
}
if(PlayerInfo[i][pMember] == 5 || PlayerInfo[i][pLeader] == 5)
{
cLaCosaNostra++;
}
}
}
if(cYakuza >= 2 && cLaCosaNostra >= 2)
{
if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5)
{
if(TurfInfo[1][Owner] == 6)
{
StartLYWar(5, 6, 1);
ContorizationTimerLY = SetTimer("ContorizationLY", 3500, true);
new Text:TDatack = TextDrawCreate(200.0, 385.0, "~w~We have provoked a turfwar ~w~in ~y~Rival-Wars Turf ~w~against the ~r~Yakuza");
TextDrawFont(TDatack, 0);
TextDrawSetShadow(TDatack, 0);
TextDrawSetOutline(TDatack, 1);
TextDrawColor(TDatack, 0xDFDFDFFF);
TimeTextForPlayer(playerid, TDatack, 10000);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You are not in a rival hood");
}
}
if(PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6)
{
if(TurfInfo[1][Owner] == 5)
{
StartLYWar(6, 5, 1);
ContorizationTimerLY = SetTimer("ContorizationLY", 3500, true);
new Text:TDatack = TextDrawCreate(200.0, 385.0, "~w~We have provoked a turfwar ~w~in ~y~Rival-Wars Turf ~w~against the ~r~La Cosa Nostra");
TextDrawFont(TDatack, 0);
TextDrawSetShadow(TDatack, 0);
TextDrawSetOutline(TDatack, 1);
TextDrawColor(TDatack, 0xDFDFDFFF);
TimeTextForPlayer(playerid, TDatack, 10000);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You are not in a rival hood");
}
}
}
if(!(cYakuza >= 2 && cLaCosaNostra >= 2))
{
SendClientMessage(playerid,COLOR_WHITE, "There must be at least 2 members in each factions");
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Can't start 2 rival wars at the sime time");
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You must wait 3 hours between Rival-Wars");
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You ar not in a rival hood");
}
}
else
{
SendClientMessage(playerid,COLOR_WHITE, "You need at least Rank 5 for this action");
}
}
else if(PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12 || PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13)
{
if(PlayerInfo[playerid][pRank] >= 5)
{
if(IsPlayerInArea(playerid,TurfInfo[2][MinX],TurfInfo[2][MinY],TurfInfo[2][MaxX],TurfInfo[2][MaxY]))
{
if(TurfInfo[2][CodTime] <= 0)
{
if(TurfInWar[2] == 0)
{
new cCrips;
new cBloods;
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pMember] == 12 || PlayerInfo[i][pLeader] == 12)
{
cCrips++;
}
if(PlayerInfo[i][pMember] == 13 || PlayerInfo[i][pLeader] == 13)
{
cBloods++;
}
}
}
if(cCrips >= 2 && cBloods >= 2)
{
if(PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12)
{
if(TurfInfo[2][Owner] == 13)
{
StartCBWar(12, 13, 2);
ContorizationTimerCB = SetTimer("ContorizationCB", 3500, true);
new Text:TDatack = TextDrawCreate(200.0, 385.0, "~w~We have provoked a turfwar ~w~in ~y~ Rival-Wars Turf Turf. ~w~against the ~r~Crips Gang");
TextDrawFont(TDatack, 0);
TextDrawSetShadow(TDatack, 0);
TextDrawSetOutline(TDatack, 1);
TextDrawColor(TDatack, 0xDFDFDFFF);
TimeTextForPlayer(playerid, TDatack, 10000);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You are not in a rival hood");
}
}
if(PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13)
{
if(TurfInfo[2][Owner] == 12)
{
StartCBWar(13, 12, 2);
ContorizationTimerCB = SetTimer("ContorizationCB", 3500, true);
new Text:TDatack = TextDrawCreate(200.0, 385.0, "~w~We have provoked a turfwar ~w~in ~y~ Rival-Wars Turf Turf. ~w~against the ~r~Bloods Gang");
TextDrawFont(TDatack, 0);
TextDrawSetShadow(TDatack, 0);
TextDrawSetOutline(TDatack, 1);
TextDrawColor(TDatack, 0xDFDFDFFF);
TimeTextForPlayer(playerid, TDatack, 10000);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You are not in a rival hood");
}
}
}
if(!(cCrips >= 2 && cBloods >= 2))
{
SendClientMessage(playerid,COLOR_WHITE, "There must be at least 2 members in each factions");
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Can't start 2 rival wars at the sime time");
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You must wait 3 hours between Rival-Wars");
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You ar not in a rival hood");
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You need at least Rank 5 for this action");
}
}

http://imgur.com/4FjUaxx

Abagail
29/07/2015, 03:32 AM
Try to use this bracket finder, it should give the id of the row's with the missing brackets:
http://forum.sa-mp.com/showthread.php?t=291018

Jimmi
29/07/2015, 03:35 AM
I do not understand ... I can do it you ask?

n0minal
29/07/2015, 04:07 AM
I do not understand ... I can do it you ask?

English: You can use bracketfinder tool for search the missing bracket...

----------------------------------------------------------------------------------------------------------------------------------
#He seems to don't know so much about english so I'll tell him in portuguese
----------------------------------------------------------------------------------------------------------------------------------
Portuguese: Você pode usar a ferramenta de procura de brackets pra ver qual bracket falta, crie o tópico na nossa board, é mais fácil de te ajudar caso você não entenda muito de inglês.

http://forum.sa-mp.com/forumdisplay.php?f=34

Jimmi
29/07/2015, 04:53 PM
upppp

Mencent
29/07/2015, 10:48 PM
Hello! ;)

Here:
new Text:TDatack;//global

if(!strcmp(cmd,"/rivalwar",true))
{
if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5 || PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6)
{
if(PlayerInfo[playerid][pRank] < 5)return SendClientMessage(playerid,COLOR_WHITE, "You need at least Rank 5 for this action");
if(!IsPlayerInArea(playerid,TurfInfo[1][MinX],TurfInfo[1][MinY],TurfInfo[1][MaxX],TurfInfo[i][MaxY]))return SendClientMessage(playerid, COLOR_WHITE, "You ar not in a rival hood");
if(TurfInfo[1][CodTime] > 0)return SendClientMessage(playerid, COLOR_WHITE, "You must wait 3 hours between Rival-Wars");
if(TurfInWar[1] != 0)return SendClientMessage(playerid, COLOR_WHITE, "Can't start 2 rival wars at the sime time");
new cYakuza,cLaCosaNostra;
for(new i;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i) || IsPlayerNPC(i))continue;
if(PlayerInfo[i][pMember] == 5 || PlayerInfo[i][pLeader] == 5)cLaCosaNostra ++;
else if(PlayerInfo[i][pMember] == 6 || PlayerInfo[i][pLeader] == 6)cYakuza ++;
}
if(cYakuza < 2 || cLaCosaNostra < 2)return SendClientMessage(playerid,COLOR_WHITE, "There must be at least 2 members in each factions");
if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pMember] == 5)
{
if(TurfInfo[1][Owner] != 6)return SendClientMessage(playerid, COLOR_WHITE, "You are not in a rival hood");
StartLYWar(5,6,1);
ContorizationTimerLY = SetTimer("ContorizationLY",3500,true);
TDatack = TextDrawCreate(200.0, 385.0, "~w~We have provoked a turfwar ~w~in ~y~Rival-Wars Turf ~w~against the ~r~Yakuza");
TextDrawFont(TDatack, 0);
TextDrawSetShadow(TDatack, 0);
TextDrawSetOutline(TDatack, 1);
TextDrawColor(TDatack, 0xDFDFDFFF);
TimeTextForPlayer(playerid, TDatack, 10000);
}
else if(PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pMember] == 6)
{
if(TurfInfo[1][Owner] != 5)return SendClientMessage(playerid, COLOR_WHITE, "You are not in a rival hood");
StartLYWar(6, 5, 1);
ContorizationTimerLY = SetTimer("ContorizationLY", 3500, true);
TDatack = TextDrawCreate(200.0, 385.0, "~w~We have provoked a turfwar ~w~in ~y~Rival-Wars Turf ~w~against the ~r~La Cosa Nostra");
TextDrawFont(TDatack, 0);
TextDrawSetShadow(TDatack, 0);
TextDrawSetOutline(TDatack, 1);
TextDrawColor(TDatack, 0xDFDFDFFF);
TimeTextForPlayer(playerid, TDatack, 10000);
}
return 1;
}
else if(PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12 || PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13)
{
if(PlayerInfo[playerid][pRank] < 5)return SendClientMessage(playerid, COLOR_WHITE, "You need at least Rank 5 for this action");
if(!IsPlayerInArea(playerid,TurfInfo[2][MinX],TurfInfo[2][MinY],TurfInfo[2][MaxX],TurfInfo[2][MaxY]))return SendClientMessage(playerid, COLOR_WHITE, "You ar not in a rival hood");
if(TurfInfo[2][CodTime] > 0)return SendClientMessage(playerid, COLOR_WHITE, "You must wait 3 hours between Rival-Wars");
if(TurfInWar[2] != 0)return SendClientMessage(playerid, COLOR_WHITE, "Can't start 2 rival wars at the sime time");
new cCrips,cBloods;
for(new i;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i) || IsPlayerNPC(i))continue;
if(PlayerInfo[i][pMember] == 12 || PlayerInfo[i][pLeader] == 12)cCrips ++;
else if(PlayerInfo[i][pMember] == 13 || PlayerInfo[i][pLeader] == 13)cBloods ++;
}
if(cCrips < 2 || cBloods < 2)return SendClientMessage(playerid,COLOR_WHITE, "There must be at least 2 members in each factions");
if(PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12)
{
if(TurfInfo[2][Owner] != 13)return SendClientMessage(playerid, COLOR_WHITE, "You are not in a rival hood");
StartCBWar(12, 13, 2);
ContorizationTimerCB = SetTimer("ContorizationCB", 3500, true);
TDatack = TextDrawCreate(200.0, 385.0, "~w~We have provoked a turfwar ~w~in ~y~ Rival-Wars Turf Turf. ~w~against the ~r~Crips Gang");
TextDrawFont(TDatack, 0);
TextDrawSetShadow(TDatack, 0);
TextDrawSetOutline(TDatack, 1);
TextDrawColor(TDatack, 0xDFDFDFFF);
TimeTextForPlayer(playerid, TDatack, 10000);
}
else if(PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13)
{
if(TurfInfo[2][Owner] != 12)return SendClientMessage(playerid, COLOR_WHITE, "You are not in a rival hood");
StartCBWar(13, 12, 2);
ContorizationTimerCB = SetTimer("ContorizationCB", 3500, true);
TDatack = TextDrawCreate(200.0, 385.0, "~w~We have provoked a turfwar ~w~in ~y~ Rival-Wars Turf Turf. ~w~against the ~r~Bloods Gang");
TextDrawFont(TDatack, 0);
TextDrawSetShadow(TDatack, 0);
TextDrawSetOutline(TDatack, 1);
TextDrawColor(TDatack, 0xDFDFDFFF);
TimeTextForPlayer(playerid, TDatack, 10000);
}
return 1;
}
return 1;
}