[Include] [INC] Easy User Menu (EUM) v0.4 (Stable)
#41

Just tested it under Grand Larceny gamemode and it works, then in LVDM gamemode and it was not working. Very strange. I'll try to fix it.
Reply
#42

...and usually LVDM is the most basic GM.
Reply
#43

Quote:
Originally Posted by [R
HydraX ]
...and usually LVDM is the most basic GM.
I was pretty sure it works perfectly when I was releasing it because it worked under my custom build gamemode for about two weeks and under Grand Larceny gamemode too. Still I can't figure out what is wrong.
Reply
#44

I really hope it gets fixed, this is the best menu yet.
Reply
#45

[INC] Easy User Menu 0.4 is up now!
Please download the latest version of EUM include.

This version fixes problem with OnPlayerResponse that caused problems in 0.3 version.
Also, functions has been renamed, so please carefully read how to use EUM now.

New function list
pawn Код:
EUM_ShowForPlayer(playerid, id, title[], text[], optionRange = 0);
EUM_ShowForAll(id, title[], text[], optionRange = 0);
EUM_DestroyForPlayer(playerid);
EUM_DestroyForAll();
EUM_Indentify(playerid, id);
Callbacks
pawn Код:
OnPlayerResponse(playerid, option);
Informations
As you can see in function list, there are no more category and subcategory parameters as they are replaced by EUM ID now. You must use unique ID for every menu now to be able to indentify it later. More in Examples part of this post.

EUM is now allowing player to chat while player interactive menu is opened. It means that if player types one of valid options offered in menu, OnPlayerResponse callback will be called, and if player types number that menu didn't offered it will be like player is chatting. Also, if player types some text while player interactive menu is opened it will be like player is chatting too. Only valid numbers will be forwarded to OnPlayerResponse to be handled by that callback.

Examples
Simple menu
pawn Код:
EUM_ShowForPlayer(playerid, 1, "My title", "My text");
Player interactive menu
pawn Код:
EUM_ShowForPlayer(playerid, 2, "Character", "Are you male or female?~n~1. Male~n~2. Female", 2);
// You can see that latest parameter equals '2'. It means whats the maximum option
Now we need to put some 'effect' on it
pawn Код:
public OnPlayerResponse(playerid, option)
{
    if(EUM_Indentify(playerid, 2)) // if EUM id is 2
    {
        switch(option)
        {
            case 1: SendClientMessage(playerid, 0xFFFFFFFF, "Ok, so you are male.");
            case 2: SendClientMessage(playerid, 0xFFFFFFFF, "Ok, so you are female.");
        }
    }
    // EUM_DestroyForPlayer(playerid); // Uncomment this line if you want to close the menu after player chooses the option
    return 1;
}
NOTE: EUM now works with filterscripts too!
Reply
#46

Where i must to insert it ..

OnShadowInit();


ON GF and how i must do for it.
example i write /help and open the textdraw in text draw write a like this
/househelp
/gps
and other..
Reply
#47

pawn Код:
C:\Documents and Settings\beatrice levy\Desktop\Super Stuntages Backup\pawno\include\eum.inc(8) : fatal error 100: cannot read from file: "streamer.inc"

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
?
Reply
#48

You forgot to upload the most important include!
Reply
#49

Quote:
Originally Posted by [R
HydraX ]
You forgot to upload the most important include!
Fixed, and its not actually needed, removed now
Reply
#50

What is wrong here?
When I type a number, there is no effect. The box goes away.

pawn Код:
if(!strcmp(cmdtext, "/teles", true))
    {
        EUM_ShowForPlayer(playerid, 2, "Teleports", "Choose an option~n~1.  Stunts~n~2. Jumps~n~3. Parkour~n~4. Race~n~5. Other~n~6. Back", 6);
        return 1;
    }
pawn Код:
public OnPlayerResponse(playerid, option)
{
  if(EUM_Indentify(playerid, 2)) // New function EUM_Indentify - used to indentify the menu
  {
        switch(option) // lets switch between options
    {
      case 1: // option 1 - Stunts
      {
                EUM_ShowForPlayer(playerid, 3, "Teleports", "Choose an option~n~1. DAM~n~2. LV Stunts~n~3. LS Stunts~n~4. SF Stunts~n~5. Chilliad Stunts~n~6. Back", 6);
      }
      case 2: // option 2 - Jumps
      {
        EUM_ShowForPlayer(playerid, 4, "Teleports", "Choose an option~n~1. LS Jump~n~2. SF Jump~n~3. LV Jump~n~4. AA Jump~n~5. Pier Jump~n~6. Dam Jump~n~7. Huge Jump~n~8. Water Jump~n~9. Back", 6);
      }
      case 3: // option 3 - Parkour
      {
                EUM_ShowForPlayer(playerid, 5, "Teleports", "Choose an option~n~1. Parkour 1 (Very Easy)~n~2. Parkour 2 (Easy)~n~3. Parkour 3 (Medium)~n~4. Parkour 4 (Hard)~n~5. Parkour 5 (Very Hard)~n~6. Back", 6);
      }
      case 4: // option 4 - Race
      {
                EUM_ShowForPlayer(playerid, 6, "Teleports", "Choose an option~n~1. SF Race~n~2. LV Race~n~3. Monster Race~n~4. Off Road Race~n~5. Drag Race~n~6. Back", 6);
      }
      case 5: // option 5 - Other
      {
                EUM_ShowForPlayer(playerid, 7, "Teleports", "Choose an option~n~1. Liberty City~n~2. San Fierro Airport~n~3. Area 51~n~4. Abandon Airport~n~5. Los Santos Airport~n~6. Back", 6);
      }
      case 6: // option 6 - Back
      {
                EUM_ShowForPlayer(playerid, 8, "Teleports", "Choose an option~n~1. DAM~n~2. LV Stunts~n~3. LS Stunts~n~4. SF Stunts~n~5. Chilliad Stunts~n~6. Back", 6);
      }
    }
  }
  EUM_DestroyForPlayer(playerid); // After choosing an option, we hide 'message box'
  return 1;
}
Reply
#51

Remove
pawn Код:
EUM_DestroyForPlayer(playerid); // After choosing an option, we hide 'message box'
Use that only when you want to close box after choosing an option. Namely, there is problem with your code that if you choose an option another box shows up and then it closes. Just remove it.
Reply
#52

So there is no need for it?
Reply
#53

Quote:
Originally Posted by [R
HydraX ]
So there is no need for it?
No if you're showing up new menu. You use that only if you want to hide menu from player when he chooses an option. For example I use message box hiding when effect is something like GivePlayerMoney/Weapon etc. Got it?
Reply
#54

Yeap. it works now. Thanks
Reply
#55

Quote:
Originally Posted by [R
HydraX ]
Yeap. it works now. Thanks
No problem. But as I can see in your code, there is no logic on Back option. It will not do anything. If you need help with it just tell me.
Reply
#56

thanks alot it's working now.
Reply
#57

Nice, altought if someone uses a bit too much text formatting (~n~ ~r~ etc..), it will crash. You could count these and if it reaches the limit then create a new textdraw for it.
Reply
#58

Quote:
Originally Posted by bpeterson
Nice, altought if someone uses a bit too much text formatting (~n~ ~r~ etc..), it will crash. You could count these and if it reaches the limit then create a new textdraw for it.
I know. Textdraw text is currently defined to max 768 chars I think (EUM_MAX_STRING). I'm not sure if theres limitation for textdraw in SA-MP. Is there?
You can simply redefine max string size if theres no limitation in SA-MP, but if there is then you would need to create multiple textdraws. Maybe in next version.

pawn Код:
#define EUM_MAX_STRING 1024 // for example
#include <eum>
Reply
#59

Textdraws Limit
String Length 1024 characters
Shown In A Single Client's Screen 92
Created Serverwise 2048

So I have to change it to 1024 since it is the max.
1024 is the max.
Reply
#60

Quote:
Originally Posted by [R
HydraX ]
Textdraws Limit
String Length 1024 characters
Shown In A Single Client's Screen 92
Created Serverwise 2048

So I have to change it to 1024 since it is the max.
1024 is the max.
No need if you have menus with no much chars in it. It will be faster like this in compiling.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)