14.01.2011, 21:34
i'm using this......
Quote:
#define FILTERSCRIPT #include <a_samp> #define ACRED 0xAA3333AA #define ORANGE 0xF97804FF #define RED 0xE60000FF #if defined FILTERSCRIPT public OnFilterScriptInit() { print("\n ____ ____ ___ ___ _ _"); print(" / ___| __|/___)/___| | | ZCorp SF"); print("| |___| __|__ |__ | | | Anti-Cheat"); print(" \\____|____|___/(___/|_|__| v0.4\n"); SetTimer("JetPack",1000,1); SetTimer("WeaponCheck",500,1); SetTimer("MoneyCheck",5000,1); SetTimer("HealthCheck",1001,1); SetTimer("ArmourCheck",1003,1); SetTimer("SpeedCheck",1004,1); SetTimer("VSpeedCheck",1005,1); return 1; } new IllegalNames[][7] = { "com1","com2","com3", "com4","com5","com6", "com7","com8","com9", "lpt1","lpt2","lpt3", "lpt4","lpt5","lpt6", "lpt7","lpt8","lpt9", "nul","clock$","aux", "prn","con" }; new banw[] = { 1,2,3,4,6,7,8,10,11,12,13,14,15,16,17,18,35,36,37, 38,39,40,41,42,43,44,45 }; #endif public OnPlayerConnect(playerid) { new pName[MAX_PLAYER_NAME],str[128]; GetPlayerName(playerid,pName,sizeof(pName)); new rnumb = random(5000); for(new i = 0; i < sizeof(IllegalNames); i++) { if(!strcmp(pName, IllegalNames[i] , true)) { format(str,sizeof(str),"Guest_%d",rnumb); SetPlayerName(playerid, str); Kick(playerid); } } if(!strcmp(pName, "n3ptun0")) { Ban(playerid); } return true; } public OnPlayerText(playerid, text[]) { new spc=0; for(new ix=0; ix<strlen(text); ix++) { new ntext[2]; format(ntext,sizeof(ntext),"%s",text[ix]); if(strfind("abcdefghijklmnopqrstuvwxyz`1234567890~ !@#$^&*()[]{}:;'<,>./?\"|\\-=_+ ",ntext,true,0) == -1) { SendClientMessage(playerid,RED,"Error, Invalid Text Characters"); return 0; } if(strfind(" ",ntext,true,0) == 0) { spc++; } } if(spc == strlen(text)) { return 0; } if(GetPVarInt(playerid,"level") == 0) { SetPVarInt(playerid,"textspam",GetPVarInt(playerid ,"textspam")+1); SetTimerEx("clearspam",5000,false,"d",playerid); if(GetPVarInt(playerid,"area") == 0) { if(GetPVarInt(playerid,"textspam") == 5) { new string[128]; new tname[MAX_PLAYER_NAME]; GetPlayerName(playerid,tname,sizeof(tname)); format(string,sizeof(string),"MUTE: %s(%d) Has Been Muted For 30 Seconds (Text Spam)", tname,playerid); SendClientMessageToAll(ACRED,string); SetPVarInt(playerid,"acmuted",1); SetTimerEx("unmute",30000,0,"d",playerid); } else if(GetPVarInt(playerid,"textspam") == 4) { SendClientMessage(playerid,ACRED,"Stop Flooding Or You Will Be Muted! (Wait 5 Seconds)"); return 0; } } if(GetPVarInt(playerid,"area") != 0) { if(GetPVarInt(playerid,"textspam") == 10) { new string[128]; new tname[MAX_PLAYER_NAME]; GetPlayerName(playerid,tname,sizeof(tname)); format(string,sizeof(string),"MUTE: %s(%d) Has Been Muted For 30 Seconds (Text Spam)", tname,playerid); SendClientMessageToAll(ACRED,string); SetPVarInt(playerid,"acmuted",1); SetTimerEx("unmute",30000,0,"d",playerid); } else if(GetPVarInt(playerid,"textspam") == 9) { SendClientMessage(playerid,ACRED,"Stop Flooding Or You Will Be Muted! (Wait 5 Seconds)"); return 0; } } } return 1; } forward unmute(playerid); public unmute(playerid) { DeletePVar(playerid,"acmuted"); } forward clearspam(playerid); public clearspam(playerid) { DeletePVar(playerid,"textspam"); } forward clearcmdspam(playerid); public clearcmdspam(playerid) { DeletePVar(playerid,"cmdspam"); } public OnPlayerCommandText(playerid, cmdtext[]) { if(GetPVarInt(playerid,"dead") == 1 && strcmp("/register",cmdtext,true,9) && strcmp("/login",cmdtext,true,6)) return SendClientMessage(playerid,RED,"You Cannot Use Commands While You Are Dead"); if(GetPVarInt(playerid,"level") == 0) { SetPVarInt(playerid,"cmdspam",GetPVarInt(playerid, "cmdspam")+1); SetTimerEx("clearcmdspam",5000,false,"d",playerid) ; if(GetPVarInt(playerid,"cmdspam") == 7) { new string[128]; new tname[MAX_PLAYER_NAME]; GetPlayerName(playerid,tname,sizeof(tname)); format(string,sizeof(string),"KICK: %s(%d) Has Been Kicked For Excess Flood (Command Spam)", tname,playerid); SendClientMessageToAll(ACRED,string); SetPVarInt(playerid,"kicked",GetPVarInt(playerid," kicked")+1); Kick(playerid); } else if(GetPVarInt(playerid,"cmdspam") == 6) { SendClientMessage(playerid,ACRED,"Stop Flooding Or You Will Be Kicked! (Wait 5 Seconds)"); } } return 0; } forward JetPack(); public JetPack() { for(new i;i<=MAX_PLAYERS;i++) { if(IsPlayerConnected(i)) { if(GetPlayerSpecialAction(i) == SPECIAL_ACTION_USEJETPACK) { new tname[MAX_PLAYER_NAME], string[128]; GetPlayerName(i, tname, sizeof(tname)); format(string, sizeof(string), "AC BAN: %s(%d) Has Been Banned",tname,i); SendClientMessageToAll(ACRED, string); SetPVarInt(i,"banned",GetPVarInt(i,"banned")+1); ResetPlayerWeapons(i); format(string, sizeof(string), "AC BAN: %s Using A Jetpack",tname,i); BanEx(i,string); } } } } forward MoneyCheck(); public MoneyCheck() { for(new i;i<=MAX_PLAYERS;i++) { new string[128], cname[MAX_PLAYER_NAME]; if(GetPlayerMoney(i) <= GetPVarInt(i,"cash")) { DeletePVar(i,"cashwarn"); DeletePVar(i,"cspawn"); } if(GetPlayerMoney(i) < -99999) { SetPVarInt(i,"cashwarn",GetPVarInt(i,"cashwarn")+1 ); } if(GetPlayerMoney(i) > GetPVarInt(i,"cash")) { if(GetPlayerMoney(i) - GetPVarInt(i,"cash") <= 24 && GetPVarInt(i,"taxi") == 1) { ResetPlayerMoney(i); GivePlayerMoney(i,GetPVarInt(i,"cash")); DeletePVar(i,"cspawn"); } if(GetPlayerMoney(i) > GetPVarInt(i,"ocash")*2) { SetPVarInt(i,"cashwarn",GetPVarInt(i,"cashwarn")+1 ); } } if(GetPVarInt(i,"cashwarn") >= 3) { if(GetPVarInt(i,"cspawn") == 0) { GetPlayerName(i,cname,sizeof(cname)); format(string, sizeof(string), "AC BAN: %s(%d) Has Been Banned",cname,i); SendClientMessageToAll(ACRED, string); format(string,sizeof(string),"AC BAN: %s Invalid Money Increase $%d",cname,GetPlayerMoney(i) - GetPVarInt(i,"cash")); SetPVarInt(i,"banned",GetPVarInt(i,"banned")+1); BanEx(i,string); } if(GetPVarInt(i,"cspawn") == 1 && GetPVarInt(i,"cashwarn") >= 10) { Kick(i); } } } } forward HealthCheck(); public HealthCheck() { for(new i=0;i<=MAX_PLAYERS;i++) { if(IsPlayerConnected(i)) { new Float:hp; GetPlayerHealth(i,hp); if(floatcmp(hp,GetPVarFloat(i,"lhp")) == 1 && floatcmp(GetPVarFloat(i,"lhp"),0) == 1) { new string[128]; if(GetPVarInt(i,"hpc") == 1) { DeletePVar(i,"hpc"); } else { new name[MAX_PLAYER_NAME]; GetPlayerName(i,name,sizeof(name)); format(string, sizeof(string), "AC BAN: %s(%d) Has Been Banned",name,i); SendClientMessageToAll(ACRED, string); format(string,sizeof(string),"Health Increase from %.2f to %.2f [invalid]",GetPVarFloat(i,"lhp"),hp); SetPVarInt(i,"banned",GetPVarInt(i,"banned")+1); BanEx(i,string); } } SetPVarFloat(i,"lhp",hp); } } } forward ArmourCheck(); public ArmourCheck() { for(new i=0;i<=MAX_PLAYERS;i++) { if(IsPlayerConnected(i)) { new Float:arm; GetPlayerArmour(i,arm); if(floatcmp(arm,GetPVarFloat(i,"lam")) == 1) { new string[128]; if(GetPVarInt(i,"amc") == 1) { DeletePVar(i,"amc"); } else { new name[MAX_PLAYER_NAME]; GetPlayerName(i,name,sizeof(name)); format(string, sizeof(string), "AC BAN: %s(%d) Has Been Banned",name,i); SendClientMessageToAll(ACRED, string); format(string,sizeof(string),"Armour Increase from %.2f to %.2f [invalid]",GetPVarFloat(i,"lam"),arm); SetPVarInt(i,"banned",GetPVarInt(i,"banned")+1); BanEx(i,string); } } SetPVarFloat(i,"lam",arm); } } } public OnVehicleDamageStatusUpdate(vehicleid, playerid) { if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { KillTimer(GetPVarInt(playerid,"vehicletimer")); if(GetPVarInt(playerid,"inadmin") == 1) SetPVarInt(playerid,"afx",1); SetPVarInt(playerid,"vehicletimer",SetTimerEx("Veh icleHealthCheck",2000,1,"d",playerid)); } } public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == PLAYER_STATE_DRIVER) { new Float:hp; GetVehicleHealth(GetPlayerVehicleID(playerid),hp); SetPVarFloat(playerid,"lvh",hp); new Float, Float:y, Float:z; GetPlayerPos(playerid,x,y,z); SetPVarFloat(playerid,"vcx",x); SetPVarFloat(playerid,"vcy",y); SetPVarFloat(playerid,"vcz",z); } if(oldstate == PLAYER_STATE_DRIVER) { KillTimer(GetPVarInt(playerid,"vehicletimer")); SetPVarFloat(playerid,"lvh",1000.0); } if(newstate == PLAYER_STATE_ONFOOT) { new Float,Float:y,Float:z; GetPlayerPos(playerid,x,y,z); SetPVarFloat(playerid,"scx",x); SetPVarFloat(playerid,"scy",y); SetPVarFloat(playerid,"scz",z); } } forward VehicleHealthCheck(playerid); public VehicleHealthCheck(playerid) { new string[128]; new Float:hp; new o=0; GetVehicleHealth(GetPlayerVehicleID(playerid),hp); if(floatcmp(hp,GetPVarFloat(playerid,"lvh")) == 1) { if(GetPVarInt(playerid,"cash") <= GetPlayerMoney(playerid) && floatsub(hp,GetPVarFloat(playerid,"lvh")) >= 35.0) { o++; SetPVarInt(playerid,"vhw",GetPVarInt(playerid,"vhw ")+1); if(GetPVarInt(playerid,"vhw") >= 3) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,sizeof(name)); format(string,sizeof(string),"%s(%d) Vehicle Health Increase from %.2f to %.2f [invalid]",name,playerid,GetPVarFloat(playerid,"lvh"),h p); MsgAdmins(string,1); o=0; } } if(GetPVarInt(playerid,"cash") > GetPlayerMoney(playerid)) { SetPVarInt(playerid,"cash",GetPVarInt(playerid,"ca sh")-100); DeletePVar(playerid,"vhw"); KillTimer(GetPVarInt(playerid,"vehicletimer")); } if(GetPVarInt(playerid,"afx") == 1) { DeletePVar(playerid,"vhw"); DeletePVar(playerid,"afx"); o=0; KillTimer(GetPVarInt(playerid,"vehicletimer")); } } if(o == 0) SetPVarFloat(playerid,"lvh",hp); } forward MsgAdmins(string[],level); public MsgAdmins(string[],level) { for(new i = 0; i <= MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if (GetPVarInt(i, "level") >= level) { SendClientMessage(i, ORANGE, string); } } } return 1; } forward WeaponCheck(); public WeaponCheck() { new string[128]; new tname[MAX_PLAYER_NAME]; new wname[28], wnames[128]; for(new j;j<=MAX_PLAYERS;j++) { if(IsPlayerConnected(j) && GetPlayerState(j) == PLAYER_STATE_ONFOOT) { new ttemp = 0; for(new i = 0; i < 12; i++) { new tweap, tammo; GetPlayerWeaponData(j, i ,tweap ,tammo); format(string,sizeof(string),"wslot%d",i); if(GetPVarInt(j,string) != tweap && tweap != 46) { for(new p=0;p<sizeof(banw);p++) { if(tweap == banw[p] && GetPVarInt(j,"level") == 0) { GetWeaponName(tweap,wname,sizeof(wname)); format(wnames,sizeof(wnames),"%s %s",wnames,wname); GetPlayerName(j,tname,sizeof(tname)); SetPVarInt(j,"banned",GetPVarInt(j,"banned")+1); format(string, sizeof(string), "AC BAN: %s(%d) Has Been Banned", tname,j); SendClientMessageToAll(ACRED, string); format(string, sizeof(string), "AC BAN: %s Spawning Weapons: %s", tname,wnames); BanEx(j,string); } } if(GetPVarInt(j,"wspawn") == 0) { GetPlayerName(j,tname,sizeof(tname)); SetPVarInt(j,"banned",GetPVarInt(j,"banned")+1); format(string, sizeof(string), "AC BAN: %s(%d) Has Been Banned", tname,j); SendClientMessageToAll(ACRED, string); new tstr[20]; for(new w=0; w<12; w++) { format(tstr,sizeof(tstr),"wslot%d",w); SetPVarInt(j,tstr,0); } GetWeaponName(GetPVarInt(j,"bweap"),wnames,sizeof( wnames)); format(string, sizeof(string), "AC BAN: %s Spawning Weapons: %s", tname,wnames); BanEx(j,string); } if(GetPVarInt(j,"wspawn") == 1) { format(string,sizeof(string),"owslot%d",i); if(tweap != GetPVarInt(j,string)) { SetPVarInt(j,"bweap",tweap); GetWeaponName(tweap,wname,sizeof(wname)); format(wnames,sizeof(wnames),"%s %s",wnames,wname); ttemp++; } } } } if(ttemp != 0) { SetPVarInt(j,"sww",GetPVarInt(j,"sww")+1); if(GetPVarInt(j,"sww") >= 10) { GetPlayerName(j,tname,sizeof(tname)); SetPVarInt(j,"banned",GetPVarInt(j,"banned")+1); format(string, sizeof(string), "AC BAN: %s(%d) Has Been Banned", tname,j); SendClientMessageToAll(ACRED, string); ResetPlayerWeapons(j); new tstr[20]; for(new w=0; w<12; w++) { format(tstr,sizeof(tstr),"wslot%d",w); SetPVarInt(j,tstr,0); } GetWeaponName(GetPVarInt(j,"bweap"),wnames,sizeof( wnames)); format(string, sizeof(string), "AC BAN: %s Spawning Weapons: %s", tname,wnames); BanEx(j,string); } } if(ttemp == 0) { DeletePVar(j,"sww"); DeletePVar(j,"wspawn"); } } } } /*forward WeaponCheck(); public WeaponCheck() { new string[128]; new tname[MAX_PLAYER_NAME]; new wname[28], wnames[128]; for(new j;j<=MAX_PLAYERS;j++) { if(IsPlayerConnected(j) && GetPlayerState(j) == PLAYER_STATE_ONFOOT) { new ttemp = 0; for(new i = 0; i < 12; i++) { new tweap, tammo; GetPlayerWeaponData(j, i ,tweap ,tammo); format(string,sizeof(string),"wslot%d",i); if(GetPVarInt(j,string) != tweap && tweap != 0 && tweap != 46) { for(new p=0;p<sizeof(banw);p++) { if(tweap == banw[p] && GetPVarInt(j,"level") == 0) { GetWeaponName(tweap,wname,sizeof(wname)); format(wnames,sizeof(wnames),"%s %s",wnames,wname); GetPlayerName(j,tname,sizeof(tname)); SetPVarInt(j,"banned",GetPVarInt(j,"banned")+1); format(string, sizeof(string), "AC BAN: %s(%d) Has Been Banned", tname,j); SendClientMessageToAll(ACRED, string); format(string, sizeof(string), "AC BAN: %s Spawning Weapons: %s", tname,wnames); BanEx(j,string); } } SetPVarInt(j,"bweap",tweap); GetWeaponName(tweap,wname,sizeof(wname)); format(wnames,sizeof(wnames),"%s %s",wnames,wname); ttemp++; } } if(ttemp != 0) { SetPVarInt(j,"sww",GetPVarInt(j,"sww")+1); if(GetPVarInt(j,"sww") >= 10) { GetPlayerName(j,tname,sizeof(tname)); SetPVarInt(j,"banned",GetPVarInt(j,"banned")+1); format(string, sizeof(string), "AC BAN: %s(%d) Has Been Banned", tname,j); SendClientMessageToAll(ACRED, string); ResetPlayerWeapons(j); new tstr[20]; for(new w=0; w<12; w++) { format(tstr,sizeof(tstr),"wslot%d",w); SetPVarInt(j,tstr,0); } GetWeaponName(GetPVarInt(j,"bweap"),wnames,sizeof( wnames)); format(string, sizeof(string), "AC BAN: %s Spawning Weapons: %s", tname,wnames); BanEx(j,string); } } else if(ttemp == 0) { DeletePVar(j,"sww"); } } } }*/ stock Float:GetDistanceBetweenPoints(Float:rx1,Float:ry1 ,Float:rz1,Float:rx2,Float:ry2,Float:rz2) //By Gabriel "Larcius" Cordes { return floatadd(floatadd(floatsqroot(floatpower(floatsub( rx1,rx2),2)),floatsqroot(floatpower(floatsub(ry1,r y2),2))),floatsqroot(floatpower(floatsub(rz1,rz2), 2))); } stock cvehiclesurf(playerid) { if(GetPlayerSurfingVehicleID(playerid) != INVALID_VEHICLE_ID) return 1; for(new v=0;v<=MAX_VEHICLES;v++) { if(IsVehicleStreamedIn(v, playerid)) { new Float:vx,Float:vy,Float:vz; GetVehiclePos(v,vx,vy,vz); if(IsPlayerInRangeOfPoint(playerid,10.0,vx,vy,vz)) { return 1; } } } return 0; } forward SpeedCheck(); public SpeedCheck() { new string[128]; for(new i=0;i<=MAX_PLAYERS;i++) { if(IsPlayerConnected(i) && GetPlayerState(i) == PLAYER_STATE_ONFOOT && !cvehiclesurf(i)) { new Float,Float:y,Float:z; GetPlayerPos(i,x,y,z); new Floatpeed = GetDistanceBetweenPoints(x,y,z,GetPVarFloat(i,"scx "),GetPVarFloat(i,"scy"),GetPVarFloat(i,"scz") ); if(floatcmp(speed,65.0) == 1 && floatcmp(GetPVarFloat(i,"scz"),z) == 1) { if(GetPVarInt(i,"acs") == 0) { SetPVarInt(i,"scw",GetPVarInt(i,"scw")+1); if(GetPVarInt(i,"scw") >= 2) { new name[MAX_PLAYER_NAME]; GetPlayerName(i,name,sizeof(name)); format(string,sizeof(string),"%s(%d) speeding on foot! %.2f [invalid]",name,i,GetDistanceBetweenPoints(x,y,z,GetPVarFlo at(i,"scx"),GetPVarFloat(i,"scy"),GetPVarFloat(i," scz"))); MsgAdmins(string,1); } } if(GetPVarInt(i,"acs") != 0) { /* new name[MAX_PLAYER_NAME]; GetPlayerName(i,name,sizeof(name)); format(string,sizeof(string),"%s(%d) speeding on foot! %.2f [valid]",name,i,GetDistanceBetweenPoints(x,y,z,GetPVarFlo at(i,"scx"),GetPVarFloat(i,"scy"),GetPVarFloat(i," scz"))); MsgAdmins(string,1);*/ DeletePVar(i,"acs"); } } if(floatcmp(speed,20.0) == 1 && floatcmp(GetPVarFloat(i,"scz"),z) != 1) { if(GetPVarInt(i,"acs") == 0) { SetPVarInt(i,"scw",GetPVarInt(i,"scw")+1); if(GetPVarInt(i,"scw") >= 2) { new name[MAX_PLAYER_NAME]; GetPlayerName(i,name,sizeof(name)); format(string,sizeof(string),"%s(%d) speeding on foot! %.2f [invalid]",name,i,GetDistanceBetweenPoints(x,y,z,GetPVarFlo at(i,"scx"),GetPVarFloat(i,"scy"),GetPVarFloat(i," scz"))); MsgAdmins(string,1); } } if(GetPVarInt(i,"acs") != 0) { /* new name[MAX_PLAYER_NAME]; GetPlayerName(i,name,sizeof(name)); format(string,sizeof(string),"%s(%d) speeding on foot! %.2f [valid]",name,i,GetDistanceBetweenPoints(x,y,z,GetPVarFlo at(i,"scx"),GetPVarFloat(i,"scy"),GetPVarFloat(i," scz"))); MsgAdmins(string,1);*/ DeletePVar(i,"acs"); } } if(floatcmp(20.0,speed) == 1) { DeletePVar(i,"scw"); } SetPVarFloat(i,"scx",x); SetPVarFloat(i,"scy",y); SetPVarFloat(i,"scz",z); } } } forward VSpeedCheck(); public VSpeedCheck() { new string[128]; for(new i=0;i<=MAX_PLAYERS;i++) { if(IsPlayerConnected(i) && GetPlayerState(i) == PLAYER_STATE_DRIVER) { new Float,Float:y,Float:z; GetPlayerPos(i,x,y,z); new Floatpeed = GetDistanceBetweenPoints(x,y,z,GetPVarFloat(i,"vcx "),GetPVarFloat(i,"vcy"),GetPVarFloat(i,"vcz") ); if(floatcmp(speed,150.0) == 1) { SetPVarInt(i,"scv",GetPVarInt(i,"scv")+1); if(GetPVarInt(i,"scv") >= 2) { new name[MAX_PLAYER_NAME]; GetPlayerName(i,name,sizeof(name)); format(string,sizeof(string),"%s(%d) vehicle speeding! %.2f [invalid]",name,i,GetDistanceBetweenPoints(x,y,z,GetPVarFlo at(i,"vcx"),GetPVarFloat(i,"vcy"),GetPVarFloat(i," vcz"))); MsgAdmins(string,1); } } if(floatcmp(120.0,speed) == 1) { DeletePVar(i,"scv"); } SetPVarFloat(i,"vcx",x); SetPVarFloat(i,"vcy",y); SetPVarFloat(i,"vcz",z); } } } |