05.10.2010, 20:10
When you're having issues with brackets, I suggest switching over to Notepad++. He was missing one bracket, and had some poor indentation which may have caused him to overlook it.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 4512 && response == 1)
{
if(IsBuyableCar[vehicleid])
{
if(strmatch(VehicleSystem[IsBuyableCar[vehicleid]][Owner],PlayerName(playerid))) return SendClientMessage(playerid,COLOR_RED,"[ » ] You already own this vehicle !");
if(strmatch(VehicleSystem[IsBuyableCar[vehicleid]][Owner],"Unbought"))
{
if(VehicleSystem[IsBuyableCar[vehicleid]][Price] > GetPlayerMoney(playerid)) return SendClientMessage(playerid,COLOR_RED,"[ » ] Not enought Dollars !");
MaxVehicles[playerid]=0;
for(new i=0;i<MAX_VEHICLES;i++)
{
if(strmatch(VehicleSystem[i][Owner],PlayerName(playerid)))
{
MaxVehicles[playerid]=MaxVehicles[playerid]+1;
}
}
if(MaxVehicles[playerid]>=MAX_VEHICLES_PER_PLAYER) return SendClientMessage(playerid,COLOR_RED,"[ » ] You already own the limit of vehicles !");
strmid(VehicleSystem[IsBuyableCar[vehicleid]][Owner],PlayerName(playerid),0,20,20);
VehicleSystem[IsBuyableCar[vehicleid]][Locked]=0;
GivePlayerMoney(playerid,-VehicleSystem[IsBuyableCar[vehicleid]][Price]);
SendClientMessage(playerid,COLOR_GREEN,"[ » ] You have bought this vehicle !");
format(string,sizeof(string), "[ » ] You lost %d $ !",VehicleSystem[IsBuyableCar[vehicleid]][Price]);
SendClientMessage(playerid, COLOR_YELLOW, string);
SaveMYSQLCarID(vehicleid);
}
else
{
SendClientMessage(playerid,COLOR_RED,"[ » ] This vehicle is not for sale !");
}
else
{
RemovePlayerFromVehicle(playerid);
}
}
return 1;
}
}