Ammunation weapons buying
#1

I build a little dialog for /buyguns on ammunation interior, when i buy for example a MM9 i getting banned for weapon hacking... and IsPlayerInRangeOfPoints doesnt work too.
please help what i doing wrong and what code for cancel the anticheat on /buyguns

Код:
#include <a_samp>
#include <zcmd>

// Goverment Ammunation
// Legal Weapons

#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_GREEN 0x80FF00AA
#define COLOR_GREY 0xAFAFAFAA

CMD:buyguns(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, 308.2658, -140.7199, 999.6016))
 {
  SendClientMessage(playerid,COLOR_GREY,"   You are not at the Goverment Ammunation!");
}
  
        ShowPlayerDialog(playerid,253,DIALOG_STYLE_LIST,"{808080}Legal Weapons","MM9 {80FF00}$1000{FFFFFF}\nShotgun {80FF00}$5000{FFFFFF}\nRifle {80FF00}$10000{FFFFFF}","Select", "Back");
        return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
        if(dialogid == 253)
        {
        if(response)
        {
        if(listitem == 0)
        {
        if(GetPlayerMoney(playerid) > 1000)
        {
                GivePlayerMoney(playerid, -1000);
                GameTextForPlayer(playerid, "~r~ -1000$", 5000, 1);
                GivePlayerWeapon(playerid, 22, 99999);
        }else{SendClientMessage(playerid, COLOR_WHITE, "You don't have that much!");}
        }
        if(listitem == 1)
        {
        if(GetPlayerMoney(playerid) > 5000)
        {
                GivePlayerMoney(playerid, -5000);
                GameTextForPlayer(playerid, "~r~ -5000$", 5000, 1);
                GivePlayerWeapon(playerid, 25, 99999);
        }else{SendClientMessage(playerid, COLOR_WHITE, "You don't have that much!");}
        }
        if(listitem == 2)
        {
        if(GetPlayerMoney(playerid) > 10000)
        {
                GivePlayerMoney(playerid, -10000);
                GameTextForPlayer(playerid, "~r~ -10000$", 5000, 1);
                GivePlayerWeapon(playerid, 33, 99999);
        }else{SendClientMessage(playerid, COLOR_WHITE, "You don't have that much!");}
        }
        }
        }
        return 1;
}
Reply
#2

Your anticheat is not present in this code, so you have to edit filterscript containing it.
You have to add "return" before SendClientMessage, so the code isn't executed any further.
Learn how to indent your code properly, now it looks terrible.
Reply
#3

I pawn scripting beginner :/
At leaset how do i fix that? there is a code that block the anticheat and make the anticheat think it normal shop or something like that? BTW, IsPlayerInrRangeOfPoint not working, how do i fix that?
Reply
#4

Add your weapons stuff where the anticheat is. There are some of them - anticheats with server-side weapons and you should give the weapon with a custom function (so it will be recognized as registered weapon on the server).

PS: Your location says "Learning Pawno", I wonder how it is to learn an editor! It's called Pawn.
Reply
#5

Well as i said i pawn beginner, how can i find my "weapon with a custom function"?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)