Thread: Loop And Menu
View Single Post
Awesome_man
Senior Member
Join Date: May 2014
Location: singapore
Old 12-29-2018 , 23:14   Re: Loop And Menu
Reply With Quote #3

Quote:
Originally Posted by Ghosted View Post
1. You've passed only one argument in string formation.
Code:
 format(text, 31, "%s - %s", name)
2. You have 'c' flag in get_players which means you wont get bots
so using is_user_bot is not required in handler, but you
should use is_user_connected cause before selecting an item
from menu (target) player may disconnect from the game

================
For efficiency do not convert player index to string and vice versa.
Use following style:

=> SET
new ItemInfo[2];
ItemInfo[0] = <PlayerIndex>;
menu_additem(...., ...., ItemInfo, ...)
=> GET
new ItemInfo[2];
menu_item_getinfo(..., ..., ..., ItemInfo, charsmax(ItemInfo), ....);
<PlayerIndex> = ItemInfo[0];
can you please show this in main code i'm very beginner in scripting and trying my best but it's somehow not working. Thank you
Awesome_man is offline