TextMenuShowForPlayer(playerid,menuid,header[],content[],items=0)
TextMenuHideForPlayer(playerid)
forward OnTextMenuResponse(playerid,menuid,listitem);
CMD:test(playerid)
{
new Test[600],bool:necessary = true;
if(necessary)
{
strcat(Test,"~y~1-~w~ Message 1~n~");
strcat(Test,"~y~2-~w~ Message 2~n~");
strcat(Test,"~y~3-~w~ Message 3~n~");
strcat(Test,"~y~4-~w~ Message 4~n~");
strcat(Test,"~y~5-~w~ Message 5~n~");
strcat(Test,"~y~6-~w~ Message 6");
necessary = false;
}
TextMenuShowForPlayer(playerid,0,"Items",Test,6);
return 1;
}
public OnTextMenuResponse(playerid,menuid,listitem)
{
if(menuid == 0)
{
switch(listitem)
{
case 1:
{
//Your stuff
}
case 2:
{
//Your stuff
}
case 3:
{
//Your stuff
}
case 4:
{
//Your stuff
}
case 5:
{
//Your stuff
}
case 6:
{
//Your stuff
}
}
}
return 1;
}
new Test[600]; strcat(Test,"~y~1-~w~ Message 1~n~"); strcat(Test,"~y~2-~w~ Message 2~n~"); strcat(Test,"~y~3-~w~ Message 3~n~"); strcat(Test,"~y~4-~w~ Message 4~n~"); strcat(Test,"~y~5-~w~ Message 5~n~"); strcat(Test,"~y~6-~w~ Message 6"); TextMenuShowForPlayer(playerid,0,"Items",Test,6);
TextMenuShowForPlayer(playerid,0,"Items","~y~1-~w~ Message 1~n~~y~2-~w~ Message 2~n~~y~3-~w~ Message 3~n~~y~4-~w~ Message 4~n~~y~5-~w~ Message 5~n~~y~6-~w~ Message 6",6);
static Test[600], bool:need_format = true; if(need_format) { strcat(Test,"~y~1-~w~ Message 1~n~"); strcat(Test,"~y~2-~w~ Message 2~n~"); strcat(Test,"~y~3-~w~ Message 3~n~"); strcat(Test,"~y~4-~w~ Message 4~n~"); strcat(Test,"~y~5-~w~ Message 5~n~"); strcat(Test,"~y~6-~w~ Message 6"); need_format = false; } TextMenuShowForPlayer(playerid,0,"Items",Test,6);
There are a lot of people who will copy your example code and use it.
Код:
new Test[600]; strcat(Test,"~y~1-~w~ Message 1~n~"); strcat(Test,"~y~2-~w~ Message 2~n~"); strcat(Test,"~y~3-~w~ Message 3~n~"); strcat(Test,"~y~4-~w~ Message 4~n~"); strcat(Test,"~y~5-~w~ Message 5~n~"); strcat(Test,"~y~6-~w~ Message 6"); TextMenuShowForPlayer(playerid,0,"Items",Test,6); Код:
TextMenuShowForPlayer(playerid,0,"Items","~y~1-~w~ Message 1~n~~y~2-~w~ Message 2~n~~y~3-~w~ Message 3~n~~y~4-~w~ Message 4~n~~y~5-~w~ Message 5~n~~y~6-~w~ Message 6",6); Код:
static Test[600], bool:need_format = true; if(need_format) { strcat(Test,"~y~1-~w~ Message 1~n~"); strcat(Test,"~y~2-~w~ Message 2~n~"); strcat(Test,"~y~3-~w~ Message 3~n~"); strcat(Test,"~y~4-~w~ Message 4~n~"); strcat(Test,"~y~5-~w~ Message 5~n~"); strcat(Test,"~y~6-~w~ Message 6"); need_format = true; } TextMenuShowForPlayer(playerid,0,"Items",Test,6); |
Nice include.
Tell us in which year we are at, and when you do, do not reply back. Funniest thing is that you tried to correct him, yet you have done a mistake in your own example. Do you expect people to use it now? |
Tell us in which year we are at, and when you do, do not reply back.
Funniest thing is that you tried to correct him, yet you have done a mistake in your own example. Do you expect people to use it now? |
Dude, what's wrong with you? He just tried to correct my example.
@Yashas, thanks mate, just fixed it. |
It must be 'static' variables. Static variables are like global variables. They don't loose the information they hold when the function terminates.
|
Why does it appear on the far most right? I expected it to appear in the left, right? So I was thinking to change the position of the textdraws, but I don't know how. Here's the include. [click_me]
PS: If you have time to teach me how, it'd be a great help. EDIT: Or if it really is in the right, I'm not sure about this error: |