SA-MP Forums Archive
Uneccesary bracket or dosent end - 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: Uneccesary bracket or dosent end (/showthread.php?tid=545648)



Uneccesary bracket or dosent end - eclipses - 09.11.2014

Hey ive got a small problem that i cant figgure out. In this system the last bracket seems to not end the whole code section. Any sollutions? The bracket that dosent match or is uneseccary is marked red, sorry my bad english for now, have sleept bad. Cheers

Код:
	for(new i = 0; i < MAX_GARAGES; i++)
		{
	  		if(!strcmp(name, GarageInfo[i][gOwner], false))
	   		{
	   		    if(gcheck != INVALID_GARAGE_ID)
	   		    {
	   		        gcheck = i;
				}
    		}
		}
		if(gcheck != INVALID_GARAGE_ID)
	   	{
     		PlayerInfo[playerid][pPgaragekey] = gcheck;
		}
		for(new i = 0; i < MAX_BUSINESSES; i++)
		{
	  		if(!strcmp(name, BizzInfo[i][bOwner], false))
	   		{
	   		    if(bcheck != INVALID_BIZZ_ID)
	   		    {
	   		        bcheck = i;
				}
    		}
		}
		if(gcheck != INVALID_GARAGE_ID)
	   	{
     		PlayerInfo[playerid][pPgaragekey] = gcheck;
	   }
 	}
	return 1;
}



Re: Uneccesary bracket or dosent end - dazman14 - 09.11.2014

Код:
for(new i = 0; i < MAX_GARAGES; i++)
{
	if(!strcmp(name, GarageInfo[i][gOwner], false))
	{
	if(gcheck != INVALID_GARAGE_ID)
	{
		gcheck = i;
	}
	if(gcheck != INVALID_GARAGE_ID)
	{
		PlayerInfo[playerid][pPgaragekey] = gcheck;
	}
		for(new i = 0; i < MAX_BUSINESSES; i++)
		{
	  	if(!strcmp(name, BizzInfo[i][bOwner], false))
	   	{
			if(bcheck != INVALID_BIZZ_ID)
	   		{
				bcheck = i;
			}
    		}
		}
		if(gcheck != INVALID_GARAGE_ID)
	   	{
     		PlayerInfo[playerid][pPgaragekey] = gcheck;
		}
 	}
	return 1;
}
obviously you'll have to tab the code to fit yours but the above should sort out your problem.


Re: Uneccesary bracket or dosent end - eclipses - 09.11.2014

That made it work perfect, now its one more if your able to assist.

Код:
public OnPlayerLogin(playerid,password[])
{
    new string[128];
	new tmp2[256];
	new string2[128];
	new playername2[MAX_PLAYER_NAME];
	GetPlayerName(playerid, playername2, sizeof(playername2));
	format(string2, sizeof(string2), "users/%s.ini", playername2);
	new File: UserFile = fopen(string2, io_read);
	if ( UserFile )
	{



Re: Uneccesary bracket or dosent end - dazman14 - 09.11.2014

Please show me your public OnPlayerLogin


Also explain what issue your facing? Like does it not compile. If so show me the error in compiler.


Re: Uneccesary bracket or dosent end - eclipses - 09.11.2014

Fixed it, thanks for your assistance anyhow +1 brother