job problems - 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: job problems (
/showthread.php?tid=521875)
job problems -
Bek_Loking - 25.06.2014
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 010: invalid function or declaration
C:\Users\MARKO\Desktop\Learning\gamemodes\Tutorial.pwn(444) : error 001: expected token: ";", but found "if"
C:\Users\MARKO\Desktop\Learning\gamemodes\Tutorial.pwn(445) : error 010: invalid function or declaration
C:\Users\MARKO\Desktop\Learning\gamemodes\Tutorial.pwn(446) : error 010: invalid function or declaration
C:\Users\MARKO\Desktop\Learning\gamemodes\Tutorial.pwn(451) : error 010: invalid function or declaration
C:\Users\MARKO\Desktop\Learning\gamemodes\Tutorial.pwn(1116) : warning 203: symbol is never used: "job"
C:\Users\MARKO\Desktop\Learning\gamemodes\Tutorial.pwn(1116) : warning 203: symbol is never used: "vmodel"
on these lines:
PHP код:
CMD:mowland
[LINE 442]{
new vmodel = GetPlayerVehicleModel
[LINE 444]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!")
[LINE 446]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!");
}
[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.
Re: job problems -
Abagail - 25.06.2014
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.
Re: job problems -
Laurey - 25.06.2014
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;
}