Ammunition
#1

Hello guys , i wanted to edit ammunition armor to 99 instead of 100

Question is , what are the functions needed for this?

Thanks!
Reply
#2

You either need to disable ammunation or detect when they buy armour by tracking when their armour increases and checking if they are inside ammunation with a distance (IsPlayerInRangeOfPoint) and interior (GetPlayerInterior) check.
Reply
#3

Basically i am working on a script to ban anyone who gets an armor with 100.
So i make an exception using an if statment not to ban players who get armor from ammunation?
Reply
#4

Yes like that,when someone buys an armor set it's level to 99.And make a timer that checks everyone's armor level every second,higher than 99,well that's a ban.
Reply
#5

Quote:
Originally Posted by Cjgogo
Посмотреть сообщение
Yes like that,when someone buys an armor set it's level to 99.And make a timer that checks everyone's armor level every second,higher than 99,well that's a ban.
I will have to use SetPlayerArmor?
Reply
#6

Yes.
Reply
#7

pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
new pArmour[MAX_PLAYERS];

public OnGameModeInit() //Or OnFilterScriptInit()
{
    SetTimer("ArmourCheck", 2000, true);
    return 1;
}

public OnPlayerConnect(playerid)
{
    SetPlayerArmour(playerid, 0);
    pArmour[playerid] = 0;
    return 1;
}

forward ArmourCheck();
public ArmourCheck()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            new Float:Armour;
            GetPlayerArmour(i, Armour);
            if(pArmour[i] < Armour)
            {
                if(!IsPlayerInRangeOfPoint(i, 30, 286.148987, -40.644398, 1001.569946) && GetPlayerInterior(i) != 1 || !IsPlayerInRangeOfPoint(i, 30, 286.800995, -82.547600, 1001.539978) && GetPlayerInterior(i) != 4||
                !IsPlayerInRangeOfPoint(i, 30, 296.919983, -108.071999, 1001.569946)&& GetPlayerInterior(i) != 6|| !IsPlayerInRangeOfPoint(i, 30, 314.820984, -141.431992, 999.661987) && GetPlayerInterior(i) != 7||
                !IsPlayerInRangeOfPoint(i, 30, 316.820984, -167.706985, 999.661987) && GetPlayerInterior(i) != 6)
                {
                    SendClientMessage(i, 0xFF0000AA, "You have been banned from this server. Reason: Armour Hacks");
                    Ban(i);
                    return 1;
                }
                else return pArmour[i] = Armour;
            }
        }
    }
    return 1;
}
Should work, if you find any errors please tell me.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)