Help, error - 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: Help, error (
/showthread.php?tid=562168)
Help, error -
LuisPark - 07.02.2015
I tried to make this code, but i noob at about " }, return, ; , v.v so i got a lot error. I hope someone can help me
I was check the function, it's okay, nothing happend but when i add this code, i get this
PHP код:
CMD:datbanhlenxe(playerid, params[])
{
if(PlayerInfo[playerid][pRFLTeam] != 0) {
SendClientMessageEx(playerid,COLOR_GREY," Ban chua nau banh pizza !");
}
else
{
new closestcar = GetClosestCar(playerid);
if(IsPlayerInRangeOfVehicle(playerid, closestcar, 10.0))
{
if(!IsABike(vehicleid)
{
SendClientMessageEx(playerid,COLOR_GREY," Ban khong gan mot chiec xe nao do !");
}
else return SendClientMessageEx(playerid, COLOR_WHITE, "Ban khong phai la Mechanic!" );
return 1 ;
}
Re: Help, error -
HazardouS - 07.02.2015
It's because your coding style is so bad, you can't see the matching brackets. This is what you wanted to achieve:
pawn Код:
CMD:datbanhlenxe(playerid, params[])
{
if(PlayerInfo[playerid][pRFLTeam] != 0)
{
SendClientMessageEx(playerid,COLOR_GREY," Ban chua nau banh pizza !");
}
else
{
new closestcar = GetClosestCar(playerid);
if(IsPlayerInRangeOfVehicle(playerid, closestcar, 10.0))
{
if(!IsABike(vehicleid)
{
SendClientMessageEx(playerid,COLOR_GREY," Ban khong gan mot chiec xe nao do !");
}
else
{
return SendClientMessageEx(playerid, COLOR_WHITE, "Ban khong phai la Mechanic!" );
}
}
}
return 1;
}
Re: Help, error -
Vince - 07.02.2015
Count the number of {. Then count the number of }. If they do not match, you screwed up. When typing braces, always type them in pairs (i.e. "{}") and you're guaranteed to almost never screw up.
Secondly:
indent your code! After each { you indent the following code by 1 tab until you encounter the next }.
Re: Help, error -
LuisPark - 07.02.2015
It still got error: Unfinided sympol " Vehicle id "
Re: Help, error -
HazardouS - 07.02.2015
pawn Код:
CMD:datbanhlenxe(playerid, params[])
{
if(PlayerInfo[playerid][pRFLTeam] != 0)
{
SendClientMessageEx(playerid,COLOR_GREY," Ban chua nau banh pizza !");
}
else
{
new closestcar = GetClosestCar(playerid);
if(IsPlayerInRangeOfVehicle(playerid, closestcar, 10.0))
{
if(!IsABike(closestcar))
{
SendClientMessageEx(playerid,COLOR_GREY," Ban khong gan mot chiec xe nao do !");
}
else
{
return SendClientMessageEx(playerid, COLOR_WHITE, "Ban khong phai la Mechanic!" );
}
}
}
return 1;
}
You also forgot to close one bracket after "IsABike(vehicleid)".
Re: Help, error -
LuisPark - 07.02.2015
Oh my god, thanks, rep