25.06.2017, 11:20
Ok i have tried to make an anti speedhack and it works but i want it not to detect if the player is admin level 4 it should not detect the player if he/she is speed hacking but if there level is less than 4 it will detect and send the message to the online admins.
My coding:
My coding:
PHP код:
public OnPlayerUpdate(playerid)
{
if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new speed = GetVehicleSpeed(GetPlayerVehicleID(playerid), 0);
if(speed > 270 && GetVehicleModel(GetPlayerVehicleID(playerid)) != 519 && GetVehicleModel(GetPlayerVehicleID(playerid)) != 553 || speed > 300)
{
if(!IsPlayerAdmin(playerid) || pInfo[playerid][Admin] < 4)// if im not wrong this is saying if the player is not rcon or lower than level 4
{
new string[128];
format(string, sizeof(string), "Player %s(ID:%i) might be using speed hacks (%d MPH)", GetName(playerid),playerid, speed);
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
RemovePlayerFromVehicle(playerid);
SetPlayerPos(playerid, X, Y, Z+5);
SendToAdmins(orange, string);
}
}
}