View Single Post
Phil25
AlliedModders Donor
Join Date: Feb 2015
Old 12-29-2015 , 04:11   Re: Get all players's names to a menu
Reply With Quote #4

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.

Last edited by Phil25; 12-29-2015 at 04:13.
Phil25 is offline