[HELP PLEASE] error 001: expected token: ")", but found "{" -
ReScape - 16.10.2016
return 1;
}
IRP

eatbelt(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
Re: [HELP PLEASE] error 001: expected token: ")", but found "{" -
ThatFag - 16.10.2016
please use
and also tell us the line that has the error
Re: [HELP PLEASE] error 001: expected token: ")", but found "{" -
MrCesar - 16.10.2016
Add ; after the ) on the error line
Re: [HELP PLEASE] error 001: expected token: ")", but found "{" -
DTV - 16.10.2016
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
{
Re: [HELP PLEASE] error 001: expected token: ")", but found "{" -
pulsare - 10.10.2017
Thanks, but there is another problem -__-
(135) : error 001: expected token: ";", but found "if
Re: [HELP PLEASE] error 001: expected token: ")", but found "{" -
Kraeror - 10.10.2017
Which lane is 135? Can you paste it here?
Re: [HELP PLEASE] error 001: expected token: ")", but found "{" -
n00blek - 10.10.2017
omg ill get cancer pls use
[PHP ][/PHP ]
btw where is this line dude?
Re: [HELP PLEASE] error 001: expected token: ")", but found "{" -
Xeon™ - 10.10.2017
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.