AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Get all players's names to a menu (https://forums.alliedmods.net/showthread.php?t=276715)

uurbyrkdr 12-26-2015 20:04

Get all players's names to a menu
 
How can i do this?

Dr. Greg House 12-26-2015 20:08

Re: Get all players's names to a menu
 
https://sm.alliedmods.net/api/index.php?fastload=show&id=148

KissLick 12-27-2015 09:28

Re: Get all players's names to a menu
 
The easiest way is to search Google, SM forum, SM API site (not necessary in this order).

Phil25 12-29-2015 04:11

Re: Get all players's names to a menu
 
I usually do it the 'manual' way. That way, you could include some additonal functionality.

PHP Code:

new Handle:hMenu CreateMenu(Manager);

SetMenuTitle(hMenu"Wierdos on this Server:");

AddMenuItem(hMenu"mark""Mark All");
AddMenuItem(hMenu"unmark""Unmark All");

new 
String:sClientIndex[4], sClientName[MAX_NAME_LENGTH+8];
for(new 
1<= MaxClientsi++){    //Loop through all the client indexes

    
if(!IsClientInGame(i) || IsFakeClient(i)) continue; //Skip the ones which aren't actual players

    
IntToString(isClientIndexsizeof(sClientIndex));
    
Format(sClientNamesizeof(sClientName), "%s %N"bIsWierdo[i] ? "[✓]" "[  ]"client);

    
AddMenuItem(hMenusClientIndexsClientName);



Just a heads up, the above is untested.

uurbyrkdr 01-01-2016 15:48

Re: Get all players's names to a menu
 
Quote:

Originally Posted by Phil25 (Post 2377582)
I usually do it the 'manual' way. That way, you could include some additonal functionality.

PHP Code:

new Handle:hMenu CreateMenu(Manager);

SetMenuTitle(hMenu"Wierdos on this Server:");

AddMenuItem(hMenu"mark""Mark All");
AddMenuItem(hMenu"unmark""Unmark All");

new 
String:sClientIndex[4], sClientName[MAX_NAME_LENGTH+8];
for(new 
1<= MaxClientsi++){    //Loop through all the client indexes

    
if(!IsClientInGame(i) || IsFakeClient(i)) continue; //Skip the ones which aren't actual players

    
IntToString(isClientIndexsizeof(sClientIndex));
    
Format(sClientNamesizeof(sClientName), "%s %N"bIsWierdo[i] ? "[✓]" "[  ]"client);

    
AddMenuItem(hMenusClientIndexsClientName);



Just a heads up, the above is untested.

it's works, thank you!


All times are GMT -4. The time now is 09:56.

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