/work and /stopwork
#2

Example working with Checkpoints:

pawn Код:
new CP[MAX_PLAYERS];


COMMAND:work(playerid, params[])
{
CP[playerid] =1; // this sets the checkpoint id
SetPlayerCheckpoint(playerid, 1577.3411,1504.8600,10.5608, 4.0); //LV Airport ||Note: 4.0 is the checkpoint size
SendClientMessage(playerid,COLOR_WHITE,"Deliver the damaged passengers from LVAP to SFAP"); // we send the message to the player which we give him info where to go
return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
if (CP[playerid] ==1)
{
DisablePlayerCheckpoint(playerid); // disables his checkpoint since he/she reached it
SendClientMessage(playerid,COLOR_WHITE"You got 15000$ for transferring the damaged passengers from LVAP to SFAP"); // We send the message again
GivePlayerMoney(playerid, +15000); // we give him 15k for his work(i think you dont want to make him rich :P)
}
return 1;
}

CMD:stopwork(playerid, params[])
{
DisablePlayerCheckpoint(playerid); // This fuction here disables the player checkpoint (ANY CHECKPOINT)
SendClientMessage(playerid, COLOR_WHITE, "You lost 1000$ for aborting a mission");
GivePlayerMoney(playerid, -1000); // We are getting his money
return 1;
}
https://sampforum.blast.hk/showthread.php?tid=306615
Reply


Messages In This Thread
/work and /stopwork - by Avi Raj - 24.03.2013, 14:41
Re: /work and /stopwork - by vitorvlv - 24.03.2013, 15:01
Re: /work and /stopwork - by Avi Raj - 24.03.2013, 15:21

Forum Jump:


Users browsing this thread: 1 Guest(s)