Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Anti speed hack - optimizing

$
0
0
Hi, I did something about anti cheat seems to not optimized. Could someone help me?

Code:

#include <a_samp>

forward OnPlayerSpeedHack(playerid);

public OnPlayerUpdate(playerid)
{
        SetTimerEx("OnPlayerSpeedHack", 100, true, "i", playerid);
        return 1;
}

public OnPlayerSpeedHack(playerid){

        if(GetVehicleSpeed(GetPlayerVehicleID(playerid)) > 500){// 500 olan yer hz limitidir kendinize göre ayarlayabilirsiniz.
        new string[128], pName[24];
        GetPlayerName(playerid, pName, 24);
        format(string, 128, "%s Sunucudan Atıldı [Sebep: Speed Hack]", pName);
        SendClientMessageToAll(0xF60000AA, string);
        Kick(playerid);
        }
        return true;
}
stock GetVehicleSpeed(vehicleid)
{
    new Float:xPos[3];
    GetVehicleVelocity(vehicleid, xPos[0], xPos[1], xPos[2]);
    return floatround(floatsqroot(xPos[0] * xPos[0] + xPos[1] * xPos[1] + xPos[2] * xPos[2]) * 170.00);
}


Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>