Anti Weapon Hack (heeeelppp)
#1

PHP код:
public WeaponCheck(playerid)
{
    for(new 
i=0;i<MAX_PLAYERS;i++)
    {
        new 
lbweapon[64];
        new 
string[128];
        new var;
        new 
PlayerName[MAX_PLAYER_NAME];
        
GetPlayerName(playeridPlayerNameMAX_PLAYER_NAME);
        var=
GetPlayerWeapon(i);
        if(
IsForbiddenWeapon(var) && WeaponForbiddenForPlayer[i][var] && AccInfo[i][Level] == && ServerInfo[ForbiddenWeaps] == 1)
        {
            
SendClientMessage(i,lightred"You have been Automatically Banned.  Reason: WeaponHack  ");
            
GetWeaponName(var,lbweapon,sizeof(lbweapon));
            
format(lbweapon,sizeof(lbweapon),"Weapon Cheat (%s)",lbweapon);
            
BanEx(i,lbweapon);
            
format(string,sizeof(string),"Player %s (Id:%d) has been Automatically Kicked.  Reason: Weapons ",PlayerName,i);
            
SendClientMessageToAll(lightredstring);
            new 
str[128];
            
format(str,sizeof(str),"%s has been Automatically Kicked. Reason: WeaponHack",PlayerName);
            
SaveIn("BanLog",str);
        }
    }
    return 
1;

how to make it when some1 get weapon kick him no ban
ban is not good D
look this "BanEx(i,lbweapon);" i change it to "KickEx" but again bans... + makes server crash..
and change it "SaveIn("BanLog",str);" to "SaveIn("KickLog",str);" but again dont works..
Some1 can help me how to change it to KICK?
(its from luxadmin)
Thanks...
Reply
#2

pawn Код:
public WeaponCheck(playerid)
{
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        new lbweapon[64];
        new string[128];
        new var;
        new PlayerName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);

        var=GetPlayerWeapon(i);
        if(IsForbiddenWeapon(var) && WeaponForbiddenForPlayer[i][var] && AccInfo[i][Level] == 0 && ServerInfo[ForbiddenWeaps] == 1)
        {
            SendClientMessage(i,lightred, "You have been Automatically Kicked.  Reason: WeaponHack  ");

            GetWeaponName(var,lbweapon,sizeof(lbweapon));

            format(string,sizeof(string),"Player %s (Id:%d) has been Automatically Kicked.  Reason: Weapons ",PlayerName,i);
            SendClientMessageToAll(lightred, string);

            new str[128];
            format(str,sizeof(str),"%s has been Automatically Kicked. Reason: WeaponHack",PlayerName);
            SaveIn("BanLog",str);
        }
    }
    return 1;
}
Should work
Reply
#3

Server crashes problably because the file "KickLog" doesn't exist.
Not sure but I think that's the reason.
Reply
#4

Quote:

and change it "SaveIn("BanLog",str);" to "SaveIn("KickLog",str);" but again dont works..

Snowman12 man dont works..
its says player is auto kicked bla bla.. but dont kicks..
dont close ur connection..
Reply
#5

Done:
pawn Код:
public WeaponCheck(playerid)
{
    new lbweapon[64],string[128],var, PlayerName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,PlayerName,MAX_PLAYER_NAME);
   
    var = GetPlayerWeapon(playerid);
    if(IsForbiddenWeapon(var) && WeaponForbiddenForPlayer[i][var] && AccInfo[i][Level] == 0 && ServerInfo[ForbiddenWeaps] == 1)
    {
        SendClientMessage(playerid,lightred,"You have been kicked. Reason: Weapon Hack");

        GetWeaponName(var, "lbweapon",sizeof(lbweapon));
        format(lbweapon,sizeof(lbweapon),"Weapon (%d)", lbweapon);

        format(string,sizeof(string),"Player %s (Id:%d) has been Automatically Kicked.  Reason: Weapons ",PlayerName,playerid);
        SendClientMessageToAll(lightred, string);
       
        new str[128];
        format(str,sizeof(str),"%s has been Automatically Kicked. Reason: WeaponHack",PlayerName);
        SaveIn("KickLog",str);
        Kick(playerid);
    }
    return 1;
}
Should work fine test and reply, also you don't need to loop anything.
Reply
#6

ok np ;PP
Reply
#7

) : error 017: undefined symbol "i"
Quote:

WeaponForbiddenForPlayer[i]

means this [i] :O ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)