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

Solved Print to all not just id or user


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
4ever16
Veteran Member
Join Date: Apr 2015
Old 04-22-2018 , 15:02   Print to all not just id or user
Reply With Quote #1

PHP Code:
public print_adminlist(user
PHP Code:
print_message(usermessage
PHP Code:
len format(message255"%s ",COLOR
PHP Code:
print_message(idmsg[]) {
    
message_begin(MSG_ONEgmsgSayText, {0,0,0}, id)
    
write_byte(id)
    
write_string(msg)
    
message_end()

What the right command instead of user?
I want to print that shit to all not just the current user.

Last edited by 4ever16; 04-25-2018 at 15:34.
4ever16 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-22-2018 , 15:08   Re: Print to all not just id or user
Reply With Quote #2

It depends on the code so you need to post the code for that function.
__________________
fysiks is offline
4ever16
Veteran Member
Join Date: Apr 2015
Old 04-22-2018 , 15:11   Re: Print to all not just id or user
Reply With Quote #3

Updated the first post.
4ever16 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-22-2018 , 15:12   Re: Print to all not just id or user
Reply With Quote #4

That was not useful at all.

The only answer without the code is to try it. Either use 0 or loop through all players.
__________________

Last edited by fysiks; 04-22-2018 at 15:13.
fysiks is offline
4ever16
Veteran Member
Join Date: Apr 2015
Old 04-22-2018 , 15:13   Re: Print to all not just id or user
Reply With Quote #5

Updated again and thats the only shit that i got which prints out.

Last edited by 4ever16; 04-22-2018 at 15:24.
4ever16 is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-22-2018 , 15:30   Re: Print to all not just id or user
Reply With Quote #6

in this case you loop through all players
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
4ever16
Veteran Member
Join Date: Apr 2015
Old 04-23-2018 , 06:36   Re: Print to all not just id or user
Reply With Quote #7

Quote:
Originally Posted by Napoleon_be View Post
in this case you loop through all players
Loop not loop i dont understand what you mean.
Can u provide me with a link or a code?
4ever16 is offline
THC420
Junior Member
Join Date: Apr 2018
Old 04-23-2018 , 13:56   Re: Print to all not just id or user
Reply With Quote #8

PHP Code:
for (new id 1id <= g_maxplayersid++)
    {
        
print_message(idmessage)  

THC420 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-23-2018 , 18:03   Re: Print to all not just id or user
Reply With Quote #9

@THC420 that is wrong and will error if the server is not full.

@4ever16 who is the current user? explain what you are trying to do.
__________________
Bugsy is offline
4ever16
Veteran Member
Join Date: Apr 2015
Old 04-24-2018 , 01:44   Re: Print to all not just id or user
Reply With Quote #10

When someone writes .admin /admin it prints current admin online to the player.
I want it to print it out to everyone not just the current player who write .admin so everyone can see it.

This is the source plugin (Admin check): https://forums.alliedmods.net/showthread.php?p=230189

PHP Code:
#include <amxmodx>

/*---------------EDIT ME------------------*/
#define ADMIN_CHECK ADMIN_KICK

static const COLOR[] = "^x04" //green
static const CONTACT[] = ""
/*----------------------------------------*/

new maxplayers
new gmsgSayText

public plugin_init() {
    
register_plugin("Admin Check""1.51""OneEyed")
    
maxplayers get_maxplayers()
    
gmsgSayText get_user_msgid("SayText")
    
register_clcmd("say""handle_say")
    
register_cvar("amx_contactinfo"CONTACTFCVAR_SERVER)
}

public 
handle_say(id) {
    new 
said[192]
    
read_args(said,192)
    if( ( 
containi(said"who") != -&& containi(said"admin") != -) || contain(said"/admin") != -)
        
set_task(0.1,"print_adminlist",id)
    return 
PLUGIN_CONTINUE
}

public 
print_adminlist(user
{
    new 
adminnames[33][32]
    new 
message[256]
    new 
contactinfo[256], contact[112]
    new 
idcountxlen
    
    
for(id id <= maxplayers id++)
        if(
is_user_connected(id))
            if(
get_user_flags(id) & ADMIN_CHECK)
                
get_user_name(idadminnames[count++], 31)

    
len format(message255"%s ADMINS ONLINE: ",COLOR)
    if(
count 0) {
        for(
count x++) {
            
len += format(message[len], 255-len"%s%s "adminnames[x], < (count-1) ? ", ":"")
            if(
len 96 ) {
                
print_message(usermessage)
                
len format(message255"%s ",COLOR)
            }
        }
        
print_message(usermessage)
    }
    else {
        
len += format(message[len], 255-len"No admins online.")
        
print_message(usermessage)
    }
    
    
get_cvar_string("amx_contactinfo"contact63)
    if(
contact[0])  {
        
format(contactinfo111"%s Contact Server Admin -- %s"COLORcontact)
        
print_message(usercontactinfo)
    }
}

print_message(idmsg[]) {
    
message_begin(MSG_ONEgmsgSayText, {0,0,0}, id)
    
write_byte(id)
    
write_string(msg)
    
message_end()

4ever16 is offline
Reply


Thread Tools
Display Modes

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 14:23.


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