[Include] TruckingMissions.inc
#21

well, house system using not race cp's, normal cp, but funcs are from streamer plugin..
Reply
#22

The only thing is if I was to make it so it would work with our streamer is instead of being a radar icon on your mini map for you to follow now there would be nothing.





I would un comment This line in the TruckingMissions.inc

Код:
//#define USE_RACE_CHECKPOINT   // Un comment this line to enable Race Checkoints!
Then it wont use regular cp's
Reply
#23

Ok, thanks. Its working pretty good, but im founded some bugs:

1. When you use /work, its didnt set mission randomly, its set first mission ( in enum )
2. When you die, checkpoint didnt deleted
3. When you come to checkpoint, its nothing.. I mean: Come at CP, and nothing does..
4. You can use /work anywhere, not at StartX, Y, Z.
Reply
#24

1. You probably don't have the 'Random' mission script.
2. Umm, there are some functions you can use when a player dies
3. CPs Does work, try the Race CPs
4. You can use /work at any time, giving you a new mission. Script something to avoid that
Reply
#25

1. nah, im added it from 1post
2. ?
3. already using
4. ?
Reply
#26

Quote:
Originally Posted by Gh0sT_
Посмотреть сообщение
Ok, thanks. Its working pretty good, but im founded some bugs:

1. When you use /work, its didnt set mission randomly, its set first mission ( in enum )
2. When you die, checkpoint didnt deleted
3. When you come to checkpoint, its nothing.. I mean: Come at CP, and nothing does..
4. You can use /work anywhere, not at StartX, Y, Z.

1) did you use the mission script example I made?
2) there is a callback to end the players current mission but there charged the fee for lost goods! But I released the mission example script does not show you how to do this so I will update it tonight and update it.
3) ?? could you explain this bug further to see if its my include or if its your code.
4) Huh??
Reply
#27

1. yes
2. ?
3. when u use /work, than drive to CP, and when u come to it, im getting nothing ( no message, etc, and checkpoint didnt destroying. )
4. me fail, srry
Reply
#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
#29

Thanks for the feed back if there is anything you want me to add that is related to the INC not a TD showing the current mission but like a option you would like to see. some callbacks?

I am thinking about creating some on OnPlayerLoad(playerid) and OnPlayerUnload(playerid) for example.
Reply
#30

Great Work, keep going man
Reply
#31

can i use this for pilot missions too?
Reply
#32

NICE include but on ur tutorial on how to use it u should add

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

change it to

public OnPlayerFinishMission(playerid)
{
SendClientMessage(playerid, 0x00FF00FF, "You have completed your mission!");
IsPlayerInMission[playerid] = 0;// reset
return 1;
}

because i checked it and it says i am still on mission even if i am done

if i helped rep me
Reply
#33

Is this .3e?
Reply
#34

How to give money Automaticly by delivering the missions
Reply
#35

Thanks Guys Nice Filters Scripts Yours.
Reply
#36

I Like

public OnPlayerFinishMission(playerid)
{
SendClientMessage(playerid, BLUE, "Small Park Completes.");
GivePlayerMoney(playerid, 500);
return 1;
}
Reply
#37

This include is quite old, it's also bad coded on some parts. E.g OnPlayerFinishMission(playerid); should be called by
pawn Код:
CallLocalFunction("OnPlayerFinishMission", "d", playerid);
On that way the callback is called not executed.
Reply
#38

Nice work! +REP sir.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)