[Mission Help]UnResponsive Checkpoint.
#1

Right so I have created a truck mission which has a few stages.
No mission
Going to load
going to offload

However when i goto the offload checkpoint. It wont detect the vehicle going into it. And it is as usefull as a chocolate teapot.

The code is below and yes it is in strcmp because I have not changed it to ZCMD yet.


Any help is much appreciated.

pawn Код:
#include <a_samp>

//Stages
enum {
    STAGE_NONE,
    STAGE_PICKUP,
    STAGE_ONROUTE,
    STAGE_COMPLETE
}

new MissionStage[MAX_PLAYERS];

//COLORS
#define COLOR_ORANGE    0xFFA500FF
#define COLOR_LIMEGREEN     0x32CD32FF
#define COLOR_ROYALBLUE     0x4169E1FF
#define COLOR_PINK      0xFA8072FF
#define COLOR_GREY      0xAFAFAFAA
#define COLOR_GREEN         0x33AA33AA
#define COLOR_RED       0xAA3333AA
#define COLOR_YELLOW    0xFFFF00AA
#define COLOR_WHITE     0xFFFFFFAA
#define COLOR_BLUE      0x0000BBAA
#define COLOR_LIGHTBLUE     0x33CCFFAA

#define TEAM_TRUCKER 0

//Rubbish Checkpoints
new Float:Gcheckpoints[5][4] =
{
    { 2798.1702,-1576.2926,10.9272, 10.0 },
    { 2060.4375,-2091.2126,13.5469, 10.0 },
    { 070.8125,-2384.6160,13.5469, 10.0 },
    { 900.7358,-1204.0779,16.9832, 10.0 },
    { 800.1103,-1542.8258,13.5526, 10.0 }
};

main()
{
   
}

public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("Life Of Transport");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);

    //Server Vehicles
    CreateVehicle(455, 0, 0, 12.2887, 82.2873, -1, -1, 60);

    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
   
    return 1;
}

public OnPlayerConnect(playerid)
{
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/work", cmdtext, true, 10) == 0) {
    //Garbage Mission
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 455) {
            if (MissionStage[playerid] != STAGE_NONE) {
                SendClientMessage(playerid, COLOR_RED, "You are already doing the rubbish truck driving Mission!");
                return 1;
            }
            MissionStage[playerid] = STAGE_PICKUP;
            new rand = random(sizeof(Gcheckpoints));
            SetPlayerCheckpoint(playerid, Gcheckpoints[rand][0], Gcheckpoints[rand][1], Gcheckpoints[rand][2], Gcheckpoints[rand][3]);
            GameTextForPlayer(playerid, "~g~You started the job, good luck!", 3000, 3);
            new name[MAX_PLAYER_NAME], string[48];
            GetPlayerName(playerid, name, sizeof(name));
            format(string, sizeof(string), "%s is now doing the Rubbish mission.", name );
            return SendClientMessageToAll(COLOR_YELLOW, string);
        }
        return SendClientMessage(playerid, COLOR_RED, "You have to be in a truck to start the job");
        //Garbage mission ends
    }
    return 0;
}

public OnPlayerEnterCheckpoint(playerid)
{
    DisablePlayerCheckpoint(playerid);
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 455) {
        if(STAGE_PICKUP == MissionStage[playerid]) {
            SendClientMessage(playerid, COLOR_RED, "Loading Rubbish");
            SetPlayerCheckpoint(playerid, 0, 0, 0, 0);
            GameTextForPlayer(playerid, "~g~Go drop off the rubbish!", 3000, 3);
            MissionStage[playerid] = STAGE_ONROUTE;
        }
        else if(STAGE_ONROUTE == MissionStage[playerid]) {
            DisablePlayerCheckpoint(playerid);
            SendClientMessage(playerid, COLOR_RED, "Unloading Rubbish");
            GameTextForPlayer(playerid, "~g~You Completed The Mission", 3000, 3);
            SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
            GivePlayerMoney(playerid, 5000);
            new name[MAX_PLAYER_NAME], string[48];
            GetPlayerName(playerid, name, sizeof(name));
            format(string, sizeof(string), "%s has Completed A Rubbish Mission!", name );
            MissionStage[playerid] = STAGE_NONE;
        }
    }
    return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
    return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
    return 1;
}

public OnRconCommand(cmd[])
{
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    return 1;
}

public OnObjectMoved(objectid)
{
    return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
    return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
    return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
    return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
    return 1;
}

public OnPlayerExitedMenu(playerid)
{
    return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
    return 1;
}

public OnPlayerUpdate(playerid)
{
    return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
    return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
    return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
    return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    return 1;
}
Reply
#2

I cant understand why it aint working. Any clues, anyone?
Reply
#3

Try changing
pawn Код:
STAGE_PICKUP == MissionStage[playerid]
by

pawn Код:
MissionStage[playerid] == STAGE_PICKUP
and the same for STAGE_ONROUTE
Reply
#4

Nope still isnt fixed :/
Reply
#5

Maybe like that ?

pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 455) {
        if(MissionStage[playerid] == STAGE_PICKUP) {
            SendClientMessage(playerid, COLOR_RED, "Loading Rubbish");
            SetPlayerCheckpoint(playerid, 0, 0, 0, 0);
            GameTextForPlayer(playerid, "~g~Go drop off the rubbish!", 3000, 3);
            MissionStage[playerid] = STAGE_ONROUTE;
        }
        else if(MissionStage[playerid] == STAGE_ONROUTE) {
            SendClientMessage(playerid, COLOR_RED, "Unloading Rubbish");
            GameTextForPlayer(playerid, "~g~You Completed The Mission", 3000, 3);
            SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
            GivePlayerMoney(playerid, 5000);
            new name[MAX_PLAYER_NAME], string[48];
            GetPlayerName(playerid, name, sizeof(name));
            format(string, sizeof(string), "%s has Completed A Rubbish Mission!", name );
            MissionStage[playerid] = STAGE_NONE;
        }
    }
    DisablePlayerCheckpoint(playerid);
    return 1;
}
Reply
#6

No luck either way :/
Reply
#7

Quote:
Originally Posted by Shidony
Посмотреть сообщение
Try changing
pawn Код:
STAGE_PICKUP == MissionStage[playerid]
by

pawn Код:
MissionStage[playerid] == STAGE_PICKUP
and the same for STAGE_ONROUTE
Dude... what's difference between the first and the 2nd... are u freakin' kidding me...

EDIT: btw I noticed a mistake... At the line
pawn Код:
format(string, sizeof(string), "%s has Completed A Rubbish Mission!", name );
you havent set a client message to be sent. Like

pawn Код:
format(string, sizeof(string), "%s has Completed A Rubbish Mission!", name );
SendClientMessage(playerid, -1, string);
also I don't think it's essential to put a DisablePlayerCheckpoint in the callback
pawn Код:
public OnPlayerEnterCheckpoint(...
since when someone enters a checkpoints it disables automatically.
Reply
#8

Thanks for that but it still doesn't explain why the unload checkpoint isnt working...
Reply
#9

I really cant do any more untill I have this fixed. Can anybody help?
Reply
#10

Which checkpoint doesn't respond, the pickup checkpoint or the last one?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)