17.08.2015, 11:19
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
//work command
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; } }
Код:
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!"); } }