15.02.2017, 18:51
Hello! The problem is with this job system,when a player enters the checkpoint to pickup the load he gets freezed as he should. But people found a way to abuse this, they enter the checkpoint to pick up the load then use a cheat to unfreeze themselfs and reenter the pickup checkpoint giving them the job award without actually doing the job. What can I do to prevent this from happening?
PHP код:
// This function is called when a truckdriver enters a checkpoint
Trucker_OnPlayerEnterCheckpoint(playerid)
{
// Check if the player is inside his vehicle while entering a checkpoint
if (GetPlayerVehicleID(playerid) == APlayerData[playerid][VehicleID])
{
// Also check if the player still has his trailer attached
if (APlayerData[playerid][TrailerID] == GetVehicleTrailer(GetPlayerVehicleID(playerid)))
{
// Check the jobstep
switch (APlayerData[playerid][JobStep])
{
// JobStep is 1 (truckdriver is loading his goods at the checkpoint)
case 1: GameTextForPlayer(playerid, TXT_TruckerLoadingGoods, 5000, 4);
// JobStep is 2 (truckdriver is unloading his goods at the checkpoint) or 3 (unloading for convoys)
case 2, 3: GameTextForPlayer(playerid, TXT_TruckerUnloadingGoods, 5000, 4);
}
// Disable the player's actions (he cannot move anymore)
TogglePlayerControllable(playerid, 0);
// Start a timer (Public function "LoadUnload(playerid)" gets called when the timer runs out)
APlayerData[playerid][LoadingTimer] = SetTimerEx("Trucker_LoadUnload", 5000, false, "d" , playerid);
}
else
SendClientMessage(playerid, 0xFFFFFFFF, TXT_NeedTrailerToProceed);
}
else
SendClientMessage(playerid, 0xFFFFFFFF, TXT_NeedVehicleToProceed);
return 1;
}