SA-MP Forums Archive
C:\Users\Andy\Documents\Connor\NRP - New\gamemodes\NRP.pwn(2126) : error 001: expected token: ")", but found "{" - 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: C:\Users\Andy\Documents\Connor\NRP - New\gamemodes\NRP.pwn(2126) : error 001: expected token: ")", but found "{" (/showthread.php?tid=325806)



C:\Users\Andy\Documents\Connor\NRP - New\gamemodes\NRP.pwn(2126) : error 001: expected token: ")", but found "{" - NewerthRoleplay - 14.03.2012

Hi im getting the error C:\Users\Andy\Documents\Connor\NRP - New\gamemodes\NRP.pwn(2126) : error 001: expected token: ")", but found "{" while i am compiling my script.


Here is the whole command which line 2126 is in.
pawn Code:
CMD:acceptjob(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, -1547.7715,123.7701,3.5547,309.2723)
    {
        pJob[playerid] = TRUCKER;
        SendClientMessage(playerid, COLOR_WHITE, ".:: You have now joined the job, Trucker ::.");
        SendClientMessage(playerid, COLOR_WHITE, ".:: To start work grab a truck and use /startjob ::.");
    }
}



Re: C:\Users\Andy\Documents\Connor\NRP - New\gamemodes\NRP.pwn(2126) : error 001: expected token: ")", but found "{" - Calgon - 14.03.2012

pawn Code:
CMD:acceptjob(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, -1547.7715,123.7701,3.5547,309.2723)) // Here was the problem
    {
        pJob[playerid] = TRUCKER;
        SendClientMessage(playerid, COLOR_WHITE, ".:: You have now joined the job, Trucker ::.");
        SendClientMessage(playerid, COLOR_WHITE, ".:: To start work grab a truck and use /startjob ::.");
    }
}
You need to add an extra closing bracket whenever you use a function in an if statement, to close the function/if statement.


Re: C:\Users\Andy\Documents\Connor\NRP - New\gamemodes\NRP.pwn(2126) : error 001: expected token: ")", but found "{" - NewerthRoleplay - 14.03.2012

Quote:
Originally Posted by Calgon
View Post
pawn Code:
CMD:acceptjob(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, -1547.7715,123.7701,3.5547,309.2723)) // Here was the problem
    {
        pJob[playerid] = TRUCKER;
        SendClientMessage(playerid, COLOR_WHITE, ".:: You have now joined the job, Trucker ::.");
        SendClientMessage(playerid, COLOR_WHITE, ".:: To start work grab a truck and use /startjob ::.");
    }
}
You need to add an extra closing bracket whenever you use a function in an if statement, to close the function/if statement.
Thanks calgon...you are the godfather