Uneccesary bracket or dosent end
#1

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;
}
Reply
#2

Код:
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.
Reply
#3

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 )
	{
Reply
#4

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.
Reply
#5

Fixed it, thanks for your assistance anyhow +1 brother
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)