enum help.
#1

Okay so i have another question regarding my FS that im working on. How would i set the players job to JOB_TAXI? how would i make either of those change?

pawn Код:
enum
{
    JOB_NONE,
    JOB_TAXI,
}


new pJob[MAX_PLAYERS];

CMD:taxijob(playerid, params[])
{
    for(new i; i < MAX_PLAYERS; i++)
    if(pJob[i] == JOB_TAXI)return SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: {FFFFFF}You are already in a job.");
    SetPlayerCheckpoint(playerid,1743.5216,-1862.2520,13.5765,5);
    SendClientMessage(playerid, COLOR_LIGHTRED, "JOB INFO: {FFFFFF}An Icon has been put on your radar!");
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid ==  TaxiPickup)
    {
        DisablePlayerCheckpoint(playerid);
        ShowPlayerDialog(playerid,DIALOG_TAXI,DIALOG_STYLE_MSGBOX,"Taxi Job","Would you like to work with us at the Los Santos Taxi service?","Accept","Reject");
        return 1;
    }
    return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_TAXI)
    {
        if(response)
        {
            for(new i; i < MAX_PLAYERS; i++)
            if(pJob[i] == JOB_NONE)
            {
                //How would I set the players job to JOB_TAXI?
                SendClientMessage(playerid, COLOR_LIGHTRED, "JOB INFO: {FFFFFF}You have accepted the job, please get in a Taxi.");
            }
            else if(!response)
            {
                SendClientMessage(playerid, COLOR_LIGHTRED, "JOB INFO: {FFFFFF}You have rejected the job");
            }
        }
        return 1;
    }
    return 0;
}
Reply
#2

You have to give the enum a name like:

enum drift
{
JOB_NONE,
JOB_TAXI,
}

And this:

new pJob[MAX_PLAYERS];

Should be:

new pJob[MAX_PLAYERS][drift];
Reply
#3

Okay How does this help my question?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)