job problems
#1

Hey! I've recently made a job with Jefff's help [ty mate] and now I've made another command which I want to start the job of course. Now what I want to do; Make a command to start a job, then make 5-10 checkpoints after last one he gets money and a message with job well done. now my problem is;
I got these errors:

PHP код:
C:\Users\MARKO\Desktop\Learning\gamemodes\Tutorial.pwn(442) : error 010invalid function or declaration
C
:\Users\MARKO\Desktop\Learning\gamemodes\Tutorial.pwn(444) : error 001expected token";"but found "if"
C:\Users\MARKO\Desktop\Learning\gamemodes\Tutorial.pwn(445) : error 010invalid function or declaration
C
:\Users\MARKO\Desktop\Learning\gamemodes\Tutorial.pwn(446) : error 010invalid function or declaration
C
:\Users\MARKO\Desktop\Learning\gamemodes\Tutorial.pwn(451) : error 010invalid function or declaration
C
:\Users\MARKO\Desktop\Learning\gamemodes\Tutorial.pwn(1116) : warning 203symbol is never used"job"
C:\Users\MARKO\Desktop\Learning\gamemodes\Tutorial.pwn(1116) : warning 203symbol is never used"vmodel" 
on these lines:
PHP код:
CMD:mowland
[LINE 442]{
new 
vmodel GetPlayerVehicleModel
[LINE 444]if(lawnmower[playerid] == 0SendClientMessage(playeridCOLOR_RED"[ERROR]{FFFFFF}You're not employed as lawnmower!")
[
LINE 445]else if(!IsPlayerInRangeOfPoint(playerid5,1878.5900,1758.6154,10.4470)) SendClientMessage(playeridCOLOR_RED"[ERROR]{FFFFFF}You're not near mowers'job starting line!")
[
LINE 446]else if(vmodel == 572 || IsPlayerInRangeOfPoint(playerid,5,1878.5900,1758.6154,10.4470))
{
job[playerid] = 1
SendClientMessage
(playeridCOLOR_LIGHTGREEN"[SUCCESS!]{FFFFFF}You've started lawnmowing. Go through checkpoints to finish your job!");
}
[
LINE 451]return 1;

And I don't understand these warnings? vmodel is used as well with job?

And yeah, how do I make multiple checkpoints, like when he goes through one checkpoint, another one spawns, I got coordinates for checkpoints.
Reply
#2

The first issue is that you've used the wrong syntax. It should be,
pawn Код:
CMD:mowland(playerid, params[])
And on line 444, you forgot to put a ;...

Heres a fixed version,
pawn Код:
CMD:mowland(playerid, params[])
{
new vmodel = GetVehicleModel(GetPlayerVehicleID(playerid);
if(lawnmower[playerid] == 0) SendClientMessage(playerid, COLOR_RED, "[ERROR]{FFFFFF}You're not employed as lawnmower!")
[LINE 445]else if(!IsPlayerInRangeOfPoint(playerid, 5,1878.5900,1758.6154,10.4470)) SendClientMessage(playerid, COLOR_RED, "[ERROR]{FFFFFF}You're not near mowers'job starting line!");
else if(vmodel == 572 || IsPlayerInRangeOfPoint(playerid,5,1878.5900,1758.6154,10.4470)
{
job[playerid] = 1;
SendClientMessage(playerid, COLOR_LIGHTGREEN, "[SUCCESS!]{FFFFFF}You've started lawnmowing. Go through checkpoints to finish your job!");
}
return 1;
}
Untested.
Reply
#3

Above one is surely to give errors, use this one
pawn Код:
CMD:mowland(playerid, params[])
{
new vmodel = GetVehicleModel(GetPlayerVehicleID(playerid);
if(lawnmower[playerid] == 0) SendClientMessage(playerid, COLOR_RED, "[ERROR]{FFFFFF}You're not employed as lawnmower!") ;
else if(!IsPlayerInRangeOfPoint(playerid, 5,1878.5900,1758.6154,10.4470)) SendClientMessage(playerid, COLOR_RED, "[ERROR]{FFFFFF}You're not near mowers'job starting line!");
else if(vmodel == 572 || IsPlayerInRangeOfPoint(playerid,5,1878.5900,1758.6154,10.4470)
{
job[playerid] = 1;
SendClientMessage(playerid, COLOR_LIGHTGREEN, "[SUCCESS!]{FFFFFF}You've started lawnmowing. Go through checkpoints to finish your job!");
}
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)