Dialog problems
#1

Hello,

I can't, but ill try to explain it.
I'm using SWX GM + Weapon Dialogs. When i try to spawn weapon, it spawns me a car, even when i just click Cancel.
I don't know where is the problem. I tried with different dialog plugin and all times it makes the same problem.

Thanks in advance!
Reply
#2

Show us the code, so we can help you. Remember to put it inside [pawn] & [/pawn] tags.
Reply
#3

It's because the dialogids are conflicting.
Reply
#4

This is the code of the FS (1 of them):

pawn Код:
#include <a_samp>

public OnFilterScriptInit()
{
    print("-----------------------------------------");
    print(" Weapon Dialog by [WsR]RyDeR - Loaded - ");
    print("-----------------------------------------");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/wdialog", cmdtext, true, 12) == 0)
    {
        ShowPlayerDialog(playerid, 8777, 2, "Weapon list", "Melee\nThrown\nPistols\nShotguns\nSub-machine guns\nRifles\nHeavy weapons\nHand held\nApparel\nSpecial", "Select", "Exit");
        return 1;
    }
    return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(response == 1)
    {
        switch(dialogid)
        {
            case 8777:
            {
                switch(listitem)
                {
                    case 0: ShowPlayerDialog(playerid, 8778, 2, "Melee", "Brass knuckles\nGolf club\nNite stick\nKnife\nBaseball bat\nShovel\nPool cue\nKatana\nChainsaw\nPurple dildo\nShort dildo\nLong vibrator\nLong vibrator\nFlowers\nCane", "Select", "Cancel");
                    case 1: ShowPlayerDialog(playerid, 8779, 2, "Thrown", "Grenades\nTear Gas\nMolotov cocktail", "Select", "Cancel");
                    case 2: ShowPlayerDialog(playerid, 8780, 2, "Pistols", "9mm Pistol\nSilenced pistol\nDesert eagle", "Select", "Cancel");
                    case 3: ShowPlayerDialog(playerid, 8781, 2, "Shotguns", "Shotgun\nSawn-off shotgun\nCombat shotgun", "Select", "Cancel");
                    case 4: ShowPlayerDialog(playerid, 8782, 2, "Sub-machine guns", "Micro Uzi\nMP5\nTEC9", "Select", "Cancel");
                    case 5: ShowPlayerDialog(playerid, 8783, 2, "Rifles", "AK47\nM4\nCountry rifle\nSniper rifle", "Select", "Cancel");
                    case 6: ShowPlayerDialog(playerid, 8784, 2, "Heavy weapons", "Rocket Launcher\nHS-Rocket Launcher\nFlame thrower\nMinigun", "Select", "Cancel");
                    case 7: ShowPlayerDialog(playerid, 8785, 2, "Hand held", "Spray can\nFire extinguisher\nCamera", "Select", "Cancel");
                    case 8: ShowPlayerDialog(playerid, 8786, 2, "Apparel", "Night vision\nThermal goggles\nParachute", "Select", "Cancel");
                    case 9: ShowPlayerDialog(playerid, 8787, 2, "Special", "Satchel charges\nDetonator", "Select", "Cancel");
                }
            }
            case 8778:
            {
                new weapons[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
                return GivePlayerWeapon(playerid, weapons[listitem], 500);
            }
            case 8779:
            {
                new weapons[] = {16,17,18};
                return GivePlayerWeapon(playerid, weapons[listitem], 500);
            }
            case 8780:
            {
                new weapons[] = {22,23,24};
                return GivePlayerWeapon(playerid, weapons[listitem], 500);
            }
            case 8781:
            {
                new weapons[] = {25,26,27};
                return GivePlayerWeapon(playerid, weapons[listitem], 500);
            }
            case 8782:
            {
                new weapons[] = {28,29,32};
                return GivePlayerWeapon(playerid, weapons[listitem], 500);
            }
            case 8783:
            {
                new weapons[] = {30,31,33,34};
                return GivePlayerWeapon(playerid, weapons[listitem], 500);
            }
            case 8784:
            {
                new weapons[] = {35,36,37,38};
                return GivePlayerWeapon(playerid, weapons[listitem], 500);
            }
            case 8785:
            {
                new weapons[] = {41,42,43,44};
                return GivePlayerWeapon(playerid, weapons[listitem], 500);
            }
            case 8786:
            {
                new weapons[] = {44,45,46};
                return GivePlayerWeapon(playerid, weapons[listitem], 500);
            }
            case 8787:
            {
                new weapons[] = {39,40};
                return GivePlayerWeapon(playerid, weapons[listitem], 500);
            }
        }
    }
    return 1;
}
Gamemode's includes and defines:

pawn Код:
#include  <a_samp>
#include  <dini>
#include  <dudb>
#include  <zcmd>
#include  <colors>
#include  <F_streamer>
//**** Directives ****//
#pragma unused ret_memcpy
#pragma unused strtok
//***** Defines ******//
#define MAX_STRING 255
#define player_x -250.9738
#define player_y 2585.6497
#define player_z 63.5703
#define player_angle 210.3500
#define camera_x -248.9410
#define camera_y 2581.5327
#define camera_z 64.9334
#define moving_speed 50
#define SERVER_USER_FILE "%s.ini"
#define ResetMoneyBar ResetPlayerMoney
#define UpdateMoneyBar GivePlayerMoney
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
#define green 0x33FF33AA
#define white 0xFFFFFF
#define cyan 0x99FFFFAA
#define LIGHT_BLUE 0x33CCFFAA
#define Dialog 4670
#define V_ID GetPlayerVehicleID(playerid)
#define Driver 0
#define Passanger 2
Regards,
kikoto
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)