[Include] TruckingMissions.inc
#28

1) did you update your example script
2) you must be using the old include version
3) try updating the example script
4) ok



Here is an updated example script that will end the players mission if they die + some more
Код:
#include <a_samp>
#include <TruckingMissions>

enum TruckingMissionInfo
{
    MissionName[200],
    bool:UseTrailerCheck,
    MissionPay,
    Float:loadx,
    Float:loady,
    Float:loadz,
    Float:unloadx,
    Float:unloady,
    Float:unloadz
}
new TruckingMissionRandom[][TruckingMissionInfo] =
{
    // {"Mission Text", UseTrailerCheck, MissionPay, loadx, loady, loadz, unloadx, unloady, unloadz}

    /* KEY:
    ** "Mission Text" = The text the player will see when he/she is doing the mission!
    ** UseTrailerCheck = Weather or not the mission requires you use a vehile that has a trailer. Ex: Roadtrain with an Artict1 trailer!
    ** MissionPay = The amount the player will recive for doing there mission!
    ** loadx, loady, and loadz = The loading coordinates of the loading checkpoint!
    ** unloadx, unloadx, unloadx = The un-loading coordinates of the unloading checkpoint!
    */
    
    {"Deliver Holy Water from LVA Freight Depot to LVA Church", true, 10000, 1701.9475,940.5465,10.8203, 1496.2524,772.1427,10.8203},
    {"Deliver Junk Car Parts from LVA Freight Depot to Shody Ottos", true, 10000, 1701.9475,940.5465,10.8203, 1727.6351,1812.1750,10.8203}
};

new IsPlayerInMission[MAX_PLAYERS] = 0; // We are going to use this to detect when a player is in a mission!

main()
{
    print("\n----------------------------------");
    print(" [TGG] Trucking Mission Example Script!");
    print("----------------------------------\n");
}

public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    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)
{
    M_OnPlayerConnect(playerid);
    IsPlayerInMission[playerid] = 0;// reset
    return 1;
}

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


public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp("/work", cmdtext, true))
    {
        new pvehiclemodel = GetVehicleModel(GetPlayerVehicleID(playerid));
        if (pvehiclemodel == 403 || pvehiclemodel == 514 || pvehiclemodel == 515)
        {
            if (IsPlayerInMission[playerid] == 1) return SendClientMessage(playerid, 0xFF0000AA, ">> You are currently in a mission use \"/cancelmission\" to cancel your current mission!"); // prevents them from starting another mission
            new string[200];
            new rand = random(sizeof(TruckingMissionRandom));
            IsPlayerInMission[playerid] = 1; // asign it to 1 becuase there in a mission
            CreatePlayerMission(playerid, TruckingMissionRandom[rand][UseTrailerCheck], TruckingMissionRandom[rand][MissionPay], TruckingMissionRandom[rand][loadx],TruckingMissionRandom[rand][loady], TruckingMissionRandom[rand][loadz], TruckingMissionRandom[rand][unloadx],TruckingMissionRandom[rand][unloady], TruckingMissionRandom[rand][unloadz]);
            format(string, sizeof(string), "You are doing mission: %s", TruckingMissionRandom[rand][MissionName]);
            SendClientMessage(playerid, 0x00FF00FF, string);
        }
        else
        {
            SendClientMessage(playerid, 0xFF0000AA, "Im sorry but this mission requires that you use a vehicle that can pull a semi trailer Ex: Roadtrain with an Artict1!");
        }
        return 1;
    }
    if(!strcmp("/cancelmission", cmdtext, true))
    {
        if (IsPlayerInMission[playerid] == 0) return SendClientMessage(playerid, 0xFF0000AA, "you are not in a mission use \"/work\" to start one!"); // prevents them if there currently not in a mission
        IsPlayerInMission[playerid] = 0; // resets it so they can start another mission
        CancelPlayersCurrentMission(playerid);
        return 1;
    }
    return 0;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    if (IsPlayerInMission[playerid] == 1)// checks to see if a player was in a mission on player death
    {
        CancelPlayersCurrentMission(playerid);// cancels player mission
        IsPlayerInMission[playerid] = 0; // resets the variable so they can start a new mission!
    }
    return 1;
}


public OnPlayerEnterCheckpoint(playerid)
{
    M_OnPlayerEnterCheckpoint(playerid);
    return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
    M_OnPlayerEnterRaceCheckpoint(playerid);
    return 1;
}

public OnPlayerFinishMission(playerid)
{
    SendClientMessage(playerid, 0x00FF00FF, "You have completed your mission!");
    return 1;
}
Reply


Messages In This Thread
TruckingMissions.inc V2.0 Released! - by BLAbla93 - 12.10.2010, 18:10
Re: TruckingMissions.inc - by Georgelopez1 - 12.10.2010, 18:25
Re: TruckingMissions.inc - by [HiC]TheKiller - 12.10.2010, 18:46
Re: TruckingMissions.inc - by BLAbla93 - 12.10.2010, 19:05
Re: TruckingMissions.inc - by vyper - 12.10.2010, 19:29
Re: TruckingMissions.inc - by BLAbla93 - 12.10.2010, 20:15
Re: TruckingMissions.inc - by Kwarde - 12.10.2010, 20:24
Re: TruckingMissions.inc - by BLAbla93 - 12.10.2010, 20:54
Re: TruckingMissions.inc - by [L3th4l] - 12.10.2010, 23:37
Re: TruckingMissions.inc - by Scenario - 13.10.2010, 00:29
Re: TruckingMissions.inc - by BLAbla93 - 13.10.2010, 05:24
Re: TruckingMissions.inc - by HyperZ - 13.10.2010, 09:26
Re: TruckingMissions.inc - by Mauzen - 13.10.2010, 14:11
Re: TruckingMissions.inc - by BLAbla93 - 13.10.2010, 17:02
Re: TruckingMissions.inc - by Janek17 - 13.10.2010, 17:26
Re: TruckingMissions.inc - by BLAbla93 - 13.10.2010, 17:47
Re: TruckingMissions.inc - by Typhome - 14.10.2010, 17:39
Re: TruckingMissions.inc - by BLAbla93 - 14.10.2010, 18:07
Re: TruckingMissions.inc - by Gh0sT_ - 16.10.2010, 14:50
Re: TruckingMissions.inc - by BLAbla93 - 16.10.2010, 20:09
Re: TruckingMissions.inc - by Gh0sT_ - 16.10.2010, 20:12
Re: TruckingMissions.inc - by BLAbla93 - 16.10.2010, 20:22
Re: TruckingMissions.inc - by Gh0sT_ - 16.10.2010, 21:37
Re: TruckingMissions.inc - by [L3th4l] - 16.10.2010, 22:25
Re: TruckingMissions.inc - by Gh0sT_ - 16.10.2010, 22:29
Re: TruckingMissions.inc - by BLAbla93 - 17.10.2010, 00:53
Re: TruckingMissions.inc - by Gh0sT_ - 17.10.2010, 01:01
Re: TruckingMissions.inc - by BLAbla93 - 17.10.2010, 01:58
Re: TruckingMissions.inc - by BLAbla93 - 03.11.2010, 04:53
Re: TruckingMissions.inc - by Stefan_Toretto - 16.12.2010, 18:58
Re: TruckingMissions.inc - by Ryan_Obeles - 15.02.2012, 10:22
Re: TruckingMissions.inc - by Ryan_Obeles - 24.02.2012, 04:59
Re: TruckingMissions.inc - by [MM]18240[FMB] - 28.07.2012, 04:30
Re: TruckingMissions.inc - by -BlueBerry- - 02.08.2012, 08:55
Re: TruckingMissions.inc - by Asphira Andreas Rechta - 11.10.2012, 15:22
Re: TruckingMissions.inc - by Asphira Andreas Rechta - 11.10.2012, 15:24
Re: TruckingMissions.inc - by TheArcher - 12.10.2012, 12:53
Re: TruckingMissions.inc - by NoahF - 12.10.2012, 19:39

Forum Jump:


Users browsing this thread: 1 Guest(s)