Hey,
habe leider immer noch Probleme beim Anti Money Hack. Er funktioniert, aber ich werde auch manchmal wenn ich meine alternative Geldgebefunktion benutze gebannt. Mir ist es nur aufgefallen wenn ich Geld verliere also mir quasi einen negativen Betrag gebe. Das kann ich mir garnicht verstehen weil ich eigentlich nur gebannt werden dürfte, wenn ich mehr Geld habe als der Server sagt. Hier meine Funktionen:
public GivePlayerMoneyEx(playerid,ammount)
{
SetPVarInt(playerid, "money", GetPVarInt(playerid,"money") + ammount);
GivePlayerMoney(playerid, ammount);
return 1;
}
public AntiCheat()
{
for(new playerid; playerid<MAX_PLAYERS; playerid++)
{
if(IsPlayerConnected(playerid))
{
if(GetPlayerMoney(playerid) > GetPVarInt(playerid, "money") )
{
ResetPlayerMoney(playerid);
new mbformat[128];
format(mbformat,sizeof(mbformat),"Anti Cheat has banned %s due to Money Hack",getPlayerName(playerid));
SendClientMessageToAll(COLOR_RED,mbformat);
new tbanIP[50];
GetPlayerIp(playerid,tbanIP,sizeof(tbanIP));
TimeBan("Anti Cheat",getPlayerName(playerid),"Money Hack",90,tbanIP);
banTimer[playerid] = SetTimerEx("KickIT",500,0,"%i",playerid);
}
if(PlayerSpawned[playerid] == 1 && sInfo[playerid][alevel] == 0)
{
new wep = GetPlayerWeapon(playerid);
if(wep==1||wep==2||wep==3||wep==4||wep==5||wep==6||wep==7||wep==8||wep==9||wep==10||wep==11||wep==12||wep==13||wep==14||wep==15||wep==16||wep==17||wep==18||wep==22||wep==23||wep==24||wep==25||wep==26||wep==27||wep==28||wep==29||wep==30||wep==31||wep==32||wep==33||wep==34||wep==35||wep==36||wep==37||wep==38||wep==39||wep==40||wep==41||wep==42||wep==43||wep==44||wep==45)
{
new tbanIP[50];
GetPlayerIp(playerid,tbanIP,sizeof(tbanIP));
TimeBan("Anti Cheat",getPlayerName(playerid),"Weapon Hack",90,tbanIP);
new cheat[250];
format(cheat,sizeof(cheat),"{FF9900}Anti Cheat {FFFFFF}has banned {FF9900}%s {FFFFFF}due to weapon hack.",getPlayerName(playerid));
SendClientMessage(playerid,COLOR_RED,cheat);
banTimer[playerid] = SetTimerEx("KickIT",500,0,"%i",playerid);
}
new Float:Armour;
GetPlayerArmour(playerid, Armour);
if(Armour > 0)
{
new tbanIP[50];
GetPlayerIp(playerid,tbanIP,sizeof(tbanIP));
TimeBan("Anti Cheat",getPlayerName(playerid),"Armour Hack",90,tbanIP);
new cheat[250];
format(cheat,sizeof(cheat),"{FF9900}Anti Cheat {FFFFFF}has banned {FF9900}%s {FFFFFF}due to armour hack.",getPlayerName(playerid));
SendClientMessage(playerid,COLOR_RED,cheat);
banTimer[playerid] = SetTimerEx("KickIT",500,0,"%i",playerid);
}
if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK)
{
new tbanIP[50];
GetPlayerIp(playerid,tbanIP,sizeof(tbanIP));
TimeBan("Anti Cheat",getPlayerName(playerid),"Jetpack Hack",90,tbanIP);
new cheat[250];
format(cheat,sizeof(cheat),"{FF9900}Anti Cheat {FFFFFF}has banned {FF9900}%s {FFFFFF}due to jetpack hack.",getPlayerName(playerid));
SendClientMessage(playerid,COLOR_RED,cheat);
banTimer[playerid] = SetTimerEx("KickIT",500,0,"%i",playerid);
}
if(IsPlayerInAnyVehicle(playerid))
{
new speed = floatround(GetVehicleSpeedEx(GetPlayerVehicleID(playerid),0));
if(speed>= 206){
new SpeedWarnString[250];
format(SpeedWarnString,sizeof(SpeedWarnString),"[SPEED WARNING]%s(%i) is going over 205MPH. Speed: %i MPH. Spectate him !",getPlayerName(playerid),playerid,speed);
SendAdminMessage(COLOR_RED,SpeedWarnString);
}
}
}
}
}
}
Und unter OnGameModeInit:
SetTimer("AntiCheat", 1000, true);
PS: Ich habe zur Sicherheit mal den ganzen Anti Cheat mit dazu gepackt.