AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved [HELP] VoteKick Menu (https://forums.alliedmods.net/showthread.php?t=295980)

DarthMan 04-09-2017 14:54

[HELP] VoteKick Menu
 
Code:

menu_item_getinfo( menu_kick, item, callback, szData, charsmax( szData ), szPlayerName, charsmax( szPlayerName ), callback );
How can I get the userid of szPlayerName?
get_user_useerid requires me to put the array size on it because szPlayerName has an array size.
Thanks!

DarthMan 04-10-2017 13:37

Re: [HELP] VoteKick Menu
 
My problem have been finally solved.

LegacyCode 04-10-2017 14:03

Re: [HELP] VoteKick Menu
 
Quote:

Originally Posted by DarthMan (Post 2510994)
My problem have been finally solved.

Would be nice to post your solution, too.

- LegacyCode

DarthMan 04-10-2017 15:34

Re: [HELP] VoteKick Menu
 
Quote:

Originally Posted by LegacyCode (Post 2511004)
Would be nice to post your solution, too.

- LegacyCode

Well, shure. A good friend helped me, here is what solved my problem.

Code:

get_user_name(i,szPlayerName,charsmax(szPlayerName))
new userid_as_string[16];
num_to_str(get_user_userid(i), userid_as_string, charsmax(userid_as_string));
menu_additem(menu_kick, szPlayerName, userid_as_string, 0);

And then I just used menu_item_getinfo to get the userid_as_string info from szData.

LegacyCode 04-10-2017 16:07

Re: [HELP] VoteKick Menu
 
Quote:

Originally Posted by DarthMan (Post 2511041)
Well, shure. A good friend helped me, here is what solved my problem.

Code:

get_user_name(i,szPlayerName,charsmax(szPlayerName))
new userid_as_string[16];
num_to_str(get_user_userid(i), userid_as_string, charsmax(userid_as_string));
menu_additem(menu_kick, szPlayerName, userid_as_string, 0);

And then I just used menu_item_getinfo to get the userid_as_string info from szData.

Thank you! Also, mark your thread as "solved" by editing the title and set the prefix to [SOLVED] :bee:

- LegacyCode


All times are GMT -4. The time now is 18:02.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.