Raised This Month: $ Target: $400
 0% 

Admin Only print_chat help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 05-28-2006 , 10:55  
Reply With Quote #5

Quote:
Originally Posted by SweatyBanana
Like so:

Code:
        new players[32];         get_players(players,g_num,"c")         for(new GABEN = 0; GABEN < g_num; GABEN++)         {             new GABENadmin = players[GABEN]             if(is_user_admin(GABENadmin))             {                 client_print(id,print_chat,"text for admin %s",command)                 server_print("text for admin %s",command)                           }         }
Stop using "GABEN" as variable names. It's not funny, and it makes it harder to read.

There were also a couple of errors in that script. Here's a fixed and more readable version:

Code:
new iPlayers[32],iPlayersnum,iPlayer get_players(iPlayers,iPlayersnum,"c") for(new iCount = 0;iCount < iPlayersnum;iCount++) {     iPlayer = iPlayers[iCount]     if(is_user_admin(iPlayer))     {         client_print(iPlayer,print_chat,"text for admin %s",command)         server_print("text for admin %s",command)                   } }
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
 



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 16:32.


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