Anti Armour help
#1

Hello,I putted in my script this :

Код:
forward ArmourCheck( );

public ArmourCheck( )
{
    new Float:pArmour;
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(i)) continue;
        GetPlayerArmour(i, pArmour);
        if(pArmour > 0.0) Ban(i);
    }
}
To test I downloaded cheats,I putted on armour,but I don't get ban.Can some one help me ?
Reply
#2

pawn Код:
forward ArmourCheck();

public ArmourCheck()
{
    for (new i = 0; i < MAX_PLAYERS; i++) // Begins for loop.
    {
        if (IsPlayerConnected(i)) // Checks if the player is connected.
        {
            if (GetPlayerArmour(i) > 0.0) // Checks if they have armour on at all.
            {
                Ban(i); // Bans the player.
            }
        }
    }
}
Reply
#3

Did you set a timer for the function to be called regularly? Also, you do realize that with that function, anyone connected who has armour will immediately be banned.
Reply
#4

Quote:
Originally Posted by aqu
Посмотреть сообщение
Hello,I putted in my script this :

Код:
forward ArmourCheck( );

public ArmourCheck( )
{
    new Float:pArmour;
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(i)) continue;
        GetPlayerArmour(i, pArmour);
        if(pArmour > 0.0) Ban(i);
    }
}
To test I downloaded cheats,I putted on armour,but I don't get ban.Can some one help me ?

Untested, but this is the idea...

pawn Код:
// Whereever armour is added
PlayerInfo[playerid][Armour] = // armour amount



public OnPlayerUpdate(playerid)
{
     new Float:armour

     GetPlayerArmour(playerid, armour);

     if(PlayerInfo[playerid][Armour] > armour)
     {
          // Armour Hack Detected
          // Call a function
     }
     else
          PlayerInfo[playerid][Armour] = armour;
}
Reply
#5

I disagree with you, mprofitt. I believe there should be a timer called instead.
Such as:
pawn Код:
SetTimer("ArmourCheck", 1000, 1);
Reply
#6

Quote:
Originally Posted by aqu
Посмотреть сообщение
Hello,I putted in my script this :

Код:
forward ArmourCheck( );

public ArmourCheck( )
{
    new Float:pArmour;
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(i)) continue;
        GetPlayerArmour(i, pArmour);
        if(pArmour > 0.0) Ban(i);
    }
}
To test I downloaded cheats,I putted on armour,but I don't get ban.Can some one help me ?
Quote:
Originally Posted by Leon_Rahil!
Посмотреть сообщение
I disagree with you, mprofitt. I believe there should be a timer called instead.
Such as:
pawn Код:
SetTimer("ArmourCheck", 1000, 1);
Feel free to call a timer then, don't matter how you do it. It is still the same idea.
Reply
#7

Quote:
Originally Posted by Leon_Rahil!
Посмотреть сообщение
pawn Код:
if (GetPlayerArmour(i) > 0.0) // Checks if they have armour on at all.
{
    //
}
You can't check a players armour level like that.

https://sampwiki.blast.hk/wiki/GetPlayerArmour
Reply
#8

Hey I setted timer ,and when I joining to my server I getting banned without no reason.
Reply
#9

Use this:

pawn Код:
public ArmourCheck( )
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            new Float:pArmour;
           
            GetPlayerArmour(i,pArmour);
           
            if(pArmour > 0)
            {
                Ban(i);
            }
        }
    }
}
Reply
#10

Quote:
Originally Posted by Leon_Rahil!
Посмотреть сообщение
I disagree with you, mprofitt. I believe there should be a timer called instead.
Such as:
pawn Код:
SetTimer("ArmourCheck", 1000, 1);
Maybe you should read this...
https://sampforum.blast.hk/showthread.php?tid=184118


Player updates
When any of these things changes for the client, the client will send information to the server and the server will call OnPlayerUpdate:

* Health/armour
* Vehicle health, body damage, color, mods
* Death
* Velocity
* Position/rotation
* Animation
* Pressed keys
* Weapon/ammo
* Camera position (only when aiming/shooting; if not, it's sent about twice a second)


You can, with scripting, detect almost exactly what has changes in OnPlayerUpdate.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)