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

Informations
Easy User Menu is a simple set of functions that can create an player interactive message box (using textdraw methods). Only problem is that it can work only in gamemodes, but not in filterscripts. There is a function that gets called (callback) every time player provides a valid option if available. What I want to say is that you can create normal messagees and player interactive messages.

Functions
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); // Where chosen is option that player provided
Example of normal message
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;
}
Download
[INC] Easy User Menu 0.4 Package (Solidfiles.com)

Screenshots
Note that this are screenshots from v0.2a, but theres nothing changed in textdraw style, just scripting.




Reply
#2

Cool , i like it .. keep up the good work
Reply
#3

Quote:
Originally Posted by H ❽ H
Cool , i like it .. keep up the good work
Thanks
Reply
#4

Good work!
Reply
#5

awesome
Reply
#6

Thanks guys (or girlz idk lol)
Reply
#7

Nice

SACNR got the idea from CrazyBob's Cops And Robbers (CBCNR) tho
Reply
#8

Quote:
Originally Posted by [03
Garsino ]
Nice

SACNR got the idea from CrazyBob's Cops And Robbers (CBCNR) tho
Wow, didn't know it, it seems its popular
Thanks by the way.
Reply
#9

Nice include, but how you Chose the Obtion? Per mouse klick or per Arrows or per Number 1-3?
Reply
#10

Quote:
Originally Posted by DurtyFree
Nice include, but how you Chose the Obtion? Per mouse klick or per Arrows or per Number 1-3?
You can have as much options as you want - there is ShowPlayerInformation function that consists of input and inputrange parameter.
Player TYPES NUMBER into chat and then he chooses some option. If you're going to use options you need to set input parameter to 1 and inputrange to max number of options. So for example, I want
to allow player to choose 5 options. Then I'll do

pawn Код:
ShowPlayerInformation(playerid, "Some title", "Here is text, choose one of five options..~n~1. Option 1~n~2. Option 2~n~3. Option 3~n~4. Option 4~n~Option 5", "mycategory", "mysubcategory", 1, 5);
Notice latest two parameters (values '1', '5') - 1 means that options are enabled and 5 is option range or max option.
Then you could indentify it like

pawn Код:
public OnPlayerMsgBoxResponse(playerid, chosen)
{
    if(!strcmp(GetInformationCategory(playerid), "mycategory") && !strcmp(GetInformationSubcategory(playerid), "mysubcategory))
    {
        switch(chosen)
        {
            case 1:
            {
                SendClientMessage(playerid, color, "
This is option 1 - you got $500000!");
                GivePlayerMoney(playerid, 500000);
            }
            case 2:
            {
                SendClientMessage(playerid, color, "
This is option 2 - you got +7 score);
                SetPlayerScore(playerid, GetPlayerScore(playerid)+7);
            }
            // also up to case 5.. case 1, case 2, case 3, case 4, case 5...
        }
    }
    return 1;
}
I hope you understand it now...
Reply
#11

Very nice, Luka!
Reply
#12

Quote:
Originally Posted by DarkPhoenix
Very nice, Luka!
Thanks
Reply
#13

nice script dude
Reply
#14

Very nice!
Reply
#15

Awesome script man
Gonna try this out :P
Reply
#16

Quote:
Originally Posted by fŁa§ethrower
nice script dude
Quote:
Originally Posted by Dongotti
Very nice!
Quote:
Originally Posted by ViruZZzZ_ChiLLL
Awesome script man
Gonna try this out :P
Thanks
Reply
#17

cool dood

Reply
#18

Quote:
Originally Posted by ||-[NG
-MrBaff-|| ]
cool dood

dood?
Reply
#19

I made an example script for you to better understand how it works.
http://pastebin.com/agJhqA9K

(Deleted because it is not compatible with EUM 0.3)
Reply
#20

I make something like this before but this seems better then mine, nice Luka
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)