11.06.2010, 16:20
(
Последний раз редактировалось Luka P.; 16.02.2011 в 16:13.
)
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
Callbacks
Example of normal message
Simple menu
Player interactive menu
Now we need to put some 'effect' on it
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.
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);
pawn Код:
OnPlayerResponse(playerid, option); // Where chosen is option that player provided
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;
}
[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.