16.09.2015, 17:03
it only works for id 0 but not all ids. for id 1 i type in /work the message showing for id 1
and sometimes it spams.
In command
and sometimes it spams.
Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { if(gMissionInt[playerid] == 1) { LastOrCurrentVeh[playerid] = vehicleid; } return 1; }
Code:
public OnPlayerExitVehicle(playerid, vehicleid) { if(gMissionInt[playerid] == 1) { LastOrCurrentVeh[playerid] = vehicleid; } return 1; }
Code:
gMissionInt[playerid] = 1; truckchecktime = SetTimerEx("TruckCheck", 1000, true, "i", playerid);
Code:
forward TruckCheck(playerid); public TruckCheck(playerid) { new str[128]; if (!IsPlayerInAnyVehicle(playerid) || !IsTrailerAttachedToVehicle(LastOrCurrentVeh[playerid])) { truckTime[playerid]++; format(str, sizeof(str), "Get back in your truck! ~n~or~n~Reconnect your trailer! ~n~(%d)", 30 - truckTime[playerid]); GameTextForPlayer(playerid, str, 1000, 3); PlayerPlaySound(playerid,1056,0.0,0.0,0.0); if (truckTime[playerid] >= 30) { KillTimer(truckchecktime); StopPlayerJob(playerid); SendClientMessage(playerid, COLOR_LIGHTGREEN, "You failed the mission!"); truckTime[playerid] = 0; } return 1; } return 0; }