Anti miniguns
#1

the gamemodes is warnings

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(GetPlayerWeapon(killerid) == 38)
    {
        new string[128], player[MAX_PLAYER_NAME];
        GetPlayerName(playerid, player, sizeof(player));

        format(string, sizeof(string), "%s died! Server Banned his attacker (reason: Minigun)", player);
        SendClientMessageToAll(YELLOW, string);
        Ban(killerid);
    }
    return 1;
}
Waring:

Код:
D:\Hybrid Teszt szerver\gamemodes\hybrid.pwn(26193) : warning 225: unreachable code
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
help, THx
Reply
#2

What line is 26193?
Reply
#3

Not Ban only

Check Code:

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(GetPlayerWeapon(killerid) == 38)
    {
      new IP[32];
        for(new p=0;p<MAX_PLAYERS;p++) //Make loop
        {
            GetPlayerIp(p,IP,32);      
                new name[24];
                GetPlayerName(p,name,24);
               BanEx(p,"%s Have been Banned Reason: (minigun), name");              }
        }
        return 1;
    }
    return 1;
}
UNTESTED
Reply
#4

Just saying, would it not be easier to GetPlayerWeapon under OnPlayerUpdate? So as soon as the player has a minigun it bans them? Cause the way your doing it here, players can run around with a minigun when ever they like as long as they dont kill anyone...

Just a suggestion eh?
Reply
#5

Quote:
Originally Posted by James Coral
Посмотреть сообщение
Not Ban only

Check Code:

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(GetPlayerWeapon(killerid) == 38)
    {
      new IP[32];
        for(new p=0;p<MAX_PLAYERS;p++) //Make loop
        {
            GetPlayerIp(p,IP,32);      
                new name[24];
                GetPlayerName(p,name,24);
               BanEx(p,"%s Have been Banned Reason: (minigun), name");              }
        }
        return 1;
    }
    return 1;
}
UNTESTED
So you want to ban everyone, as soon a cheater makes a minigun kill?

Also, I would make a timer and check a player's weapons using GetPlayerWeaponData, since GetPlayerWeapon only checks the weapon you are holding. And OPU gets called lots of times per second, so it would be useless to check for a minigun that often.

EDIT: Sorry for just suggesting something new, instead of helping you fix the problem. I guess your OnPlayerDeath got more code than just a minigun check. So if you just 'return 1;' in the middle (or just after the minigun check), then the rest of the code in OnPlayerDeath won't be called, therefore unreachable. But show us the exact line of where the error occurs.
Reply
#6

Quote:
Originally Posted by James Coral
Посмотреть сообщение
Not Ban only

Check Code:

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(GetPlayerWeapon(killerid) == 38)
    {
      new IP[32];
        for(new p=0;p<MAX_PLAYERS;p++) //Make loop
        {
            GetPlayerIp(p,IP,32);      
                new name[24];
                GetPlayerName(p,name,24);
               BanEx(p,"%s Have been Banned Reason: (minigun), name");              }
        }
        return 1;
    }
    return 1;
}
UNTESTED


Not good


Quote:
Originally Posted by BlackSA
Посмотреть сообщение
What line is 26193?
Код:
new Kill_Size = sizeof(Kill_levels)-1;
Reply
#7

Quote:
Originally Posted by lusta19
Посмотреть сообщение
the gamemodes is warnings

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(GetPlayerWeapon(killerid) == 38)
    {
        new string[128], player[MAX_PLAYER_NAME];
        GetPlayerName(playerid, player, sizeof(player));

        format(string, sizeof(string), "%s died! Server Banned his attacker (reason: Minigun)", player);
        SendClientMessageToAll(YELLOW, string);
        Ban(killerid);
    }
    return 1;
}
Waring:

Код:
D:\Hybrid Teszt szerver\gamemodes\hybrid.pwn(26193) : warning 225: unreachable code
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
help, THx
This warnning isn't from this code/callback.
Press CTRL+G and search for 26193 and then copy the lines and post them here.
Reply
#8

JunkBuster is your friend!
Reply
#9

Quote:
Originally Posted by HyperZ
Посмотреть сообщение
This warnning isn't from this code/callback.
Press CTRL+G and search for 26193 and then copy the lines and post them here.
Код:
new Kill_Size = sizeof(Kill_levels)-1;
Reply
#10

You know that hacking clients can emulate OnPlayerDeath so peoples without minigun can be also punished.

Quote:

Also, I would make a timer and check a player's weapons using GetPlayerWeaponData, since GetPlayerWeapon only checks the weapon you are holding. And OPU gets called lots of times per second, so it would be useless to check for a minigun that often.

Of course OPU gets called several times but if you know how detect it more slightly and synced there are alot of tricks how to check it over OPU (from cessils anticheat guide)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)