SA-MP Forums Archive
error 001: expected token: ",", but found "}" - 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 001: expected token: ",", but found "}" (/showthread.php?tid=504304)



error 001: expected token: ",", but found "}" - Slicebook - 03.04.2014

Код:
//>>>error           case 1: { for(new h = 0; h < sizeof(HouseInfo); h++) format(string, sizeof(string), "~w~Ice utca %d.~n~Tulaj:%s",h,HouseInfo[h][hOwner] }
			}
		    }
		}



Re: error 001: expected token: ",", but found "}" - [IND]Crazy - 03.04.2014

try this
pawn Код:
case 1: { for(new h = 0; h < sizeof(HouseInfo); h++) format(string, sizeof(string), "~w~Ice utca %d.~n~Tulaj:%s",h,HouseInfo[h][hOwner]);



Re: error 001: expected token: ",", but found "}" - Konstantinos - 03.04.2014

You don't close the function.

However, what your code does is really pointless. It loops through all the houses and it formats a message but string will only keep the text for the last house.


Re: error 001: expected token: ",", but found "}" - Slicebook - 03.04.2014

will not work properly?


Re: error 001: expected token: ",", but found "}" - Slicebook - 03.04.2014

0 error thanks, [IND]Crazy


Re: error 001: expected token: ",", but found "}" - Konstantinos - 03.04.2014

It will compile if you close the function but it will not do what you want.


Re: error 001: expected token: ",", but found "}" - Slicebook - 03.04.2014

I could do that good?, Can you help me?


Re: error 001: expected token: ",", but found "}" - Konstantinos - 03.04.2014

Sure I can, but you need to describe what you want to do.


Re: error 001: expected token: ",", but found "}" - Slicebook - 03.04.2014

Код:
	for(new h = 0; h < sizeof(HouseInfo); h++)
			{
				if(HouseInfo[h][Van] != 1) continue;

				if(PlayerToPoint(3.0, i, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]))
				{
					if(HouseInfo[h][hOwned] == 1)
					{
						if(HouseInfo[h][hRentabil] == 0)
					//		format(string, sizeof(string), "~w~Ice utca %d.~n~Tulaj:%s",h,HouseInfo[h][hOwner]);
							ShowPlayerDialog(i, DIALOG_HOUSEM, DIALOG_STYLE_LIST, "Hбz","Belйp\nInformбciу", "OK", "Mйgsem");
Код:
else if( dialogid == DIALOG_HOUSEM )
{
    if(!response) return 1;
    if(response)
    {
        switch(listitem)
        {
            case 0:
                {
					BementIdo[playerid] = 3;
					new hazak = sizeof(HouseInfo);
				//	new PlayerVW = GetPlayerVirtualWorld(playerid), PlayerInt = GetPlayerInterior(playerid);
					if(IsAt(playerid,IsAt_HazElott) != NINCS)
					{
                        for(new i = 0; i < hazak; i++)
                        {
                            if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
                            {
                                if(HouseInfo[i][hLock] == 0)
                                {
                                    new HazBelso = HouseInfo[i][hBelso];
                                    SetPlayerInterior(playerid,IntInfo[HazBelso][iNumber]);
                                    SetPlayerPos(playerid,IntInfo[HazBelso][iExitX],IntInfo[HazBelso][iExitY],IntInfo[HazBelso][iExitZ]);
                                    SetPlayerVirtualWorld(playerid, i);
                                    GameTextForPlayer(playerid, "~w~Ьdv itt!", 5000, 1);
                                    PlayerInfo[playerid][pLocal] = i;
                                    Hazbanvan[playerid] = 1;
                                    new zseka = Fbios[playerid];
                                    SendFormatMessage(zseka, Pink, "PDA Ьzenet: %s bement a %d szбmъ hбzba.", PlayerName(playerid), i)
                                    SetPlayerMarkerForPlayer(zseka, playerid, COLOR_INVISIBLE);
                                   // return 1;
								}
								else
								{
									GameTextForPlayer(playerid, "~r~Zarva", 5000, 1);
									return 1;	
                                }
                            }
                        }
                    }
                }
            case 1: { for(new h = 0; h < sizeof(HouseInfo); h++) format(string, sizeof(string), "~w~Ice utca %d.~n~Tulaj:%s",h,HouseInfo[h][hOwner]); }
				}
			}
		}



Re: error 001: expected token: ",", but found "}" - Konstantinos - 03.04.2014

You didn't explain what you want to do though so I can only guess. Do you want to use the code of the first one into your switch? Even though the format line is commented and the if statement about hRentabil doesn't use brackets so it takes only one function inside its block.