#include <a_samp>
#define di_1 0
new db[MAX_PLAYERS]=0;
forward cheatupdate(playerid);
new bool:robot[MAX_PLAYERS]=true;
new bekapcsolta=2;
public OnFilterScriptInit(){
SetTimer(\"cheatupdate\", 5000, true);
bekapcsolta=1;
return 1;
}
public OnPlayerDisconnect(playerid, reason){
db[playerid]=0;
return 1;
}
public OnPlayerSpawn(playerid){
TogglePlayerControllable(playerid, false);
SetTimerEx(\"skoff\", 3000, 0,\"i\",playerid);
GameTextForPlayer(playerid, \"~r~SK ~b~V¾delem\", 3000,6);
return 1;
}
public OnPlayerConnect(playerid){
robot[playerid]=true;
if(bekapcsolta==1){
SendClientMessage(playerid, 0xFFFFFFAA, \"AntiCheat/AntiDB rendszer bekapcsolva (Státusz: Robot pilóta) /ainfo\");
robot[playerid]=true;
}else{
SendClientMessage(playerid, 0xFFFFFFAA, \"AntiCheat/AntiDB rendszer bekapcsolva (Státusz: Kézi vezérlés) /ainfo\");
robot[playerid]=false;
}
return 1;
}
forward skoff(playerid);
public skoff(playerid){
TogglePlayerControllable(playerid, true);
GameTextForPlayer(playerid, \"~r~Jo ~b~Jat¾kot\", 3000,6);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason){
if(IsPlayerInAnyVehicle(killerid)){
new stat = GetPlayerState(killerid);
if(stat==PLAYER_STATE_DRIVER){
if(robot[playerid]==true){
new name[MAX_PLAYER_NAME];
GetPlayerName(killerid, name, sizeof(name));
new mes[128];
db[killerid]++;
format(mes,sizeof(mes),\"AntiCheat: %s figyelmeztetve lett DB miatt! %d/3\",name,db[killerid]);
SendClientMessageToAll( 0xFB0000FF,mes);
}else{
new report[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(report, sizeof(report), \"AntiCheat: %s [iD: %d] DB-zik!\",name,playerid);
MessageToAdmins(0xFFFFFFAA,report);
}
if(db[killerid]>=3){
Kick(killerid);
}
}
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[]){
if (strcmp(\"/robot\", cmdtext, true, 10) == 0){
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFFFFFFAA, \"Nem vagy rcon admin!\");
ShowPlayerDialog(playerid, di_1, DIALOG_STYLE_LIST, \"AntiCheat robot pilóta\",\"Bekapcsolás\\nKikapcsolás\",\"Kiválaszt\",\"Mégse\");
return 1;
}
if (strcmp(\"/ainfo\", cmdtext, true, 10) == 0){
ShowPlayerDialog(playerid, 3523, DIALOG_STYLE_MSGBOX, \"Antis Script by Mr.M[aa]rK\",\" Robot pilóta be/kikapcsolásához /robot\\n Scriptet készítette: Mr.M[aa]rK\\n www.sa-mp.gportal.hu\",\"Ok\",\"Mégse\");
return 1;
}
return 0;
}
public cheatupdate(playerid){
new fegyver = GetPlayerWeapon(playerid);
if(fegyver == 35 || fegyver == 36 || fegyver == 37 || fegyver == 38){
//if(IsPlayerAdmin(playerid)) return false;
if(robot[playerid]==true){
new str[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(str, sizeof(str), \"%s ki lett rúgva Cheat miatt! (Tiltott fegyverek)\",name);
SendClientMessageToAll(0xFFFFFFAA,str);
Kick(playerid);
}else{
new report[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(report, sizeof(report), \"AntiCheat: %s [iD: %d] valószínûleg Cheatel! (Tiltott fegyverek)\",name,playerid);
MessageToAdmins(0xFFFFFFAA,report);
}
}
new Float:health;
GetPlayerHealth(playerid, health);
if(health > 100.1){
if(IsPlayerAdmin(playerid)) return false;
if(robot[playerid]==true){
new str[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(str, sizeof(str), \"%s ki lett rúgva Cheat miatt! (GOD)\",name);
SendClientMessageToAll(0xFFFFFFAA,str);
Kick(playerid);
}else{
new report[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(report, sizeof(report), \"AntiCheat: %s [iD: %d] valószínûleg Cheatel! (GOD)\",name,playerid);
MessageToAdmins(0xFFFFFFAA,report);
}
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){
if(dialogid == di_1){
if(response == 1){
switch(listitem){
case 0:{
bekapcsolta=1;
SendClientMessageToAll(0x38FF06FF, \"AntiCheat: Robot pilóta bekapcsolva\");
for(new i = 0; i < MAX_PLAYERS; i++){
robot=true;
}
}
case 1:{
bekapcsolta=2;
SendClientMessageToAll(0x38FF06FF, \"AntiCheat: Robot pilóta kikapcsolva\");
for(new i = 0; i < MAX_PLAYERS; i++){
robot=false;
}
}
}
}
return 1;
}
return 0;
}
forward MessageToAdmins(color,const string[]);
public MessageToAdmins(color,const string[]){
for(new i = 0; i < MAX_PLAYERS; i++){
if(IsPlayerConnected(i) == 1){
if (IsPlayerAdmin(i)){
SendClientMessage(i, color, string);
}
}
}
return 1;
}