17.08.2015, 12:13
PHP код:
new t = GetPlayerVehicleID(playerid), m = 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(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;
}
}