how to show How many people been banned
#1

this is my anticheat what i wanna show is how many people have been banned off it

So like everytime 1 person gets banned it says virtual Homer has banned %s since being created

I no i use SendClientMessageToAll

pawn Код:
#define FILTERSCRIPT

#include <a_samp>
#include <zcmd>
#include <sscanf>

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);
   
    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, "{ff0000}[Virtual Homer] Spam Warning You Will be Kicked for Spamming");
    }
    else if(TCount == 3) {
        GetPlayerName(playerid, KMessage, sizeof(KMessage));
        format(KMessage, sizeof(KMessage), "{ff0000}[Virtual Homer] {ffff00} Has Kicked {ff0000}%s {ffff00}For {ff0000}[Spam Attack]", KMessage);
        SendClientMessageToAll(0xFFFFFF, KMessage);
        format( string, sizeof(string), "~r~kicked ~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), "{ff0000}[Virtual Homer] {ffff00} Has Kicked {ff0000}%s {ffff00}For {ff0000}[Advertising Ip]", KMessage);
            SendClientMessageToAll(0xFFFFFF, KMessage);
            format( string, sizeof(string), "~r~kicked ~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, "{ff0000}%s {00ff00}Has Been Banned by {ff0000}Virtual Homer {00ff00}for {ff0000}Vehicle Part Tune Hack", sendername);
        SendClientMessageToAll(red, string);
        format( string, sizeof(string), "~r~Banned ~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", "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, "{ff0000}%s {00ff00}Has Been Banned by {ff0000}Virtual Homer {00ff00}for {ff0000}Vehicle Paint Tune Hack", sendername);
        SendClientMessageToAll(red, string);
        format( string, sizeof(string), "~r~Banned ~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", "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, "{ff0000}%s {00ff00}Has Been Banned by {ff0000}Virtual Homer {00ff00}for {ff0000}SpeedHack", sendername);
            SendClientMessageToAll(red, string);
            format( string, sizeof(string), "~r~Banned ~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", "Close", "");
            BanEx(i, "Speedhack");
            return 1;
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)