View Single Post
pupdebox
Senior Member
Join Date: Feb 2016
Location: Wakanda
Old 09-11-2016 , 07:09   Re: [REQ] /complaint like say_team @
Reply With Quote #6

PHP Code:
#include <amxmodx>
new g_maxplayers
new bool:gsent

public plugin_init() {
    
register_clcmd("say","hooksay")
    
register_clcmd("say_team","hooksay")
    
g_maxplayers get_maxplayers()
}

public 
hooksay(id)
{
    new 
args[192]
    
read_args(argscharsmax(args))
    
remove_quotes(args)    // take the raw string
    
    
if(equali(args,"/complaint",10))
    {
        new 
cmd[33], argm[192], szname[33]
        
get_user_name(id,szname,charsmax(szname))
        
strbreak(argscmd31argm191)
        if(!
strlen(argm)){
            
client_printc(id,"!g[COMPLAINT] !nYou didn't type any complaints.")
            return 
PLUGIN_HANDLED
        
}
        
        for(new 
i<= g_maxplayersi++)
        {
            if(
get_user_flags(i) & ADMIN_KICK && is_user_connected(i)){
                
client_printc(i,"!g[COMPLAINT] !t%s: !n%s",szname,argm)
                
client_cmd(i,"spk buttons/blip1")
                
gsent true
            
}
        }
        
        if(
gsent){
            
client_printc(id,"!g[COMPLAINT] !nYour complaint has been sent successfuly.")
            
gsent false
        
}
        else
            
client_printc(id,"!g[COMPLAINT] !nFailed. No admins online.")
        
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_CONTINUE
}

stock client_printc(const id, const input[], any:...) 

    new 
count 1players[32]; 
    static 
msg[191]; 
    
vformat(msg190input3); 
    
    
replace_all(msg190"!n""^x01");
    
replace_all(msg190"!g""^x04");     
    
replace_all(msg190"!t""^x03");
    
    if (
idplayers[0] = id; else get_players(playerscount"ch"); { 
        for (new 
0counti++) 
        { 
            if (
is_user_connected(players[i])) 
            { 
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i]); 
                
write_byte(players[i]); 
                
write_string(msg); 
                
message_end(); 
            } 
        } 
    } 

__________________
Quote:
Originally Posted by wickedd View Post
Make me or STFU boy

Last edited by pupdebox; 09-11-2016 at 07:13.
pupdebox is offline