SA-MP Forums Archive
Anti g abuse problem +REP - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Anti g abuse problem +REP (/showthread.php?tid=557248)



Anti g abuse problem +REP - Youssef221 - 13.01.2015

Why this anti g abuse makes the player don't enter the car if it has a driver, and when there are more than 1 player, and when someone attempt to g abuse (without a driver), the server freezes as hell.

under onplayerstatechange:
pawn Код:
if(GetPlayerVehicleSeat(playerid) > 0 && GetPlayerVehicleSeat(playerid) < 4)
    {
    foreach(Player, i)
    {
       i =! playerid;
       new msglimit[MAX_PLAYERS];
       if(!IsPlayerInVehicle(i, GetPlayerVehicleID(playerid)) || IsPlayerInVehicle(i, GetPlayerVehicleID(playerid)) && GetPlayerVehicleSeat(i) != 0)
       {
       msglimit[playerid] = 1;
       if(msglimit[playerid] == 1)
       {
       SendClientMessage(playerid, 0xFF0000AA, "Anti-Cheat (AC): Please Don't G Abuse!");
       GameTextForPlayer(playerid, "~r~Don't G Abuse!", 3000, 3);
       }
       RemovePlayerFromVehicle(playerid);
       msglimit[playerid] = 0;
       }
    }
    }
PLEASE HELP


Re: Anti g abuse problem +REP - ATGOggy - 13.01.2015

This is my anti-g abuse from:

On top:
PHP код:
new cardriver[MAX_VEHICLES]; 
On OnPlayerStateChange:
PHP код:
if(oldstate==PLAYER_STATE_ONFOOT && newstate==PLAYER_STATE_PASSENGER)
    {
        new 
vehicleid=GetPlayerVehicleID(playerid);
        if(
cardriver[vehicleid]==0)
        {
             
RemovePlayerFromVehicle(playerid);
             
SendClientMessage(playeridCOLOR_ORANGE"ERROR: There must be a driver to enter this vehicle as passenger.");
        }
    }
    if(
newstate==PLAYER_STATE_DRIVER)
    {
        
cardriver[GetPlayerVehicleID(playerid)]=1;
    } 
A personal question: Did you play in Relentless gaming roleplay?


Re: Anti g abuse problem +REP - Youssef221 - 13.01.2015

I don't play in any rp servers except PLA which i played once or twice, anyways, wait i am gonna try this


Re: Anti g abuse problem +REP - JonathanFeitosa - 13.01.2015

OnPlayerEnterVehicle: GetPlayerPos + SetPlayerPos.