Raised This Month: $ Target: $400
 0% 

[REQ] /complaint like say_team @


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
0reax
Junior Member
Join Date: Sep 2016
Location: Anywhere
Old 09-10-2016 , 15:46   [REQ] /complaint like say_team @
Reply With Quote #1

Hey guys
I want a basic plugin that when users say /complaint blablabla sends message to admins like say_team @ hope help me. Regards
0reax is offline
pupdebox
Senior Member
Join Date: Feb 2016
Location: Wakanda
Old 09-10-2016 , 16:46   Re: [REQ] /complaint like say_team @
Reply With Quote #2

Can you try?
Edit: Added sound
PHP Code:
#include <amxmodx>
new g_maxplayers

public plugin_init() {
    
register_clcmd("say","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")
            }
        }
        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-10-2016 at 16:54.
pupdebox is offline
0reax
Junior Member
Join Date: Sep 2016
Location: Anywhere
Old 09-10-2016 , 18:06   Re: [REQ] /complaint like say_team @
Reply With Quote #3

I tried it. When type /complaint, [Complaint] You didn't type any complaints. appears.
But when i try /complaint blablabla there is a no specific message seen to admins. All players see like Player: /complaint blablabla and no sound

Last edited by 0reax; 09-10-2016 at 18:07.
0reax is offline
pupdebox
Senior Member
Join Date: Feb 2016
Location: Wakanda
Old 09-10-2016 , 19:40   Re: [REQ] /complaint like say_team @
Reply With Quote #4

I have just tryed and its working. Add the plugin at the top of your plugins.ini file and try again.
__________________
Quote:
Originally Posted by wickedd View Post
Make me or STFU boy
pupdebox is offline
0reax
Junior Member
Join Date: Sep 2016
Location: Anywhere
Old 09-10-2016 , 21:31   Re: [REQ] /complaint like say_team @
Reply With Quote #5

Sorry for my fault thanks a lot. I stopped all of 3rd plugins and tried again. It works now
Can player see his complaint like a [Complaint] !nYour complaint was sent admins or [Complaint Success] !t%s: !n%s?

And say_team /complaint

Last edited by 0reax; 09-10-2016 at 21:34.
0reax is offline
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
0reax
Junior Member
Join Date: Sep 2016
Location: Anywhere
Old 09-11-2016 , 09:44   Re: [REQ] /complaint like say_team @
Reply With Quote #7

Thanks a lot for a quick help
__________________
Code:
whichcode
0reax 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 20:16.


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