Truckman
#1

How to make a mission for a trucker...

I'm going to the truck and and he will report me "Attach this marked semitrailer"

When I have my trailer attached he will write to me "Trailer connected and you can go to work"
Reply
#2

Go here: https://sampforum.blast.hk/showthread.php?tid=447813
Reply
#3

Quote:
Originally Posted by EmpireSk
Посмотреть сообщение
I'm going to the truck and and he will report me "Attach this marked semitrailer"
OnPlayerEnterVehicle

Quote:
Originally Posted by EmpireSk
Посмотреть сообщение
When I have my trailer attached he will write to me "Trailer connected and you can go to work"
Better use a checkpoint or just a message, as you can't detect if a player has manually just attached his trailer, except if you run a timer, the best option would be to check if his vehicle has a trailer or not after reaching the destination : IsTrailerAttachedToVehicle
Reply
#4

Quote:
Originally Posted by TheToretto
Посмотреть сообщение
OnPlayerEnterVehicle



Better use a checkpoint or just a message, as you can't detect if a player has manually just attached his trailer, except if you run a timer, the best option would be to check if his vehicle has a trailer or not after reaching the destination : IsTrailerAttachedToVehicle
I have this and when I go to Checkpoint and I will not pass it on to another Checkpoint

PHP код:

CMD
:misia(playeridparams[])
{
    if(
IsPlayerConnected(playerid))
    {
        if(
PlayerInfo[playerid][Job] != 18 && PlayerInfo[playerid][Job] != 7) return FormatPlayerInfoBox(playerid,"~g~Misia Info","~w~Pouze pro: Farmarov a Kamionistov!",3000);
         else if(
VRServer[playerid][MissionID] != 9999) return FormatPlayerInfoBox(playerid,"~g~Misia Info","~w~ Uћ plnнљ nejakou misi ! Pouћi: /missionoff pro vypnutн mise !",3000);
           else if(
GetPlayerVehicleID(playerid) == 0) return FormatPlayerInfoBox(playerid,"~g~Info","~w~Misia Nie si vo vozidle.",3000);
        else if((
PlayerInfo[playerid][Job] == 18) && (GetVehicleModel(GetPlayerVehicleID(playerid)) != 532)) return FormatPlayerInfoBox(playerid,"~g~Misia Info","~w~Nie si v Konbajne.",3000);
        else if((
PlayerInfo[playerid][Job] == 7) && (GetVehicleModel(GetPlayerVehicleID(playerid)) != 514) && (GetVehicleModel(GetPlayerVehicleID(playerid)) != 515)) return FormatPlayerInfoBox(playerid,"~g~Info","~w~Nie si v Kamione",3000);
        else
        {
            
DisablePlayerCheckpoint(playerid);
            if(
PlayerInfo[playerid][Job] == 7)
            {
                
VRServer[playerid][MissionID]=7;
                
VRServer[playerid][MissionInfo]=0;
                if(
IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
                {
                    switch(
random(9))
                    {
                        case 
0:    SetPlayerCheckpoint(playerid,1007.1722,-1743.6180,13.5459,15);
                        case 
1:    SetPlayerCheckpoint(playerid,-90.9609,-1169.5758,2.1723,15);
                        case 
2:    SetPlayerCheckpoint(playerid,1380.2943,456.9404,19.6797,15);
                        case 
3:    SetPlayerCheckpoint(playerid,2352.1377,-1337.8579,23.7761,15);
                        case 
4:    SetPlayerCheckpoint(playerid,1848.6504,-2403.8574,13.3173,15);
                        case 
5:    SetPlayerCheckpoint(playerid,1944.8840,-1772.5952,13.1521,15);
                        case 
6:    SetPlayerCheckpoint(playerid,1004.3183,-932.8453,42.1797,15);
                        case 
7:    SetPlayerCheckpoint(playerid,315.7915,-162.0369,1.5781,15);
                        case 
8SetPlayerCheckpoint(playerid,659.1002,-565.2003,16.3359,15);
                    }
                    
FormatPlayerInfoBox(playerid,"~g~Misia Info","~w~Prave jsi zahajil plneni mise, v techto misich budes ~y~rozvazet palivo~w~ do benzinovych stanic, pumpu mas oznacenou na mape ~r~cervenou barvou",3000);
                }
                else
                {
                    
VRServer[playerid][MissionID]=9999;
                    
VRServer[playerid][MissionInfo]=9999;
                    
FormatPlayerInfoBox(playerid,"~g~Misia Info","Nemas prives, tym padom sa misia ukoncila",3000);
                }
            }
        }
    }
    return 
1;
}
public 
OnPlayerEnterCheckpoint(playerid)
{
    if(!
IsPlayerNPC(playerid))
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
VRServer[playerid][MissionID] == 7)
            {
                if(
GetPlayerVehicleID(playerid) > 0)
                {
                    if(
GetVehicleModel(GetPlayerVehicleID(playerid)) == 514)
                    {
                        
FormatPlayerInfoBox(playerid"~g~Misia""~w~Pokracuj."2000);
                        
PlayerInfo[playerid][Premie]+=5000;
                        
DisablePlayerRaceCheckpoint(playerid);
                        switch(
random(9))
                        {
                            case 
0:    SetPlayerCheckpoint(playerid,1007.1722,-1743.6180,13.5459,15);
                            case 
1:    SetPlayerCheckpoint(playerid,-90.9609,-1169.5758,2.1723,15);
                            case 
2:    SetPlayerCheckpoint(playerid,1380.2943,456.9404,19.6797,15);
                            case 
3:    SetPlayerCheckpoint(playerid,2352.1377,-1337.8579,23.7761,15);
                            case 
4:    SetPlayerCheckpoint(playerid,1848.6504,-2403.8574,13.3173,15);
                            case 
5:    SetPlayerCheckpoint(playerid,1944.8840,-1772.5952,13.1521,15);
                            case 
6:    SetPlayerCheckpoint(playerid,1004.3183,-932.8453,42.1797,15);
                            case 
7:    SetPlayerCheckpoint(playerid,315.7915,-162.0369,1.5781,15);
                            case 
8:    SetPlayerCheckpoint(playerid,659.1002,-565.2003,16.3359,15);
                        }
                        return 
0;
                    }
                }
            }
        }
    }
    return 
1;

Reply
#5

Use some prints to see if your checks even pass or not.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)