Job abuse / Help!
#1

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 1GameTextForPlayer(playeridTXT_TruckerLoadingGoods50004);
                
// JobStep is 2 (truckdriver is unloading his goods at the checkpoint) or 3 (unloading for convoys)
                
case 23GameTextForPlayer(playeridTXT_TruckerUnloadingGoods50004);
            }
            
// Disable the player's actions (he cannot move anymore)
            
TogglePlayerControllable(playerid0);
            
// Start a timer (Public function "LoadUnload(playerid)" gets called when the timer runs out)
            
APlayerData[playerid][LoadingTimer] = SetTimerEx("Trucker_LoadUnload"5000false"d" playerid);
        }
        else
            
SendClientMessage(playerid0xFFFFFFFFTXT_NeedTrailerToProceed);
    }
    else
        
SendClientMessage(playerid0xFFFFFFFFTXT_NeedVehicleToProceed);
    return 
1;

Reply
#2

I would create a bool called "isFrozen" and hook TogglePlayerControllable and set the variable to true or false depending on action your doing, then use OnPlayerUpdate to check if the "isFrozen" is true for the player and then punish them.

If you use TogglePlayerControllable, they should not be able to move, so if they do while being frozen, then they are 100% using a cheat, however please be aware of ping / packet loss the player may receive, so make sure you add a delay and you check they are not desynced.

Checks:

- Freeze Player ( If you hooked TogglePlayerControllable, then IsFrozen should be true )
- Is Moving? ( Using OnPlayerUpdate check if IsFrozen[ playerid ] is true and are they moving )
- Is Desynced? ( Create a new variable to hold the times the player has moved and increment it, if it goes over 5 or so desync them and kick them from server )
- Not Desynced? ( So they are not desynced and they are moving, I would suggest warning admins or if your perfectly sure you have tested this approach then ban them. )

I have not tested this myself, I have a similar system myself, however I did my system in C++ 3 years ago, so I can't confirm whether this approach is 100% accurate, I may have missed something vital. I would suggest you do some research and testing.
Reply
#3

Check my post in this topic for anti unfreeze: https://sampforum.blast.hk/showthread.php?tid=628714
Reply
#4

You should check which checkpoint they are entering, as obviously you're not checking which checkpoint they are entering, you are only checking that they entered "a" checkpoint.

More checks will solve this, and you'd also be able to highlight those who are indeed hacking so you can ban them in this same instance.


By doing this, you don't even need to do anti-freeze checks, as it will become obvious when they start doing the same trick again.

Don't ban them in the first instance, amass a list of players who are exploiting, and later in the week, ban them all, stating the reason as them exploiting, and hacking... If you ban one, they'll tell the rest that they got banned and for what, and then the rest will stop.

Ban them all, not just the unlucky first ones when you fix this.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)