AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Trash (https://forums.alliedmods.net/forumdisplay.php?f=22)
-   -   [REQ] Small and simple plugin (https://forums.alliedmods.net/showthread.php?t=221150)

DIS 07-18-2013 13:25

[REQ] Small and simple plugin
 
I need a simple plugin that when user says something defined in the SMA file, it executes a command in server_cmd. Lets say a player says "hello". Now this command executes in server_cmd: amx_banip "%s" "1440" "Said hello" (Put his name instead of %s).
Can someone make this plugin? I can replace the hello thing with the thing I need in the SMA file.
Any help would be greatly appreciated
Thanks :D

ANTICHRISTUS 07-18-2013 17:04

Re: [REQ] Small and simple plugin
 
I don't understand your request, just search this keyword (without edititng it) only in titles: *command*
examples:Say Commands, Custom Say Commands

DIS 07-19-2013 12:26

Re: [REQ] Small and simple plugin
 
Quote:

Originally Posted by ANTICHRISTUS (Post 1993983)
I don't understand your request, just search this keyword (without edititng it) only in titles: *command*
examples:Say Commands, Custom Say Commands

But that doesn't execute a command. I mean I need a plugin that execute amx_banip "%s" "1440" "reasonofban" when user says something. It executes a command but I don't know how to edit and get_user_name so it will replace the %s with user name.
I hope you get me cuz I know what im asking and there is not anything like I want before. So dont try to give me plugins (Suggest them and give link etc) just if you can make it and post the code otherwise there is no need to comment :)

ANTICHRISTUS 07-19-2013 13:35

Re: [REQ] Small and simple plugin
 
Quote:

Originally Posted by DIS (Post 1994505)
...I hope you get me ...

Quote:

Originally Posted by ANTICHRISTUS (Post 1993983)
I don't understand your request, just search this keyword (without edititng it) only in titles: *command*

examples: Say Commands, Custom Say Commands


5aloOod 07-19-2013 15:18

Re: [REQ] Small and simple plugin
 
like when a player swearing like he says (fuck you) the server will ban the player automatically ? like that?

fysiks 07-20-2013 03:33

Re: [REQ] Small and simple plugin
 
Quote:

Originally Posted by 5aloOod (Post 1994632)
like when a player swearing like he says (fuck you) the server will ban the player automatically ? like that?

Look for swear plugins.

DIS 07-20-2013 07:26

Re: [REQ] Small and simple plugin
 
Quote:

Originally Posted by 5aloOod (Post 1994632)
like when a player swearing like he says (fuck you) the server will ban the player automatically ? like that?

No not like that not just swear. Man I just don't know how to arrange the code like I want something like this
if equali said "hello", get_user_name, server_cmd amx_banip "%s" "1440" "aReason", name
Now u got it ?
I know some lines but I don't know how to arrange it. Now u know what I mean exactly and if u know how to code, just arrange them and post the sma file here

fysiks 07-20-2013 18:57

Re: [REQ] Small and simple plugin
 
A swear plugin should work unless you explain exactly what you are actually trying to do. It seems like you are trying to hide something.

Moody92 07-21-2013 05:30

Re: [REQ] Small and simple plugin
 
Quote:

Originally Posted by DIS (Post 1994964)
No not like that not just swear. Man I just don't know how to arrange the code like I want something like this
if equali said "hello", get_user_name, server_cmd amx_banip "%s" "1440" "aReason", name
Now u got it ?
I know some lines but I don't know how to arrange it. Now u know what I mean exactly and if u know how to code, just arrange them and post the sma file here

This was basically taken from roll the dice plugin, I don't know if it's gonna work

PHP Code:

#include <amxmodx>
#include <amxmisc>

new const iReason[] = "Your ban reason"

public plugin_init() {
    
register_plugin("PLUGIN""VERSION""AUTHOR")
    
register_clcmd("say""HandleSay")
}

public 
HandleSay(id)
{
    new 
Speech[192];
    
read_args(Speech,192);
    
remove_quotes(Speech);
    
    if(
HandleSay2(id,Speech))    
        return 
PLUGIN_HANDLED;

    return 
PLUGIN_CONTINUE;
}

public 
HandleSay2(id,Speech[])
{
    new 
player[32]
    
    if ( (
equali(Speech"hello")) )
    {
        
get_user_name(idplayercharsmax(player))
        
server_cmd("amx_banip %s 1440 %s"playeriReason); 
    }
    
    return 
PLUGIN_CONTINUE;



DIS 07-22-2013 02:36

Re: [REQ] Small and simple plugin
 
Quote:

Originally Posted by Moody92 (Post 1995538)
This was basically taken from roll the dice plugin, I don't know if it's gonna work

PHP Code:

#include <amxmodx>
#include <amxmisc>

new const iReason[] = "Your ban reason"

public plugin_init() {
    
register_plugin("PLUGIN""VERSION""AUTHOR")
    
register_clcmd("say""HandleSay")
}

public 
HandleSay(id)
{
    new 
Speech[192];
    
read_args(Speech,192);
    
remove_quotes(Speech);
    
    if(
HandleSay2(id,Speech))    
        return 
PLUGIN_HANDLED;

    return 
PLUGIN_CONTINUE;
}

public 
HandleSay2(id,Speech[])
{
    new 
player[32]
    
    if ( (
equali(Speech"hello")) )
    {
        
get_user_name(idplayercharsmax(player))
        
server_cmd("amx_banip %s 1440 %s"playeriReason); 
    }
    
    return 
PLUGIN_CONTINUE;



Thanks man it works but only a problem here: I have advanced bans, and it shows the reason the 1440. Like instead of showing the reason, it's showing the minutes of the ban.
EDIT: The problem is it doesn't have " like: amx_banip "%s" "1440" "%s"
I tried and compile error can u edit it?


All times are GMT -4. The time now is 15:27.

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