Work prolem
#1

When i type /work then go to the checkpoint says i need a trailer, i have a trailer. still sending the messages
I want the player current trailer to go in the checkpoint.

OnPlayerEnterCheckpoint


Код:
new t = GetPlayerVehicleID(playerid);//Explained earlier
	if(!IsTrailerAttachedToVehicle(t)) return SendClientMessage(playerid,-1, "You need a trailer to unload!");//This line checks wether the player has a trailer attached to their truck.
	if(GetPlayerTeam(playerid) == 1)
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
			switch(truck_PlayerJob[playerid])
			{
				case 1:
				{
					truck_PlayerJob[playerid] = -1;
					TogglePlayerControllable(playerid, 0);
					SetTimerEx("Trucker2", 15000, false, "i", playerid);
	                new loading[MAX_PLAYERS];
                    format(loading,sizeof(loading), "~y~Loading... ~g~Please wait");
                    TextDrawSetString(Work[playerid], loading);
					
				}
				case 2, 3:
				{
					truck_PlayerJob[playerid] = 3;
					TogglePlayerControllable(playerid, 0);
					SetTimerEx("Trucker3", 15000, false, "i", playerid);
	                new loading[MAX_PLAYERS];
                    format(loading,sizeof(loading), "~y~unLoading... ~g~Please wait");
                    TextDrawSetString(Work[playerid], loading);
				}
			}
			return 1;
		}
	}
//work command

Код:
  if (GetPlayerTeam(playerid) == 1)
    {
        new m = GetVehicleModel(GetPlayerVehicleID(playerid));
        if(m == 514 || m == 515 || m == 403 || m == 455)
        {
            new t = GetVehicleModel(GetVehicleTrailer(GetPlayerVehicleID(playerid)));
            if (t == 435 || t == 450 || t == 584 || m == 455)
            {
                if (GetPlayerVehicleSeat(playerid) == 0)
                {
                    Trucker1(playerid);
                    truck_PlayerJob[playerid] = 1;
                    Convoy++;
			        //PlayerInfo[playerid][pConvoy] = Convoy;
                    //truckchecktime =
					//SetTimerEx("TruckCheck", 1000, true, "i", playerid);
                }
                else
                {
                    SendClientMessage(playerid, COLOR_LIGHTGREEN, "You are not the driver of this vehicle");
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_LIGHTGREEN, "You do not have a trailer one!");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_LIGHTGREEN, "You are not in a truck!");
        }
    }
Reply
#2

Give me this: IsTrailerAttachedToVehicle
Reply
#3

Still doing it, i need to current trailer and truck for the checkpoint
Reply
#4

PHP код:
new GetPlayerVehicleID(playerid), GetVehicleModel(t);//Explained earlier
    
if(!IsTrailerAttachedToVehicle(m)) return SendClientMessage(playerid,-1"You need a trailer to unload!");//This line checks wether the player has a trailer attached to their truck.
    
if(GetPlayerTeam(playerid) == 1)
    {
        if(
IsPlayerInAnyVehicle(playerid))
        {
            switch(
truck_PlayerJob[playerid])
            {
                case 
1:
                {
                    
truck_PlayerJob[playerid] = -1;
                    
TogglePlayerControllable(playerid0);
                    
SetTimerEx("Trucker2"15000false"i"playerid);
                    new 
loading[MAX_PLAYERS];
                    
format(loading,sizeof(loading), "~y~Loading... ~g~Please wait");
                    
TextDrawSetString(Work[playerid], loading);
                    
                }
                case 
23:
                {
                    
truck_PlayerJob[playerid] = 3;
                    
TogglePlayerControllable(playerid0);
                    
SetTimerEx("Trucker3"15000false"i"playerid);
                    new 
loading[MAX_PLAYERS];
                    
format(loading,sizeof(loading), "~y~unLoading... ~g~Please wait");
                    
TextDrawSetString(Work[playerid], loading);
                }
            }
            return 
1;
        }
    } 
Try this.
Reply
#5

Still asking me for a trailer, i have a trailer and a truck.
Reply
#6

Still having the same problem when the player in a truck and have a trailer then it asked if i need trailer.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)