[INC] Easy User Menu (EUM) v0.4 (Stable) -
Luka P. - 11.06.2010
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.
Re: [INC] Easy User Menu (EUM) v0.2a -
aircombat - 11.06.2010
Cool , i like it ..
keep up the good work
Re: [INC] Easy User Menu (EUM) v0.2a -
Luka P. - 11.06.2010
Quote:
Originally Posted by H ❽ H
Cool , i like it .. keep up the good work
|
Thanks
Re: [INC] Easy User Menu (EUM) v0.2a -
JesterX - 11.06.2010
Good work!
Re: [INC] Easy User Menu (EUM) v0.2a -
vyper - 11.06.2010
awesome
Re: [INC] Easy User Menu (EUM) v0.2a -
Luka P. - 11.06.2010
Thanks guys (or girlz idk lol)
Re: [INC] Easy User Menu (EUM) v0.2a - [03]Garsino - 11.06.2010
Nice
SACNR got the idea from CrazyBob's Cops And Robbers (CBCNR) tho
Re: [INC] Easy User Menu (EUM) v0.2a -
Luka P. - 11.06.2010
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.
Re: [INC] Easy User Menu (EUM) v0.2a -
asdfgh98 - 11.06.2010
Nice include, but how you Chose the Obtion? Per mouse klick or per Arrows or per Number 1-3?
Re: [INC] Easy User Menu (EUM) v0.2a -
Luka P. - 11.06.2010
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...
Re: [INC] Easy User Menu (EUM) v0.2a -
Andy_McKinley - 11.06.2010
Very nice, Luka!
Re: [INC] Easy User Menu (EUM) v0.2a -
Luka P. - 11.06.2010
Quote:
Originally Posted by DarkPhoenix
Very nice, Luka!
|
Thanks
Re: [INC] Easy User Menu (EUM) v0.2a -
king s dm - 11.06.2010
nice script dude
Re: [INC] Easy User Menu (EUM) v0.2a -
Dongotti - 12.06.2010
Very nice!
Re: [INC] Easy User Menu (EUM) v0.2a -
ViruZZzZ_ChiLLL - 12.06.2010
Awesome script man
Gonna try this out :P
Re: [INC] Easy User Menu (EUM) v0.2a -
Luka P. - 12.06.2010
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
Re: [INC] Easy User Menu (EUM) v0.2a -
Baff - 12.06.2010
cool dood
Re: [INC] Easy User Menu (EUM) v0.2a -
Luka P. - 12.06.2010
Quote:
Originally Posted by ||-[NG
-MrBaff-|| ]
cool dood
|
dood?
Re: [INC] Easy User Menu (EUM) v0.2a -
Luka P. - 12.06.2010
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)
Re: [INC] Easy User Menu (EUM) v0.2a -
DarkPower - 12.06.2010
I make something like this before but this seems better then mine, nice Luka