how i make job
#6

I would use a template like this


pawn Код:
enum { None, Delivery, SomeOtherJob, Another};
enum pInfo {Job}; //can add other things in here like kills, deaths, level, etc

new Info[MAX_PLAYERS][pInfo];


public OnPlayerConnect(playerid)
{
    Info[playerid][Job] = None; //reset the playerid's job to 0 (needs to be done when working with arrays)
    return 1;
}

CMD:join(playerid, params[])
{
    if(Info[playerid][Job] != None) return SendClientMessage(playerid, 0xCC0000AA, "You already have a job!");
   
    if(IsPlayerInRangeOfPoint(playerid, Float:range, Float:X, Float:Y, Float:Z)) //these would be for delivery job join location
    {
        Info[playerid][Job] = Delivery; //set their job to delivery
        SendClientMessage(playerid, 0x00CCCCAA, "You're now a delivery man!");
        //If you had a saving system you would save this either when they join or when they log out
    }
    else if(IsPlayerInRangeOfPoint(playerid, Float:range, Float:X, Float:Y, Float:Z)) //some other job
    {
        Info[playerid][Job] = SomeOtherJob;
        SendClientMessage(playerid, 0x00CCCCAA, "You're now something!");
    }
    //and the same as above for the rest
    return 1;
}

CMD:quitjob(playerid, params[])
{
    if(Info[playerid][Job] == None) return SendClientMessage(playerid, 0xCC0000AA, "You don't have a job!");

    Info[playerid][Job] = None;
    SendClientMessage(playerid, 0x00CCCCAA, "You've quit your job!");
    //like above if you have a saving system you would save this either when they join or when they log out
}
It depends on how you want to actually start the job. Entering a truck? With checkpoints for destinations? If so, I would go to the tutorial section and look for tutorials on things like exclusive vehicles, checkpoints and what not. You could also go to the wiki and look around there.
Reply


Messages In This Thread
how i make job - by TheDiscussionCafe - 20.05.2012, 14:43
Re: how i make job - by IRio97 - 20.05.2012, 14:47
Re: how i make job - by iGetty - 20.05.2012, 14:54
Re: how i make job - by TheDiscussionCafe - 20.05.2012, 14:58
Re: how i make job - by iGetty - 20.05.2012, 15:01
Re: how i make job - by [ABK]Antonio - 20.05.2012, 15:08
Re: how i make job - by TheDiscussionCafe - 20.05.2012, 15:25

Forum Jump:


Users browsing this thread: 1 Guest(s)