SA-MP Forums Archive
error 054: unmatched closing brace ("}") - 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: error 054: unmatched closing brace ("}") (/showthread.php?tid=628148)



error 054: unmatched closing brace ("}") - Smocky - 06.02.2017

Hello, I have a little problem that I have a hard set could you give me a helping hands? Thank you
Код:
	}
	if(!strcmp(option, "money", true, 5))
	{
		if(sscanf(params, "s[32]i", option, amount)) return SendClientMessage(playerid, COLOR_WHITE, "[Utilisation]: /coffremaison deposer argent [montant]");
		if(PlayerInfo[playerid][pMoney] < amount) return SendClientMessage(playerid, COLOR_GREY, "Vous ne disposez pas autant d'argent sur vous.");
		HouseInfo[idx][hMoney] += amount;
		SafeGivePlayerMoney(playerid, -amount);
		format(string, sizeof(string), "* %s ouvre son coffre et depose $%d et ferme par la suite.", RPN(playerid), amount);
		SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
	}



Re: error 054: unmatched closing brace ("}") - AndreiWow - 06.02.2017

I don't understand the issue?


Re: error 054: unmatched closing brace ("}") - Smocky - 06.02.2017

When I compile my gamemode, brand me this error here

Quote:

C:\Users\Smocky\Desktop\GM\gamemodes\gm.pwn(11800) : error 001: expected token: ";", but found ")"
C:\Users\Smocky\Desktop\GM\gamemodes\gm.pwn(11803) : error 054: unmatched closing brace ("}")

Here is the code

Quote:

SafeGivePlayerMoney(playerid, -amount);
format(string, sizeof(string), "* %s ouvre son coffre et depose $%d et ferme par la suite.", RPN(playerid), amount);
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
}
Here is the entire script

Quote:

}
if(!strcmp(option, "money", true, 5))
{
if(sscanf(params, "s[32]i", option, amount)) return SendClientMessage(playerid, COLOR_WHITE, "[Utilisation]: /coffremaison deposer argent [montant]");
if(PlayerInfo[playerid][pMoney] < amount) return SendClientMessage(playerid, COLOR_GREY, "Vous ne disposez pas autant d'argent sur vous.");
HouseInfo[idx][hMoney] += amount;
SafeGivePlayerMoney(playerid, -amount);
format(string, sizeof(string), "* %s ouvre son coffre et depose $%d et ferme par la suite.", RPN(playerid), amount);
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
}




Re: error 054: unmatched closing brace ("}") - Smocky - 06.02.2017

Set small problem for me, Thanks bro


Re: error 054: unmatched closing brace ("}") - AndreiWow - 06.02.2017

Remove the bracket that is above the code maybe?

} < REMOVE THIS
if(!strcmp(option, "money", true, 5))
{
if(sscanf(params, "s[32]i", option, amount)) return SendClientMessage(playerid, COLOR_WHITE, "[Utilisation]: /coffremaison deposer argent [montant]");
if(PlayerInfo[playerid][pMoney] < amount) return SendClientMessage(playerid, COLOR_GREY, "Vous ne disposez pas autant d'argent sur vous.");
HouseInfo[idx][hMoney] += amount;
SafeGivePlayerMoney(playerid, -amount);
format(string, sizeof(string), "* %s ouvre son coffre et depose $%d et ferme par la suite.", RPN(playerid), amount);
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
}