[HELP PLEASE] error 001: expected token: ")", but found "{"
#1

return 1;
}

IRPeatbelt(playerid, var[])
{
if(!Logged(playerid)) NoLogin(playerid);
if(!IsPlayerInAnyVehicle(playerid)
{
SendClientMessage(playerid, COLOR_GREY, "You are not in a vehicle!");
return 1;
}
new string[50 + MAX_PLAYER_NAME];
if(IsPlayerInAnyVehicle(playerid) && Seatbelt[playerid] == 0)
{
Seatbelt[playerid] = 1;
if(IsABike(GetPlayerVehicleID(playerid)))
{
format(string, sizeof(string), "* %s reaches for their helmet, and puts it on.", GetName(playerid));
SetPlayerAttachedObject(playerid, 1, 18645, 2, 0.059999, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000);
SendClientMessage(playerid, COLOR_WHITE, "You have put on your helmet.");
}
else
{
format(string, sizeof(string), "* %s reaches for their seatbelt, and buckles it up.", GetName(playerid));
SetPlayerAttachedObject( playerid, 2, 18634, 7,0.000000, 0.100000, 0.350000, -35.224993, 45.215000, 1.500000, 5.000000,1.500000, 1.500000,0xAFAFAFAA );
SendClientMessage(playerid, COLOR_WHITE, "You have put on your seatbelt.");
}

}
else if(IsPlayerInAnyVehicle(playerid) && Seatbelt[playerid] == 1)
{
Seatbelt[playerid] = 0;
if(IsABike(GetPlayerVehicleID(playerid)))
{
format(string, sizeof(string), "* %s reaches for their helmet, and takes it off.", GetName(playerid));
RemovePlayerAttachedObject(playerid, 1);
SendClientMessage(playerid, COLOR_WHITE, "You have taken off your helmet.");
}
else
{
format(string, sizeof(string), "* %s reaches for their seatbelt, and unbuckles it.", GetName(playerid));
for(new i;i<5;i++) RemovePlayerAttachedObject(playerid,i);
SendClientMessage(playerid, COLOR_WHITE, "You have taken off your seatbelt.");
}
}
SendNearbyMessage(playerid, 20, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);


-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
ERROR:
___________________________________

error 001: expected token: ")", but found "{"


ONE ERROR
Reply
#2

please use

PHP код:
[CODE][/CODE
and also tell us the line that has the error
Reply
#3

Add ; after the ) on the error line
Reply
#4

Quote:
Originally Posted by MrCesar
Посмотреть сообщение
Add ; after the ) on the error line
This isn't the way to always fix it, especially since the error didn't say it was expecting a ;.

And it'd be easier to tell what's going on with the code being with the code or pawn tag, but from where I can tell change this:
pawn Код:
IRPeatbelt(playerid, var[])
{
if(!Logged(playerid)) NoLogin(playerid);
if(!IsPlayerInAnyVehicle(playerid)
{
to this:
pawn Код:
IRPeatbelt(playerid, var[])
{
if(!Logged(playerid)) NoLogin(playerid);
if(!IsPlayerInAnyVehicle(playerid)) //this was missing a closing parenthesis
{
Reply
#5

Thanks, but there is another problem -__-

(135) : error 001: expected token: ";", but found "if
Reply
#6

Which lane is 135? Can you paste it here?
Reply
#7

omg ill get cancer pls use
[PHP ][/PHP ]
btw where is this line dude?
Reply
#8

Quote:
Originally Posted by pulsare
Посмотреть сообщение
Thanks, but there is another problem -__-

(135) : error 001: expected token: ";", but found "if
Good job by bumping 1-year-old thread.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)