Dialog
#1

Hello i have created a dialog
but when i go ingame it doesn't show when i type the cmd

Code-
PHP код:
#include <a_samp>
#define DIALOG_BRW 112911
public OnFilterScriptInit()
{
    print(
"\n--------------------------------------");
    print(
" Firetruck system by firemanjv");
    print(
"--------------------------------------\n");
    return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if(
strcmp(cmdtext"/fdtruck"true) == 0)
    {
        
ShowPlayerDialog(playeridDIALOG_BRWDIALOG_STYLE_LIST"FD Truck Menu""Chainsaw \n Shovel \n Fire Extinguisher \n Ladder \n Fire Suite \n Medic Suite \n First AID kit""Select""Cancel");
        return 
1;
    }
    return 
0;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
  if(
dialogid == 112911)
    {
        if(
response)
        {
            if(
listitem == 0)
            {
              
GivePlayerWeapon(playerid91500);
             }
            if(
listitem == 1)
            {
              
GivePlayerWeapon(playerid6500);
              }
              if(
listitem == 2)
            {
              
GivePlayerWeapon(playerid425100);
            }
            if(
listitem == 3)
            {
            }
            if(
listitem == 4)
            {
              
SetPlayerSkin(playerid277);
              return 
1;
            }
            if(
listitem == 5)
            {
              
SetPlayerSkin(playerid275);
              return 
1;
            }
            if(
listitem == 6)
            {
              
SetPlayerHealth(playerid100);
               return 
1;
            }
        }
    }
    return 
1;
}
public 
OnFilterScriptExit()
{
    return 
1;

And some other thing how can i make this that it only work when you stand near a firetruck ( ladder/engie) or Ambulance
Reply
#2

pawn Код:
ShowPlayerDialog(playerid, DIALOG_BRW, DIALOG_STYLE_LIST, "FD Truck Menu", "Chainsaw \n Shovel \n Fire Extinguisher \n Ladder \n Fire Suite \n Medic Suite \n First AID kit", "Select", "Cancel");
//The Dialog does not know what ID it is.
Use this instead
pawn Код:
ShowPlayerDialog(playerid, 112911, DIALOG_STYLE_LIST, "FD Truck Menu", "Chainsaw \n Shovel \n Fire Extinguisher \n Ladder \n Fire Suite \n Medic Suite \n First AID kit", "Select", "Cancel");
//Shows the ID
Also I would just keep it as numbers, since it is much easier to find if you wish to edit it later
Reply
#3

oh i thought because id did #define DIALOG_BRW 112911 it was correct but thanks for help
Reply
#4

Quote:
Originally Posted by firemanjv
Посмотреть сообщение
oh i thought because id did #define DIALOG_BRW 112911 it was correct but thanks for help
No the numbers are the same, but its just more efficient to do it that way. Besides that the problem of dialogs not opening, hm the dialog code looks okay so i cant really find out whats the problem...
Reply
#5

i did what Krakuski said but it doesn't work for me ...
Reply
#6

Quote:

playerid The ID of the player to show the dialog to.
dialogid An ID to assign this dialog to, so responses can be processed. Max dialogid is 32767. Using negative values will close any open dialog.
style The style of the dialog.
caption[] The title at the top of the dialog. The length of the caption can not exceed more than 64 characters before it starts to cut off.
info[] The text to display in the dialog. Use \n to start a new line and \t to tabulate.
button1[] The text on the left button.
button2[] The text on the right button. Leave it blank to hide it.

Returns This function doesn't return a specific value

Your dialogid is wayyyyyyyy to huge. change it to 5000 or any number below 32767
Reply
#7

okay i wi'll do it
Reply
#8

Quote:

Wiki:
Max dialogid is 32767.

Should help you.

EDIT: As always, i'm very slow in typing
Reply
#9

Thanks ! And i think it doesn't matter that you'r very slow...
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)