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

Solved Print to all not just id or user


Post New Thread Reply   
 
Thread Tools Display Modes
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-24-2018 , 08:32   Re: Print to all not just id or user
Reply With Quote #11

Use 0 instead of specifying user.
__________________
Bugsy is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-25-2018 , 11:40   Re: Print to all not just id or user
Reply With Quote #12

Quote:
Originally Posted by THC420 View Post
PHP Code:
for (new id 1id <= g_maxplayersid++)
    {
        
print_message(idmessage)  

Never use that to loop through all players, this is the correct way.

Code:
new players[32], inum, id get_players(players, inum) for(new i; i < inum; i++) {     id = players[i]     client_print(id, print_chat, "Message") }
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
4ever16
Veteran Member
Join Date: Apr 2015
Old 04-25-2018 , 15:34   Re: Print to all not just id or user
Reply With Quote #13

Thanks!
4ever16 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 15:21.


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