/buyguns command Give hacking warning
#1

ok so basically i got this /buyguns command but when a player buys them we admins get spammed everytime he switches to a gun he got

command:
pawn Код:
CMD:buyguns(playerid, params[])
{
    if(!IsPlayerInRangeOfPoint(playerid, 7.0, 1711.09, -1874.66, 13.61)) return SendClientMessage(playerid, COLOR_RED, "You are not near the gun locker (inside spawn at unity)!");
    if(BuyWeaponSet[playerid] == 0)
    {
        SendClientMessage(playerid, COLOR_RED, "Are you sure you want to buy these weapons they cost $500,000, Type the command again to confirm your purchase.");
        SendClientMessage(playerid, COLOR_REALRED, "Please note that these will cost MORE Then buying them individually from a arms dealer.");
        BuyWeaponSet[playerid] = 1;
    }
    else
    {
        if(GetPlayerMoney(playerid) < 500000)
        return SendClientMessage(playerid, COLOR_RED, "You dont have enough money to buy this weapon set!(500k)");
        GivePlayerWeapon(playerid, 27, 999999);
        GivePlayerWeapon(playerid, 24, 999999);
        GivePlayerWeapon(playerid, 34, 999999);
        GivePlayerWeapon(playerid, 29, 999999);
        GivePlayerWeapon(playerid, 5, 1);
        GivePlayerWeapon(playerid, 31, 999999);
        GivePlayerCash(playerid, -500000);
        SendClientMessage(playerid, COLOR_GREEN, "You have Purchase The Weapon Set for $500k");
        BuyWeaponSet[playerid] = 0;
    }
    return 1;
}
Reply
#2

this code above looks good, each single line contains a playerid, the buyer.
i bet its something inside the OnPlayerKeyStatechange callback, since you stated that admins get spammed warnings when a player changes his gun. it seems that you need to adjust your admin-script/forbidden weapons
Reply
#3

now try this hope this can help

pawn Код:
CMD:buyguns(playerid, params[])
{
    if(!IsPlayerInRangeOfPoint(playerid, 7.0, 1711.09, -1874.66, 13.61)) return SendClientMessage(playerid, COLOR_RED, "You are not near the gun locker (inside spawn at unity)!");
    if(BuyWeaponSet[playerid] == 0)
    {
        SendClientMessage(playerid, COLOR_RED, "Are you sure you want to buy these weapons they cost $500,000, Type the command again to confirm your purchase.");
        SendClientMessage(playerid, COLOR_REALRED, "Please note that these will cost MORE Then buying them individually from a arms dealer.");
        BuyWeaponSet[playerid] = 1;
    }
    else
    {
        if(GetPlayerMoney(playerid) < 500000)
        return SendClientMessage(playerid, COLOR_RED, "You dont have enough money to buy this weapon set!(500k)");
        GivePlayerValidWeapon(playerid, 27, 999999);
        GivePlayerValidWeapon(playerid, 24, 999999);
        GivePlayerValidWeapon(playerid, 34, 999999);
        GivePlayerValidWeapon(playerid, 29, 999999);
        GivePlayerValidWeapon(playerid, 5, 1);
        GivePlayerValidWeapon(playerid, 31, 999999);
        GivePlayerCash(playerid, -500000);
        SendClientMessage(playerid, COLOR_GREEN, "You have Purchase The Weapon Set for $500k");
        BuyWeaponSet[playerid] = 0;
    }
    return 1;
}
Reply
#4

You'll have to chenge the basic GivePlayerWeapon function to your script anti hacking one.
Reply
#5

Quote:
Originally Posted by Ranama
Посмотреть сообщение
You'll have to chenge the basic GivePlayerWeapon function to your script anti hacking one.
As Ranama says, i'm gonna help you a little bit, check out your forbidden weapons on your script, as this code looks no different from those edits around the forum, i use GivePlayerWeaponEx for some safe callbacks so we don't get spammed, it's not so difficult
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)