Raised This Month: $51 Target: $400
 12% 

Menu that shows all online player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TwiZzy_Adam
New Member
Join Date: Mar 2023
Old 03-05-2023 , 21:21   Menu that shows all online player
Reply With Quote #1

Hey, I'm new here, started learning Sourcepawn like 3 days ago, I was searching a solution for my question but I didn't found..
I tried all, made an for() function for get the all online users (include bots), and didn't understood what I have to do..
Sorry about my English.. Someone can help me?
TwiZzy_Adam is offline
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 03-05-2023 , 22:50   Re: Menu that shows all online player
Reply With Quote #2

To get all players try doing something like this:
PHP Code:
for(int i 1i<= MaxClientsi++)
{
    if(
IsClientInGame(i))
    {
        
PrintToServer("Players in the Game:");
        
PrintToServer("--------------------");
        
PrintToServer("%N"i);
    }

PC Gamer is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 03-07-2023 , 10:40   Re: Menu that shows all online player
Reply With Quote #3

Quote:
Originally Posted by PC Gamer View Post
To get all players try doing something like this:
Maybe it's better like this?
PHP Code:
PrintToServer("Players in the Game:");
PrintToServer("--------------------");
for(
int i 1<= MaxClientsi++) if(IsClientInGame(i)) PrintToServer("%N"i); 
__________________

Last edited by Grey83; 03-07-2023 at 10:40.
Grey83 is offline
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 03-07-2023 , 20:12   Re: Menu that shows all online player
Reply With Quote #4

Good catch. Thanks Grey83!
PC Gamer is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:22.


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