[SOLVED]where did i miss bracket? - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [SOLVED]where did i miss bracket? (
/showthread.php?tid=116787)
[SOLVED]where did i miss bracket? -
WardenCS - 30.12.2009
Hey,i wanted to make dialog and i miss bracket somewhere,im not good with the brackets so i hope someone can help me with it
it gives 26 errors
heres the code:
pawn Код:
if(dialogid == 1337)
{
if(listitem == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerToPoint(3.0,playerid,1490.3195,1305.6976,1093.2964))
{
if(PlayerInfo[playerid][pFlyLic] == 0)
{
if(GetPlayerMoney(playerid) < 10500)
{
SendClientMessage(playerid, COLOR_GREY, "You don't have enough money for a flying license");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You bought a flying license for $10, 500");
SafeGivePlayerMoney(playerid, - 10500);
PlayerInfo[playerid][pFlyLic] = 1;
OnPlayerUpdate(playerid);
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, " You already own a flying license");
return 1;
}
}
}
return 1;
}
if(listitem == 1)
{
if(IsPlayerConnected(playerid))
{
if(PlayerToPoint(3.0,playerid,1490.3195,1305.6976,1093.2964))
{
if(PlayerInfo[playerid][pCarLic] == 0)
{
if(GetPlayerMoney(playerid) < 3500)
{
SendClientMessage(playerid, COLOR_GREY, "You don't have enough money for a driving license");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You bought a driving License for $3, 500");
SafeGivePlayerMoney(playerid, - 3500);
PlayerInfo[playerid][pCarLic] = 1;
OnPlayerUpdate(playerid);
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, " You already own a driving license");
return 1;
}
}
}
return 1;
}
if(listitem == 2)
{
if(IsPlayerConnected(playerid))
{
if(PlayerToPoint(3.0,playerid,1490.3195,1305.6976,1093.2964))
{
if(PlayerInfo[playerid][pBoatLic] == 0)
{
if(GetPlayerMoney(playerid) < 5500)
{
SendClientMessage(playerid, COLOR_GREY, "You don't have enough money for a sailing license");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You bought a boat license for $5, 500");
SafeGivePlayerMoney(playerid, - 5500);
PlayerInfo[playerid][pBoatLic] = 1;
OnPlayerUpdate(playerid);
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, " You already own a boat license");
return 1;
}
}
}
Re: where did i miss bracket? -
Correlli - 30.12.2009
It's hard to read from this code, it would be better if you indent it first.
Re: where did i miss bracket? -
MerLow - 30.12.2009
Line 31
pawn Код:
if(dialogid == 1337)
{
if(listitem == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerToPoint(3.0,playerid,1490.3195,1305.6976,1093.2964))
{
if(PlayerInfo[playerid][pFlyLic] == 0)
{
if(GetPlayerMoney(playerid) < 10500)
{
SendClientMessage(playerid, COLOR_GREY, "You don't have enough money for a flying license");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You bought a flying license for $10, 500");
SafeGivePlayerMoney(playerid, - 10500);
PlayerInfo[playerid][pFlyLic] = 1;
OnPlayerUpdate(playerid);
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, " You already own a flying license");
return 1;
}
}
}
}
return 1;
}
if(listitem == 1)
{
if(IsPlayerConnected(playerid))
{
if(PlayerToPoint(3.0,playerid,1490.3195,1305.6976,1093.2964))
{
if(PlayerInfo[playerid][pCarLic] == 0)
{
if(GetPlayerMoney(playerid) < 3500)
{
SendClientMessage(playerid, COLOR_GREY, "You don't have enough money for a driving license");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You bought a driving License for $3, 500");
SafeGivePlayerMoney(playerid, - 3500);
PlayerInfo[playerid][pCarLic] = 1;
OnPlayerUpdate(playerid);
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, " You already own a driving license");
return 1;
}
}
}
return 1;
}
if(listitem == 2)
{
if(IsPlayerConnected(playerid))
{
if(PlayerToPoint(3.0,playerid,1490.3195,1305.6976,1093.2964))
{
if(PlayerInfo[playerid][pBoatLic] == 0)
{
if(GetPlayerMoney(playerid) < 5500)
{
SendClientMessage(playerid, COLOR_GREY, "You don't have enough money for a sailing license");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You bought a boat license for $5, 500");
SafeGivePlayerMoney(playerid, - 5500);
PlayerInfo[playerid][pBoatLic] = 1;
OnPlayerUpdate(playerid);
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, " You already own a boat license");
return 1;
}
}
}