Dialogs unique identifiers (no longer maintained)
#41

Perhaps that is the duty of the host to determine what Dialog IDs are being used in the scripts (s)he uses.

It's not like a host is going to use all of the Dialog scripts at once.
Reply
#42

After a bit of thinking I realized that the method which I posted above is not so good as I thought, so I wrote this one:
pawn Код:
#include <a_samp>

new
    dialog1,
    dialog2,
    dialog3;

public OnFilterScriptInit()
{
    AddDialog(dialog1);
    AddDialog(dialog2);
    AddDialog(dialog3);
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (newkeys & KEY_CROUCH)
    {
      ShowPlayerDialog(playerid, dialog1, 0, "caption 1", "info 1", "button1 1", "button2 1");
    }
    else if (newkeys & KEY_JUMP)
    {
      ShowPlayerDialog(playerid, dialog2, 0, "caption 2", "info 2", "button1 2", "button2 2");
    }
    else if (newkeys & KEY_SPRINT)
    {
      ShowPlayerDialog(playerid, dialog3, 0, "caption 3", "info 3", "button1 3", "button2 3");
    }
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
  if (dialogid == dialog1)
  {
    SendClientMessage(playerid, 0xFFFFFFFF, "Dialog 1 response");
    return 1;
  }
  if (dialogid == dialog2)
  {
    SendClientMessage(playerid, 0xFFFFFFFF, "Dialog 2 response");
    return 1;
  }
  if (dialogid == dialog3)
  {
    SendClientMessage(playerid, 0xFFFFFFFF, "Dialog 3 response");
    return 1;
  }
  return 0;
}

stock AddDialog(&dialogid)
{
    new
      dialogs;
    dialogs = getproperty(0, "dialogs");
    setproperty(0, "dialogs", dialogs+1);
    dialogid = dialogs;
    return 1;
}
As you can see here I call special function called AddDialog for each my dialog only once
and it stores new dialog ID in some variable passed by reference (dialog1, dialog2 and dialog3 in my case), then I use those IDs for ShowPlayerDialog and OnDialogResponse. Now it's more like a work with menus...
Reply
#43

Pointless thread, just tell people to use there brain when using dialogs.
Reply
#44

Quote:
Originally Posted by Norn
Pointless thread, just tell people to use there brain when using dialogs.
Use my brain to what, read other peoples minds and see what they used as the dialog id in the script they released ?

The only "pointless" thing here is your reply, I don't think you understand why I did this.

Edit:

List updated.
Reply
#45

This is a very good thread that shows people what dialog ids have been used by other dialog scripts
Reply
#46

Quote:
Originally Posted by V1ceC1ty
This is a very good thread that shows people what dialog ids have been used by other dialog scripts
Thanks, atleast some dudes appreciate what I'm trying to do.

For those who don't I'm trying to stop countless "your dialog is broken" or "it shows a different dialog when I try to use yours" posts in your threads, just trying to be helpfull.
Reply
#47

Quote:
Originally Posted by Norn
Pointless thread, just tell people to use there brain when using dialogs.
Pointless post.

On-Topic: Great thread, will be useful without a doubt, thing is .. it should be stickied somewhere.
Reply
#48

Quote:
Originally Posted by Norn
Pointless thread, just tell people to use there brain when using dialogs.
Not really.
Reply
#49

Quote:
Originally Posted by Kye
I need to be more careful with my examples. It wasn't really intended that people would use a hardcoded ID for their dialog but rather a define.

pawn Код:
#define ID_DIALOG_BASE 11000
#define ID_DIALOG_WEAPONLIST ID_DIALOG_BASE+1

ShowPlayerDialog(playerid,ID_DIALOG_WEAPONLIST,DIALOG_STYLE_LIST,"List of weapons:",listitems,"Select","Cancel");

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
   if(dialogid == ID_DIALOG_WEAPONLIST) {
        .........
So say you get 2 filterscripts with conflicting dialogids, just change the ID_DIALOG_BASE to a new number and it's all fixed.
I think Kye is right
its the most simple way
and we all could use different ID_DIALOG_BASEs
i mean sure it can conflict but much less.
and i think its just the easiest way
Reply
#50

got to page 3 and decided you are all idiots.

you don't even have a mouse except in the main menu, i think there is something going on with the scoreboard mouse wise, but it doesn't seem to work for me. so how are you going to get the x, y of a players mouse when it is (for me) always stuck in the top left corner of screen.

I understand that maybe when you do a TogglePlayerControllable it makes the mouse appear, because the player has nothing better to do then.

Reply
#51

Quote:
Originally Posted by Daren_Jacobson
got to page 3 and decided you are all idiots.

you don't even have a mouse except in the main menu, i think there is something going on with the scoreboard mouse wise, but it doesn't seem to work for me. so how are you going to get the x, y of a players mouse when it is (for me) always stuck in the top left corner of screen.

I understand that maybe when you do a TogglePlayerControllable it makes the mouse appear, because the player has nothing better to do then.
Update your video card drivers.
Reply
#52

Quote:
Originally Posted by Kye
why not explain to us all how an enum is better than a preprocessor define?
The enum hold all dialogid that people use in their scripts, this way it's very easy to add a dialog id without searching for what id number to assign to it or incrementing another define, it just need to be named somewhere in the enum.

In a include file "enum_dialogid":
pawn Код:
enum
{
    Admin_Panel_Example_Joe_Staff,
    Simple_AdminScript_GhostTTT,
    Click_Players_Name_Giacomand,
}
Then, for example Giacomand just replace his id in his script, by Click_Players_Name_Giacomand. He don't need to care about which id it will be assigned.

Someone may have to maintain this enum updated, and/or people who release scripts using dialogs, have to write in their topic what to add in the enum, for example Giacomand write: "add Click_Players_Name_Giacomand in the enum_dialogid.inc"...


And please Kye, make TogglePlayerMouse(playerid, bool:toggle), and GetPlayerMousePos(playerid, &x, &y), i remember i suggested these times ago..i really hoped to see them in 0.3, but no luck. They are useful, and i think, will be much more used by scripters than ShowPlayerDialog. It's basically what's missing to make amazing menus made of textdraws, as Seif suggested too.

I know, i'm not the one who have to script it, however i would like but i can't because sa-mp isn't open source.
Reply
#53

I've changed mine to 3300.
Reply
#54

Quote:
Originally Posted by Kye
Quote:
Originally Posted by Daren_Jacobson
got to page 3 and decided you are all idiots.

you don't even have a mouse except in the main menu, i think there is something going on with the scoreboard mouse wise, but it doesn't seem to work for me. so how are you going to get the x, y of a players mouse when it is (for me) always stuck in the top left corner of screen.

I understand that maybe when you do a TogglePlayerControllable it makes the mouse appear, because the player has nothing better to do then.
wasn't very specific here, when i hit tab, the mouse picture that is in GTA folder appears in center and i can't move it., but sometimes when i alt+tab, or switch windows it gets stuck in the top left of screen.

Update your video card drivers.
I wasn't very specific, but what i meant was that when i hit tab the mouse that is in GTA folder appears, and i can't move it, and sometimes when i alt+tab or switch windows it locks the cursor in the top-left of screen.

also i just checked, drivers are up-to-date.
Reply
#55

Quote:
Originally Posted by 0rb
Quote:
Originally Posted by Kye
why not explain to us all how an enum is better than a preprocessor define?
The enum hold all dialogid that people use in their scripts, this way it's very easy to add a dialog id without searching for what id number to assign to it or incrementing another define, it just need to be named somewhere in the enum.

In a include file "enum_dialogid":
pawn Код:
enum
{
    Admin_Panel_Example_Joe_Staff,
    Simple_AdminScript_GhostTTT,
    Click_Players_Name_Giacomand,
}
Then, for example Giacomand just replace his id in his script, by Click_Players_Name_Giacomand. He don't need to care about which id it will be assigned.

Someone may have to maintain this enum updated, and/or people who release scripts using dialogs, have to write in their topic what to add in the enum, for example Giacomand write: "add Click_Players_Name_Giacomand in the enum_dialogid.inc"...


And please Kye, make TogglePlayerMouse(playerid, bool:toggle), and GetPlayerMousePos(playerid, &x, &y), i remember i suggested these times ago..i really hoped to see them in 0.3, but no luck. They are useful, and i think, will be much more used by scripters than ShowPlayerDialog. It's basically what's missing to make amazing menus made of textdraws, as Seif suggested too.

I know, i'm not the one who have to script it, however i would like but i can't because sa-mp isn't open source.
This is no different to what I'm doing now dude but this way nobody has to download anything or update any include etc. I really don't understand why people aren't just happy with the way it is, I think it's fine and I'm the dude updating the list anyway so it's not like it's a hard job to just give the first post a quick scan for the number you used and change it if it's there.

List updated also.
Reply
#56

Quote:
Originally Posted by Donny
Your id conflicts with Weapon Menu by V1ceC1ty.

Check the list in my siggy for a unique id.
Quote:
Originally Posted by Kye
I need to be more careful with my examples. It wasn't really intended that people would use a hardcoded ID for their dialog but rather a define.

pawn Код:
#define ID_DIALOG_BASE 11000
#define ID_DIALOG_WEAPONLIST ID_DIALOG_BASE+1

ShowPlayerDialog(playerid,ID_DIALOG_WEAPONLIST,DIALOG_STYLE_LIST,"List of weapons:",listitems,"Select","Cancel");

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
   if(dialogid == ID_DIALOG_WEAPONLIST) {
         .........
So say you get 2 filterscripts with conflicting dialogids, just change the ID_DIALOG_BASE to a new number and it's all fixed.
ur thread is kinda dumb.
u should tell ppl to use different bases :P
much easier to change and easier to understand.
Reply
#57

Quote:
Originally Posted by SaiBerFun
Quote:
Originally Posted by Donny
Your id conflicts with Weapon Menu by V1ceC1ty.

Check the list in my siggy for a unique id.
Quote:
Originally Posted by Kye
I need to be more careful with my examples. It wasn't really intended that people would use a hardcoded ID for their dialog but rather a define.

pawn Код:
#define ID_DIALOG_BASE 11000
#define ID_DIALOG_WEAPONLIST ID_DIALOG_BASE+1

ShowPlayerDialog(playerid,ID_DIALOG_WEAPONLIST,DIALOG_STYLE_LIST,"List of weapons:",listitems,"Select","Cancel");

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
   if(dialogid == ID_DIALOG_WEAPONLIST) {
        .........
So say you get 2 filterscripts with conflicting dialogids, just change the ID_DIALOG_BASE to a new number and it's all fixed.
ur thread is kinda dumb.
u should tell ppl to use different bases :P
much easier to change and easier to understand.
Quote:
Originally Posted by Donny
This is a list of the current dialog ids being used in released scripts, please make sure your id used doesn't conflict with the any ids on the current list:
What exactly is hard about reading a list and choosing a number which isn't on it ?

If you can't do that then wouldn't that make you the "dumb" one and not the thread ?
Reply
#58

Quote:
Originally Posted by Donny
What exactly is hard about reading a list and choosing a number which isn't on it ?
erm nutin but it's annoyin'
and my post wasn't meant to be offensive
but it's just useless
'cuz this way is just much easier.
there wouldnt be much conflicts cuz there are 2 variables:
the base and the dialogid

so theres no need of such a thread.

~SaiBerFun
Reply
#59

Dude we are doing it that way, what do you think those numbers are ?

They are the bases you are talking about and how are you going to control conflictions in base numbers without a list to know what other bases are. Everyone can't use the same base because if you have four dialogs and I have three then upto the fourth one they will all conflict, the only way you could fix this then is to look at all the other scripts and swap your id to be a unique number so why not have a list to check first so you can do it at the beggining and not have to mess about later ?

Also this is really off topic dude, this is the thread for the guys release not my thread about dialogs.
Reply
#60

Quote:
Originally Posted by Donny
Your id conflicts with Weapon Menu by V1ceC1ty.
Yeah i got to 1337 first :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)