job checkpoints - 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 checkpoints (
/showthread.php?tid=522048)
job checkpoints -
Bek_Loking - 25.06.2014
Eh. I'd like to make some checkpoints in my jobs. Now what the problem is here:
I don't really know how to make checkpoints, do I make them like this:
PHP код:
public OnPlayerEnterCheckpoint(playerid)
{
if(lawnmower[playerid] == 1)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, size,x,y,z);
}
if(lawnmower[playerid] == 1)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, size,x,y,z);
}
return 1;
}
or:
PHP код:
public OnPlayerEnterCheckpoint(playerid)
{
if(lawnmower[playerid] == 1)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, size,x,y,z);
}
}
case 1;
{
if(lawnmower[playerid] == 1)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, size,x,y,z);
}
}
case 2;
return 1;
}
I want 10 checkpoints i got coords and everything but I don't know how to make more?
Re: job checkpoints -
VenomMancer - 25.06.2014
May this will help you
pawn Код:
#include <a_samp>
// variable
new lawnmower[MAX_PLAYERS];
public OnPlayerEnterCheckpoint(playerid)
{
if(lawnmower[playerid] == 1)
{
lawnmower[playerid] =2;
SetPlayerCheckpoint(playerid, size,x,y,z);
}
if(lawnmower[playerid] == 2)
{
lawnmower[playerid] =3;
SetPlayerCheckpoint(playerid, size,x,y,z);
}
if(lawnmower[playerid] == 3)
{
lawnmower[playerid] =4;
SetPlayerCheckpoint(playerid, size,x,y,z);
}
// this for your las checkpoint (finish the job)
if(lawnmower[playerid] == 4)
{
lawnmower[playerid] =0;
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid,-1,"** You has finished the job!");
GivePlayerMoney(playerid,100000)
}
return 1;
}
Re: job checkpoints -
WardenCS - 25.06.2014
Код:
CMD:startjob(playerid,params[])
{
if(lawnmower[playerid] != 0)
{
SendClientMessage(playerid,0xFFFFFFFF,"You are already on job!");
return 1;
}
SetPlayerCheckpoint(playerid, size,x,y,z); // first checkpoint
SendClientMessage(playerid,0xFFFFFFFF,"You have started the job, go through the checkpoints to recive the paycheck.");
lawnmower[playerid] = 1;
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
if(lawnmower[playerid] == 1)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, size,x,y,z); // checkpoint 2
lawnmower[playerid] += 1;
}
if(lawnmower[playerid] == 2) // if the player enters the checkpoint 2
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, size,x,y,z); //checkpoint 3
lawnmower[playerid] += 1;
}
if(lawnmower[playerid] == 3) // if the player enters the checkpoint 3
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, size,x,y,z);
lawnmower[playerid] += 1;
}
//now go on like this till it gets to 10 give him the paycheck and set lawnmower[playerid] back to 0
return 1;
}
EDIT:damn i was little too late
Re: job checkpoints -
Bek_Loking - 25.06.2014
Gonna use that first one. Thank you.
Re: job checkpoints -
Bek_Loking - 25.06.2014
I'll give some reputation later. I have to wait 24 hours to give rep. I won't forget don't worry guys. You both will get reputation, thanks veeeery muuuuuuchh