AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   GET ID (https://forums.alliedmods.net/showthread.php?t=308931)

jonatat 07-08-2018 09:18

GET ID
 
I have a menu with current players in server. How can i take player STEAMID? Now i'm getting only my STEAMID not choosed player. My code:

PHP Code:

public showstats(id

new 
players[32], numszName[32], gt 
new statsmenu menu_create("CURRENT PLAYERS IN SERVER""showstats_exit"
get_players(playersnum); 
for(new 
i=0;i<num;i++) 

get_user_name(players[i], szNamecharsmax(szName)) 
gt players[i]
if(
get_user_flags(gt)) 

formatex(szNamecharsmax(szName), "%s"szName
menu_additem(statsmenuszName

menu_setprop(statsmenu,MPROP_EXITNAME,"Quit")
}
menu_display(idstatsmenu)
return 
PLUGIN_HANDLED;
}

public 
showstatsmenu(id

new 
szName[32]
new 
playerstatsmenu menu_create("Player STEAMID""showstats_exit"
new 
auth[32]; 
get_user_authid(idauthsizeof (auth));

formatex(szNamecharsmax(auth), "STEAM ID: %s"auth[id]) 
menu_addtext2(playerstatsmenuauth

menu_setprop(playerstatsmenu,MPROP_EXITNAME,"Quit")
menu_display(idplayerstatsmenu)
return 
PLUGIN_HANDLED;


I want:

CURRENT PLAYERS IN SERVER MENIU:

1) Player1
2) Player2
3) Player3
and etc.

I choosed: Player 1 by pressing 1 and get another meniu with:

Choosed Player 1 menu:

STEAM ID: STEAM_0:0:1234543

Thanks for helping!

^SmileY 07-08-2018 11:07

Re: menu_create GET STEAMID
 
what is the exactly purpose of that?

jonatat 07-08-2018 11:13

Re: menu_create GET STEAMID
 
Quote:

Originally Posted by ^SmileY (Post 2601983)
what is the exactly purpose of that?

To get selected user steamid and more stuff :)

CrazY. 07-08-2018 11:33

Re: menu_create GET STEAMID
 
Spoiler

JocAnis 07-08-2018 15:02

Re: menu_create GET STEAMID
 
@crazy:

PHP Code:

if (pevPlayer == this)
            continue; 

is it really necessary? if so, can u explain what does it mean, im interested

jonatat 07-08-2018 15:05

Re: menu_create GET STEAMID
 
Quote:

Originally Posted by JocAnis (Post 2602057)
@crazy:

PHP Code:

if (pevPlayer == this)
            continue; 

is it really necessary? if so, can u explain what does it mean, im interested

This is do not show player who writen /command

TheWhitesmith 07-08-2018 21:32

Re: menu_create GET STEAMID
 
Quote:

Originally Posted by JocAnis (Post 2602057)
@crazy:

PHP Code:

if (pevPlayer == this)
            continue; 

is it really necessary? if so, can u explain what does it mean, im interested

Pretty sure to not show the player's steamid in the menu, since he wants other's infos not his.

^SmileY 07-08-2018 21:59

Re: menu_create GET STEAMID
 
Again, what he need to do with Steam or player, also you need to know if player is connected or not to get more correctly code here

JocAnis 07-09-2018 14:48

Re: menu_create GET STEAMID
 
a ok..cuz i thought continue would just continue everything, and couldnt think why then to ask that haha


All times are GMT -4. The time now is 12:31.

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