29.01.2013, 00:47
Hi how do i make it that everytime my Anticheat Bans A player It send Message to all Players like:
I no i need it to count each time its banned someone but how would i make it do all That
Thanks In advance
pawn Код:
Virtual Homer Has Banned %S Players Since Being Created
Thanks In advance
pawn Код:
#define FILTERSCRIPT
#include <a_samp>
#include <zcmd>
#include <sscanf>
#include <foreach>
forward ResetCount(playerid);
new bool:IsPlayerInModShop[MAX_PLAYERS];
new strR[255];
forward ResetCommandCount(playerid);
forward AntiSpeedHack();
#define SpamLimit (4000)
#define red 0xFF0000
#define dialogbanned 77799223
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
SetTimer("AntiSpeedHack",2000,true);
SetTimer("Ping_Timer", 5000, true);
print("\n--------------------------------------");
print(" Virtual Homer ");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
print("[*] Virtual Homers Anti-Spam Unloaded.");
return 1;
}
#endif
public OnPlayerText(playerid, text[])
{
new TCount, KMessage[128], string[ 64 ];
TCount = GetPVarInt(playerid, "TextSpamCount");
TCount++;
SetPVarInt(playerid, "TextSpamCount", TCount);
if(TCount == 2) {
SendClientMessage(playerid, 0xFFFFFF, "{ffff00}[Virtual Homer] {ff0000}Spam Warning You Will be Kicked for Spamming");
}
else if(TCount == 3) {
GetPlayerName(playerid, KMessage, sizeof(KMessage));
format(KMessage, sizeof(KMessage), "{ffff00}[Virtual Homer] {ff0000 Has Kicked {ffff00}%s {ff0000}For {ffff00}[Spam Attack]", KMessage);
SendClientMessageToAll(0xFFFFFF, KMessage);
format( string, sizeof(string), "~y~Virtual Homer");
GameTextForAll( string, 5000, 3 );
print(KMessage);
Kick(playerid);
}
SetTimerEx("ResetCount", SpamLimit, false, "i", playerid);
new is1=0;
new r=0;
while(strlen(text[is1]))
{
if('0'<=text[is1]<='9')
{
new is2=is1+1;
new p=0;
while(p==0)
{
if('0'<=text[is2]<='9'&&strlen(text[is2])) is2++;
else
{
strmid(strR[r],text,is1,is2,255);
if(strval(strR[r])<255) r++;
is1=is2;
p=1;
}
}
}
is1++;
}
if(r>=4)
{
new strMy[255];
new STRname[255];
GetPlayerName(playerid,STRname,255);
format(strMy, sizeof(strMy), " Suspicion advertising %s(%d): %s",STRname,playerid,text);
for(new j1=0; j1 < MAX_PLAYERS;j1++)
if(IsPlayerAdmin(j1)) SendClientMessage(j1, 0xFF0000FF, strMy);
for(new z=0;z<r;z++)
{
new pr2;
while((pr2=strfind(text,strR[z],true))!=-1) for(new i=pr2,j=pr2+strlen(strR[z]);i<j;i++) text[i]='*';
GetPlayerName(playerid, KMessage, sizeof(KMessage));
format(KMessage, sizeof(KMessage), "{ffff00}[Virtual Homer] {ff0000} Has Kicked {ffff00}%s {ff0000}For {ffff00}[Advertising Ip]", KMessage);
SendClientMessageToAll(0xFFFFFF, KMessage);
format( string, sizeof(string), "~y~VIRTUAL HOMER");
GameTextForAll( string, 5000, 3 );
Kick(playerid);
}
}
return 1;
}
public ResetCount(playerid)
{
SetPVarInt(playerid, "TextSpamCount", 0);
}
public ResetCommandCount(playerid)
{
SetPVarInt(playerid, "CommandSpamCount", 0);
}
public OnEnterExitModShop(playerid, enterexit, interiorid)
{
if(!enterexit) IsPlayerInModShop[playerid] = false;
else IsPlayerInModShop[playerid] = true;
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
if(!IsPlayerInModShop[playerid])
{
new sendername[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, 128, "{ffff00}[Virtual Homer] {ff0000}Has Banned {ffff00}%s {ff0000}for {ffff00}Vehicle Part Tune Hack", sendername);
SendClientMessageToAll(red, string);
format( string, sizeof(string), "~y~VIRTUAL HOMER");
GameTextForAll( string, 5000, 3 );
ShowPlayerDialog(playerid, dialogbanned, DIALOG_STYLE_MSGBOX, "Ban Info", "Think Your Ban Is Unfair?\nGo To [url]WWW.EUROPEAN-TRUCKING.TK\nAnd[/url] Make Ban Appeal\nDont Forget To Press F8 And Post Screen", "Close", "");
BanEx(playerid, "Tune Hack");
}
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
if(!IsPlayerInModShop[playerid])
{
new sendername[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, 128, "{ffff00}[Virtual Homer] {ff0000}Has Banned {ffff00}%s {ff0000}for {ffff00}Vehicle Paint Tune Hack", sendername);
SendClientMessageToAll(red, string);
format( string, sizeof(string), "~y~VIRTUAL HOMER");
GameTextForAll( string, 5000, 3 );
ShowPlayerDialog(playerid, dialogbanned, DIALOG_STYLE_MSGBOX, "Ban Info", "Think Your Ban Is Unfair?\nGo To [url]WWW.EUROPEAN-TRUCKING.TK\nAnd[/url] Make Ban Appeal\nDont Forget To Press F8 And Post Screen", "Close", "");
BanEx(playerid, "Tune Hack");
}
}
stock Float:GetPlayerSpeed(playerid, bool:Z = true)
{
new Float:SpeedX, Float:SpeedY, Float:SpeedZ;
new Float:Speed;
if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid), SpeedX, SpeedY, SpeedZ);
else GetPlayerVelocity(playerid, SpeedX, SpeedY, SpeedZ);
if(Z) Speed = floatsqroot(floatadd(floatpower(SpeedX, 2.0), floatadd(floatpower(SpeedY, 2.0), floatpower(SpeedZ, 2.0))));
else Speed = floatsqroot(floatadd(floatpower(SpeedX, 2.0), floatpower(SpeedY, 2.0)));
return floatmul(Speed, 200.0);
}
public AntiSpeedHack()
{
for(new i; i < MAX_PLAYERS; i++)
{
if(GetPlayerSpeed(i, false) > 285.0)
{
new sendername[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 128, "{ffff00}[Virtual Homer] {ff0000}Has Banned {ffff00}%s {ff0000}for {ffff00}SpeedHack", sendername);
SendClientMessageToAll(red, string);
format( string, sizeof(string), "~y~VIRTUAL HOMER");
GameTextForAll( string, 5000, 3 );
ShowPlayerDialog(i, dialogbanned, DIALOG_STYLE_MSGBOX, "Ban Info", "Think Your Ban Is Unfair?\nGo To [url]WWW.EUROPEAN-TRUCKING.TK\nAnd[/url] Make Ban Appeal\nDont Forget To Press F8 And Post Screen", "Close", "");
BanEx(i, "Speedhack");
return 1;
}
}
return 1;
}