AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   register_textmsg (https://forums.alliedmods.net/showthread.php?t=250376)

Administrator 10-23-2014 13:09

register_textmsg
 
Hello!
Advice please, please write to all players?
PHP Code:

#include <amxmodx>

#define PLUGIN "Switch Fire Hud"
#define VERSION "1.0"
#define AUTHOR "BeasT"

new max_clients

public plugin_init()
{
    
register_plugin PLUGINVERSIONAUTHOR )
    
register_message(get_user_msgid("TextMsg"), "msgTextMsg")
    
max_clients get_maxplayers()
}

public 
msgTextMsg()
{
for(new 
1<= max_clientsi++)
{
    static 
textmsg[22]
    
get_msg_arg_string(2textmsgcharsmax(textmsg))
    
    if(
equal(textmsg"#Switch_To_FullAuto"))
    {
    
set_hudmessage (02550, -1.00.3506.01.50.10.2)
    
show_hudmessage(i"Режим автомата")
    }
    else
    if(
equal(textmsg"#Switch_To_BurstFire"))
    {
    
set_hudmessage (02550, -1.00.3506.01.50.10.2)
    
show_hudmessage(i"Режим тройного выстрела")
    }
    else
    if(
equal(textmsg"#Switch_To_SemiAuto"))
    {
    
set_hudmessage (02550, -1.00.3506.01.50.10.2)
    
show_hudmessage(i"Режим автомата")
    }
}
return 
PLUGIN_HANDLED



Administrator 10-23-2014 14:01

Re: register_textmsg
 
thank, made himself)

HamletEagle 10-23-2014 14:03

Re: register_textmsg
 
Don't make a for and use 0 as index. Also, use get_players to loop all players.


All times are GMT -4. The time now is 17:34.

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