Check this (Dialog)
#1

I am creating weapon shop
Need help please some problem occurs
I want that /buygun CMD work on all amunation and i want to change the dialog name

CHeck this codes

Код:
//Weapon Shop by BodyBoardVEVO

#include <a_samp>

#if defined FILTERSCRIPT
#define DIALOG_WEAPONS 3
#define WEAPON_S 10000
#endif

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_WEAPONS)
    {
        if(response)
        {
            if(listitem == 0)
            {
                GivePlayerMoney(playerid, -100);
                SetPlayerHealth(playerid, 100); //Health
            }
            if(listitem == 1)
            {
                GivePlayerMoney(playerid, -2000);
                SetPlayerArmour(playerid, 100); //Armour
            }
            if(listitem == 2)
            {
                GivePlayerMoney(playerid, -250);
                GivePlayerWeapon(playerid, 22, 99999); //9mm
            }
            if(listitem == 3)
            {
                GivePlayerMoney(playerid, -300);
                GivePlayerWeapon(playerid, 23, 99999); //Silence Pistol
            }
            if(listitem == 4)
            {
                GivePlayerMoney(playerid, -5500);
                GivePlayerWeapon(playerid, 24, 99999); //Desert Eagle
            }
            if(listitem == 5)
            {
                GivePlayerMoney(playerid, -3000);
                GivePlayerWeapon(playerid, 25, 99999); //Shotgun
            }
            if(listitem == 6)
            {
                GivePlayerMoney(playerid, -6500);
                GivePlayerWeapon(playerid, 29, 99999); //MP5
            }
        }
        return 1;
    }
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{

    if (strcmp("/buygun", cmdtext, true, 10) == 0)
    {
    	if(IsPlayerInRangeOfPoint(playerid, 7, 314.820983,-141.431991,999.601562 ))
    	{

        ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Weapon Shop", "Health - $100\nArmour - $2000\n9mm - $250\nSilence Pistol - $300\nDesert Eagle - $5500\nShotgun - $3000\nMP5 - $6500", "Purchase", "Cancel");
        }
		else
		{
			SendClientMessage(playerid, 0xAA3333AA, "You are not at the gun shop.");
		}
		return 1;
	}
	    if (strcmp("/buygun", cmdtext, true, 15) == 0)
    {
    	if(IsPlayerInRangeOfPoint(playerid, 1	,286.148986,-40.644397,1001.515625 ))
    	{

        ShowPlayerDialog(playerid, 10000, DIALOG_STYLE_LIST, "Weapon Shop", "Health - $100\nArmour - $2000\n9mm - $250\nSilence Pistol - $300\nDesert Eagle - $5500\nShotgun - $3000\nMP5 - $6500", "Purchase", "Cancel");
        }
		else
		{
			SendClientMessage(playerid, 0xAA3333AA, "You are not at the gun shop.");
		}
		return 1;
	}
        if (strcmp("/buygun", cmdtext, true, 13) == 0)
    {
    	if(IsPlayerInRangeOfPoint(playerid, 4	,286.800994,-82.547599,1001.515625 ))
    	{

        ShowPlayerDialog(playerid, 10000, DIALOG_STYLE_LIST, "Weapon Shop", "Health - $100\nArmour - $2000\n9mm - $250\nSilence Pistol - $300\nDesert Eagle - $5500\nShotgun - $3000\nMP5 - $6500", "Purchase", "Cancel");
        }
		else
		{
			SendClientMessage(playerid, 0xAA3333AA, "You are not at the gun shop.");
		}
		return 1;
	}
        if (strcmp("/buygun", cmdtext, true, 12) == 0)
    {
    	if(IsPlayerInRangeOfPoint(playerid, 6	,296.919982,-108.071998,1001.515625))
    	{

        ShowPlayerDialog(playerid, 10000, DIALOG_STYLE_LIST, "Weapon Shop", "Health - $100\nArmour - $2000\n9mm - $250\nSilence Pistol - $300\nDesert Eagle - $5500\nShotgun - $3000\nMP5 - $6500", "Purchase", "Cancel");
        }
		else
		{
			SendClientMessage(playerid, 0xAA3333AA, "You are not at the gun shop.");
		}
		return 1;
	}
        if (strcmp("/buygun", cmdtext, true, 11) == 0)
    {
    	if(IsPlayerInRangeOfPoint(playerid, 6 ,	316.524993,-167.706985,999.593750))
    	{

        ShowPlayerDialog(playerid, 10000, DIALOG_STYLE_LIST, "Weapon Shop", "Health - $100\nArmour - $2000\n9mm - $250\nSilence Pistol - $300\nDesert Eagle - $5500\nShotgun - $3000\nMP5 - $6500", "Purchase", "Cancel");
        }
		else
		{
			SendClientMessage(playerid, 0xAA3333AA, "You are not at the gun shop.");
		}
		return 1;
	}

	return 0;
}
Help me ASAP
Reply
#2

You need to use "logical or" = ||
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[]) {
    if (strcmp("/buygun", cmdtext, true) == 0) {
        if(
            IsPlayerInRangeOfPoint(playerid, 7.0, 314.820983,-141.431991,999.601562 ) ||
            IsPlayerInRangeOfPoint(playerid, 1.0, 286.148986,-40.644397,1001.515625 ) ||
            IsPlayerInRangeOfPoint(playerid, 4.0, 286.800994,-82.547599,1001.515625 ) ||
            IsPlayerInRangeOfPoint(playerid, 6.0, 296.919982,-108.071998,1001.515625 ) ||
            IsPlayerInRangeOfPoint(playerid, 6.0, 316.524993,-167.706985,999.593750 )
        ) {
            ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Weapon Shop", "Health - $100\nArmour - $2000\n9mm - $250\nSilence Pistol - $300\nDesert Eagle - $5500\nShotgun - $3000\nMP5 - $6500", "Purchase", "Cancel");
        } else {
            SendClientMessage(playerid, 0xAA3333AA, "You are not at the gun shop.");
        }
        return true;
    }
    return false;
}
The dialog name is "Weapon Shop", just change it to what you want
Reply
#3

Please set full fs its shows error

Undefined DIALOG_WEAPONS



Код:
E:\PRRP\hz\PRRP\gamemodes\CS.pwn(65) : error 017: undefined symbol "DIALOG_WEAPONS"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#4

I define it but i shows error

#define DIALOG_WEAPONS 10000
Reply
#5

You need a unique dialog to verify if you want..
Reply
#6

pawn Код:
#if defined FILTERSCRIPT // remove that line
#define DIALOG_WEAPONS 3
#define WEAPON_S 10000
#endif // and that
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)