Auto armor ban when < default score
#1

Hi all,i need little help.

In my server i've ranks,and only who have 1500 score,he can get full armor.

Well,cuz i see everyday cheaters with 0 score and full armor,i need to do a thing:

I need to autoban who have full armor between 0 and 1499 score.

Ex: Who have 10 score and full armor,get's auto ban.

From 0 to 1499.

Thanks,i really appreciate who will help me.
Reply
#2

mhh, maybe something like this:

pawn Код:
if(GetPlayerScore == < 1500)
{
if(GetPlayerArmour == >1)
{

//Ban command
I'm not sure if this will work...
but you can give it a try ; )
Reply
#3

pawn Код:
forward ArmourTimer();

public OnGameModeInit()
{
    SetTimer("ArmourTimer", 5000, true);
    return 1;
}

public ArmourTimer()
{
    for(new playerid; playerid < MAX_PLAYERS; playerid++)
    {
        if(!IsPlayerConnected(playerid))continue;
        new
            Float:armour;
        GetPlayerArmour(playerid, armour);
        if(GetPlayerScore(playerid) < 1500 && armour > 25.0)//don't know how much armour you allow below the score 1500
        {
            ban(playerid);
        }
    }
}
Reply
#4

Thanks i will try.
Reply
#5

My bad i should have compiled it one sec ill fix.
pawn Код:
forward ArmourTimer();

public OnGameModeInit()
{
    SetTimer("ArmourTimer", 5000, true);
    return 1;
}

public ArmourTimer()
{
    for(new playerid; playerid < MAX_PLAYERS; playerid++)
    {
        if(!IsPlayerConnected(playerid))continue;
        new
            Float:armour;
        GetPlayerArmour(playerid, armour);
        if(GetPlayerScore(playerid) < 1500 && armour > 25.0)//don't know how much armour you allow 1500
        {
            Ban(playerid);
        }
    }
}
Reply
#6

Remember that some police vehicles (the swat van?) gives you armour. Maybe you have them in your script, so you would ban players for entering it.
Reply
#7

Quote:
Originally Posted by Mauzen
Посмотреть сообщение
Remember that some police vehicles (the swat van?) gives you armour. Maybe you have them in your script, so you would ban players for entering it.
Good point.
pawn Код:
forward ArmourTimer();

public OnGameModeInit()
{
    SetTimer("ArmourTimer", 5000, true);
    return 1;
}

public ArmourTimer()
{
    for(new playerid; playerid < MAX_PLAYERS; playerid++)
    {
        if(!IsPlayerConnected(playerid))continue;
        new
            Float:armour;
        GetPlayerArmour(playerid, armour);
        if(GetPlayerScore(playerid) < 1500 && armour > 25.0 && GetVehicleModel(GetPlayerVehicleID(playerid)) != 427)//don't know how much armour you allow 1500
        {
            Ban(playerid);
        }
    }
}
Reply
#8

Nope Mauzen,there are no swat vehicles in my gm =)

Iggy1,thanks!

I tried but i got this:

Код:
C:\Documents and Settings\k\Desktop\kkkk,pwn(116) : error 001: expected token: ";", but found "forward"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#9

I don't think my code is causing that, there seems to be a semicolon missing before the forward. Have a look. The script i posted compiles without error.

EDIT: Also you might want to just delete the timer, and put the rest of the code in an existing timer (with a player loop) if you have one, it will save resources.
Reply
#10

Quote:
Originally Posted by Mauzen
Посмотреть сообщение
Remember that some police vehicles (the swat van?) gives you armour. Maybe you have them in your script, so you would ban players for entering it.
SWAT vans and Ambulances don't give armour and health respectively since 0.3b.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)