[Help]Weapon dialog
#1

Hello,

I need help with my /weapon command syntax because it's not working. The command is in dialog form and the dialog style is input.

My code is:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_WEAPON)
    {
        if(strcmp(inputtext))
        {
            new  weaponid;
            if(weaponid > 47) return SendClientMessage(playerid, -1, "[SHOP]:Unknown weapon id!");
            if(weaponid < 0) return SendClientMessage(playerid, -1, "[SHOP]:Unknown weapon id!");
           
            new string[128], wname[24];
            GetWeaponName(weaponid, wname, sizeof(wname));
            format(string, sizeof(string), "[SHOP]:You have bought %s for $1000.", wname);
            GivePlayerWeapon(playerid, weaponid, 500);
            SendClientMessage(playerid, -1, string);
            GivePlayerMoney(playerid, -1000);
        }
        return 1;
    }
    return 1;
}
Please tell me what's the problem?
Reply
#2

have you put at the start of the script "#define DIALOG_WEAPON" without "?
if not put it and try again
+ rep me to help others
Reply
#3

Yes, I did.
Reply
#4

anyone?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)