Make checkpoints on players?
#1

Okay So I've started working on a job filterscript and I'm starting out with making a taxi service job, and I was curious on how to make it so when a player will type a certain command and it will then create a check point for the players that are in the taxi job, on the player that typed the specific command?
Reply
#2

pawn Код:
CMD:taxi(playerid,params)
{
// ShowPlayerCheckPoint here!
}
Reply
#3

GetPlayerPos.
Reply
#4

Hmm, okay I'll get back to you guys later when I get some progress made.
Reply
#5

Okay so sofar I have this

pawn Код:
CMD:call(playerid, params[])
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    SetPlayerCheckpoint(playerid, x, y, z, 3.0);
    new string[128], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    GivePlayerMoney(playerid, 100);
    format(string,sizeof string, "%s Is requesting a taxi!",pName);
    SendClientMessageToAll(0x059EBEFF,string);
    return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
    if(taxijob[playerid] == 1)
    {
        DisablePlayerCheckpoint(playerid);
        return 1;
    }
    return 0;
}
How would I make it so that someone in the job can accept the call and only they can see the check point. and then what functions could i use to make it so when the player enters the taxi they just called, it will pay the driver cab fare? I know i would use the "onplayerentervehcile" callback right?
Reply
#6

First you need a variable that holds the job the player has.
pawn Код:
enum
{
    JOB_NONE,
    JOB_TAXI_DRIVER,
    JOB_POLICE,
    JOB_MEDIC,
}

new pJob[MAX_PLAYERS];
Then you need a loop.
pawn Код:
for(new i; i < MAX_PLAYERS; i++)
{
    if(pJob[i] == JOB_TAXI_DRIVER)
    {
        SetPlayerCheckpoint(i, x, y, z, 1.5);
    }
}
Though, if you're also using checkpoints for other things then I'd recommend looking at the Streamer plugin.
Reply
#7

Okay well I'm using incognitos object streamer, What would i use to do that and another question for you, How would I set a players job using what you showed me.

pawn Код:
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)
            {
                //What would go here?
                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;
}
refer to the code to see what i mean.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)