Checkpoint. ++rep
#7

Quote:
Originally Posted by HY
Посмотреть сообщение
pawn Код:
#include <a_samp>
#include <zcmd>

#define MAX_JOBS 2 // Max Jobs
#define YourJobName 1 // Your Job Name

new wJob[MAX_PLAYERS];

// Get Job command

CMD:getjob(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, RANGE, X, Y, Z)) // Replace RANGE = Distance when he can use, and X,Y,Z with your pick-up coordinates
    wJob[playerid] = 1; // 1 = YourJobName from defines !
    SendClientMessage(playerid, -1, "{FF0000}[INFO]: {15FF00}You have chose your job."); // He will get a job  !
    return 1;
}

// For making a command only for that job :

CMD:CommandName(playerid, params[])
{
    if(wJob[playerid] != 1) //Number "1" is your job name.
        return SendClientMessage(playerid, 0xAFAFAFAA, "You don't have this job"); // Get a message he haven't that job !

    SendClientMessage(playerid,-1,"Your job command Text or code"); // If he have that job
    return 1;
}

// For Quit Job (You don't have any job)

CMD:quitjob(playerid, params[])
{
    wJob[playerid] = 0; //Now you don't have any job !
    SendClientMessage(playerid,0xAFAFAFAA,"Now you're unemployed"); // Text
    return 1;
}
- You need ZCMD.

http://www.solidfiles.com/d/d20f/zcmd.inc

- Hope I helped you. A good day !
- P.S: Sorry I writed so hard, I didn't see your comments, I was working .
Thanks bro, but it's a little buggy.

When I type /getjob it works anywhere (I wanted it to only be when you're under an info thingy). And with the checkpoints - they just don't show up (I did change the coords to the ones I wanted).

pawn Код:
//Start of jobs

public OnPlayerEnterCheckpoint(playerid)
{
     if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 531)
     {
        if(ExJob[playerid] == 1){
            ExJob[playerid] = 2;
            SetPlayerCheckpoint(playerid,50.2074,-86.3620,0.6094,10);
            SendClientMessage(playerid,COLOR_YELLOW,"* Please go to the next mark, and you'll be payed!");
            return 1;
         }
        if(ExJob[playerid] == 2){
            ExJob[playerid] = 3;
            SetPlayerCheckpoint(playerid,42.8746,-114.5679,0.6169,10);
            return 1;
         }
        if(ExJob[playerid] == 3){
            ExJob[playerid] = 4;
            SetPlayerCheckpoint(playerid,42.8746,-114.5679,0.6169,10);
            return 1;
         }
        if(ExJob[playerid] == 4){
            ExJob[playerid] = 5;
            SetPlayerCheckpoint(playerid,33.0193,-118.6128,0.6169,10);
            return 1;
         }
        if(ExJob[playerid] == 5){
            ExJob[playerid] = 6;
            SetPlayerCheckpoint(playerid,42.6236,-71.0327,0.6094,10);
            return 1;
         }
        if(ExJob[playerid] == 6){
            ExJob[playerid] = 7;
            SetPlayerCheckpoint(playerid,37.0597,-61.5438,1.5049,10);
            return 1;
         }
        if(ExJob[playerid] == 7){
            ExJob[playerid] = 8;
            SetPlayerCheckpoint(playerid,17.9072,-119.0836,0.6094,10);
            return 1;
         }
         if(ExJob[playerid] == 8){
            ExJob[playerid] = 9;
            SetPlayerCheckpoint(playerid,31.6652,-50.3610,2.5574,10);
            return 1;
         }
        if(ExJob[playerid] == 8){
            ExJob[playerid] = 9;
            SetPlayerCheckpoint(playerid,9.0930,-116.7551,0.6390,10);
            return 1;
         }
        if(ExJob[playerid] == 9){
            ExJob[playerid] = 0;
            DisablePlayerCheckpoint(playerid);
            SendClientMessage(playerid,COLOR_YELLOW,"* You have recieved $300 for your work!");
            GivePlayerMoney(playerid,150);
         }
     }
     return 1;
}


// Get Job command

CMD:getjob(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 4.0,-46.5548,-108.5900,3.1172)) // Replace RANGE = Distance when he can use, and X,Y,Z with your pick-up coordinates
    wJob[playerid] = 1; // 1 = YourJobName from defines !
    SendClientMessage(playerid, -1, "{FF0000}[INFO]: {15FF00}You have chose your job."); // He will get a job  !
    return 1;
}

// For making a command only for that job :

CMD:CommandName(playerid, params[])
{
    if(wJob[playerid] != 1) //Number "1" is your job name.
        return SendClientMessage(playerid, 0xAFAFAFAA, "You don't have this job"); // Get a message he haven't that job !

    SendClientMessage(playerid,-1,"Your job command Text or code"); // If he have that job
    return 1;
}

// For Quit Job (You don't have any job)

CMD:quitjob(playerid, params[])
{
    wJob[playerid] = 0; //Now you don't have any job !
    SendClientMessage(playerid,0xAFAFAFAA,"Now you're unemployed"); // Text
    return 1;
}
There are both of the two things I was supposed to put in.
Reply


Messages In This Thread
Checkpoint. ++rep - by mkmk - 03.11.2014, 17:42
Re: Checkpoint. ++rep - by HY - 03.11.2014, 17:52
Re: Checkpoint. ++rep - by mkmk - 03.11.2014, 17:58
Re: Checkpoint. ++rep - by HY - 03.11.2014, 18:01
Re: Checkpoint. ++rep - by mkmk - 03.11.2014, 18:07
Re: Checkpoint. ++rep - by HY - 03.11.2014, 18:20
Re: Checkpoint. ++rep - by mkmk - 03.11.2014, 18:58
Re: Checkpoint. ++rep - by HY - 04.11.2014, 05:56

Forum Jump:


Users browsing this thread: 1 Guest(s)