Anti-Weapon Hax :3
#1

How to use enums

Ill made this (1 min work)

pawn Code:
#include <a_samp>

public OnFilterScriptInit()
{
    SetTimer("WaponHax", 1000, true);
    return 1;
}

enum ForbiddenWeapons
{
    2, //error 001: expected token: "-identifier-", but found "-integer value-"
    6,
    7
}
new BannedWeapons[MAX_PLAYERS][ForbiddenWeapons];

forward WaponHax();
public WaponHax()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(!IsPlayerAdmin(i) && IsPlayerConnected(i))
        {
            if(BannedWeapons[i][ForbiddenWeapons]) //error 032: array index out of bounds (variable "BannedWeapons")
            {
                new gunname[32];
                GetWeaponName(BannedWeapons[i][ForbiddenWeapons], gunname, 32); //error 032: array index out of bounds (variable "BannedWeapons")
               
                new string[128];
                format(string,sizeof(string),"ID (%d) is using a %s, and that weapon is inside the enum", i, gunname);
                SendClientMessageToAll(0xFFFFFFAA, string);
            }
        }
    }
}
Reply


Messages In This Thread
Anti-Weapon Hax :3 - by Unknown123 - 06.04.2011, 00:53
Re: Anti-Weapon Hax :3 - by Snipa - 06.04.2011, 01:00
Re: Anti-Weapon Hax :3 - by Unknown123 - 06.04.2011, 01:37
Re: Anti-Weapon Hax :3 - by Donya - 06.04.2011, 01:57
Re: Anti-Weapon Hax :3 - by Snipa - 06.04.2011, 02:03
Re: Anti-Weapon Hax :3 - by austin070 - 06.04.2011, 02:14
Re: Anti-Weapon Hax :3 - by randomkid88 - 06.04.2011, 02:49

Forum Jump:


Users browsing this thread: 2 Guest(s)