Raised This Month: $ Target: $400
 0% 

Help with compiling plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Apocalyman
Member
Join Date: Nov 2022
Old 08-24-2023 , 13:03   Re: Help with compiling plugin
Reply With Quote #3

Quote:
Originally Posted by Tote View Post
PHP Code:
#include <amxmodx>
#include <colorchat>

new const PLUGIN[] = "Gag Plugin";
new const 
VERSION[] = "1.0";
new const 
AUTHOR[] = "Your Name";

new const 
PLUGIN_TAG[] = "^x04[^x01 Gag-Plugin ^x04]^x01";

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_clcmd("say !gag""GagCommand");
}

public 
GagCommand(idargs[]) {
    if (!(
get_user_flags(id) & ADMIN_KICK)) {
        return 
PLUGIN_CONTINUE;
    }

    new 
target[32], duration[32], reason[128];
    new 
client_name[32];

    new 
message[128];
    
read_argv(1messagesizeof(message) - 1);

    new 
tokens[4];
    

    if (
read_argv() < 4)
    {
        
client_print(idprint_chat"%s Usage: !gag <target> <duration> <reason>"PLUGIN_TAG);
        return 
PLUGIN_HANDLED;
    }

    
format(targetsizeof(target), "%s"tokens[1]);
    
format(durationsizeof(duration), "%s"tokens[2]);
    
format(reasonsizeof(reason), "%s"tokens[3]);

    
get_user_name(idclient_namesizeof(client_name) - 1);

    new 
target_id = -1;
    
    for (new 
1<= get_maxplayers(); i++) {
        if (
is_user_connected(i)) {
            new 
target_name[32];
            
get_user_name(itarget_namesizeof(target_name) - 1);
            if (
equali(targettarget_name)) {
                
target_id i;
                break;
            }
        }
    }
    
    if (
target_id == -1) {
        return 
PLUGIN_CONTINUE;
    }

    
client_cmd(target_id"amx_gag %s %s"durationreason);
    
client_cmd(target_id"amx_say [GAG] ^1You have been gagged for %s minutes. Reason: %s"durationreason);
    
    
ColorChat(0TEAM_COLOR"%s %s has been gagged for %s minutes. Reason: %s"PLUGIN_TAGtargetdurationreason);
    
    return 
PLUGIN_HANDLED;

Hello! thanks for helping! I still get the same error sadly
Apocalyman is offline
 



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 00:45.


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