16.06.2010, 18:43
[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
Callbacks
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
Player interactive menu
Now we need to put some 'effect' on it
NOTE: EUM now works with filterscripts too!
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);
pawn Код:
OnPlayerResponse(playerid, option);
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");
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
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;
}