Thread: [Solved] string format question
View Single Post
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-03-2021 , 22:16   Re: string format question
Reply With Quote #6

I edited my last post stating that I think Napoleon_be's suggestion is the way you should probably do it here for simplicity. This is what he was saying:

Code:
formatex(szData, charsmax(szData), "^"%s^" ^"%s^" %i", clanname, clantag, inviterid);
Then you can remove the replace_all() entirely and just use the parse() on szData.

Also, it looks like your player menu is not done correctly because you are using "item" (plus 1) as the player index which will not work.

So, I'd recommend that you send only the userid (get_user_userid()) and then use find_player_ex() to find the proper player index (just in case that player leaves between the player menu being opened and its menu handler being executed). Just remember that you need to include the "#" before the userid so that find_players_ex() will work with the FindPlayer_MatchUserId flag.

For example, your menu item data should simply be "#123" where 123 is the userid.
__________________

Last edited by fysiks; 10-03-2021 at 22:40.
fysiks is offline