Raised This Month: $ Target: $400
 0% 

Adding reason while kicked by server


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
SomewhereLost
AlliedModders Donor
Join Date: Mar 2014
Location: Tomorrowland
Old 04-25-2018 , 12:39   Adding reason while kicked by server
Reply With Quote #1

Hello everybody,

The thing I'm trying to achieve is to add the reason while getting kicked by server, the reason only appears to the user on a small window after he gets kicked but not in the chat when the server says ServerName: Kicked PlayerName [reason should be here]

I tried to modify the admincmd plugin

PHP Code:
public cmdKick(idlevelcid)
{
    if (!
cmd_access(idlevelcid2))
        return 
PLUGIN_HANDLED

    
new arg[32]
    
read_argv(1arg31)
    new 
player cmd_target(idargCMDTARGET_OBEY_IMMUNITY CMDTARGET_ALLOW_SELF)
    
    if (!
player)
        return 
PLUGIN_HANDLED
    
    
new authid[32], authid2[32], name2[32], name[32], userid2reason[32]
    
    
get_user_authid(idauthid31)
    
get_user_authid(playerauthid231)
    
get_user_name(playername231)
    
get_user_name(idname31)
    
userid2 get_user_userid(player)
    
read_argv(2reason31)
    
remove_quotes(reason)
    
    
log_amx("Kick: ^"%s<%d><%s><>^" kick ^"%s<%d><%s><>^" (reason ^"%s^")"nameget_user_userid(id), authidname2userid2authid2reason)

    
show_activity_key("ADMIN_KICK_1""ADMIN_KICK_2"namename2);

    if (
is_user_bot(player))
        
server_cmd("kick #%d"userid2)
    else
    {
        if (
reason[0])
            
server_cmd("kick #%d ^"%s^""userid2reason)
        else
            
//server_cmd("kick #%d", userid2)
        
server_cmd("kick #%d ^"%s^""userid2reason)
    }
    
    
console_print(id"[AMXX] Client ^"%s^" kicked"name2)
    
    return 
PLUGIN_HANDLED

Not sure if it makes sense tho, that didnt help apparently.
__________________

Last edited by SomewhereLost; 04-25-2018 at 12:40.
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
 



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 04:38.


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