public wepcheat(playerid) { new say1[MAX_PLAYERS],say2[MAX_PLAYERS]; for(new ii=0; ii<MAX_PLAYERS;ii++) { for(new i=1; i < 3; i++) { new asd[15]; format(asd,sizeof(asd),"[GUN%d]",i); if(USER[ii]asd!=0) { say1[ii]++; } } for(new aa=0; aa<12; aa++) { new wid,wam; GetPlayerWeaponData(ii,aa,wid,wam); if(wid!=0) { say2[ii]++; } } if(say1[ii]!=say2[ii]) { new rcontext[40],bantext[128]; format(bantext,sizeof(bantext),"ADMCMD-AUTOBAN: %s has been banned. Reason: Weapon hacks."); SendClientMessageToAll(COLOR_RED,bantext); format(rcontext,sizeof(rcontext),"ban %d",ii); SendRconCommand(rcontext); } } }
public wepcheat(playerid)
{
new say1[MAX_PLAYERS],say2[MAX_PLAYERS];
for(new ii=0; ii<MAX_PLAYERS;ii++)
{
for(new i=1; i < 3; i++)
{
new asd[15];
format(asd,sizeof(asd),"[GUN%d]",i);
if(USER[ii]asd!=0) // <- WRONG as asd is a string correct this
{
say1[ii]++;
}
}
for(new aa=0; aa<12; aa++)
{
new wid,wam;
GetPlayerWeaponData(ii,wid,wam);
if(wid!=0)
{
say2[ii]++;
}
}
if(say1[ii]!=say2[ii])
{
new rcontext[40],bantext[128];
format(bantext,sizeof(bantext),"ADMCMD-AUTOBAN: %s has been banned. Reason: Weapon hacks.");
SendClientMessageToAll(COLOR_RED,bantext);
format(rcontext,sizeof(rcontext),"ban %d",ii);
SendRconCommand(rcontext);
}
}
}
public wepcheat(playerid) { new say1[MAX_PLAYERS],say2[MAX_PLAYERS]; for(new ii=0; ii<MAX_PLAYERS;ii++) { if(USER[ii][GUN1]!=0) { say1[ii]++; } if(USER[ii][GUN2]!=0) { say1[ii]++; } if(USER[ii][GUN3]!=0) { say1[ii]++; } for(new aa=0; aa<12; aa++) { new wid,wam; GetPlayerWeaponData(ii,aa,wid,wam); if(wid!=0) { say2[ii]++; } } if(say1[ii]!=say2[ii]) { new rcontext[40],bantext[128]; format(bantext,sizeof(bantext),"ADMCMD-AUTOBAN: %s has been banned. Reason: Weapon hacks."); SendClientMessageToAll(COLOR_RED,bantext); format(rcontext,sizeof(rcontext),"ban %d",ii); SendRconCommand(rcontext); } } }
#define max_players 50
#define scm SendClientMessage
new UWeapon[max_players][13];
GetWeaponSlot(weaponid){
switch(weaponid){
case 1: return 0;
case 2..9: return 1;
case 22..24: return 2;
case 25..27: return 3;
case 28, 29, 32: return 4;
case 30, 31: return 5;
case 33, 34: return 6;
case 35..38: return 7;
case 16..18, 39: return 8;
case 41..43: return 9;
case 10..15: return 10;
case 44..46: return 11;
case 40: return 12;
}
return 0;
}
func Update3sec(){
new wid,wam;
foreach(Player,i){
for(new i2; i2 < 13; i2++){
GetPlayerWeaponData(i,i2,wid,wam);
if(wid && UWeapon[i][GetWeaponSlot(wid)]!=wid){
scm(i,-1,"STOP CHEATING WEAPONS!");
}
}
}
return 1;
}
Your anticheat doesnt even work.
PHP Code:
|