AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   amx_ban (https://forums.alliedmods.net/showthread.php?t=55775)

neogeo 05-29-2007 13:24

amx_ban
 
hi
i need a plugin that do that :
- admin can't ban/kick player if they don't write a reason.
- admin can't ban player more than 9999 min.
- i want that when we use amx_ban , it will ban by ip and not by steamid.
- ban and kick will be log in an specific file.
thanks

Lee 05-29-2007 22:14

Re: amx_ban
 
Completely untested. I believe this plugin would need to be listed above admincmd.amxx in plugins.ini.

Code:
#include <amxmodx> #include <amxmisc> public plugin_init() {     register_concmd("amx_ban", "cmdBanIP", ADMIN_BAN, "<name or #userid> <minutes> <reason>") } public cmdBanIP(id, level, cid) {     if (!cmd_access(id, level, cid, 3))         return PLUGIN_HANDLED         new target[32], minutes[8], reason[64]         read_argv(1, target, 31)     read_argv(2, minutes, 7)     read_argv(3, reason, 63)         new player = cmd_target(id, target, 9)         if (!player)         return PLUGIN_HANDLED         new authid[32], name2[32], authid2[32], name[32]     new userid2 = get_user_userid(player)         get_user_authid(player, authid2, 31)     get_user_authid(id, authid, 31)     get_user_name(player, name2, 31)     get_user_name(id, name, 31)         log_amx("Ban: ^"%s<%d><%s><>^" ban and kick ^"%s<%d><%s><>^" (minutes ^"%s^") (reason ^"%s^")", name, get_user_userid(id), authid, name2, userid2, authid2, minutes, reason)     new temp[64], banned[16], nNum = str_to_num(minutes)     if (nNum)     {         if (nNum > 9999)             nNum = 9999                 format(temp, 63, "%L", player, "FOR_MIN", minutes)     }     else     {         client_print(id, print_console, "Error: You must specify how long a player should be banned in munutes..")         return PLUGIN_HANDLED     }     format(banned, 15, "%L", player, "BANNED")     new address[32]     get_user_ip(player, address, 31, 1)     if (reason[0])     {         server_cmd("kick #%d ^"%s (%s %s)^";wait;addip ^"%s^" ^"%s^";wait;writeip", userid2, reason, banned, temp, minutes, address)     }     else     {         client_print(id, print_console, "Error: You must specify a reason for banning this player..")         return PLUGIN_HANDLED     }             new activity = get_cvar_num("amx_show_activity")     if (activity != 0)     {         new players[32], pnum, msg[256], len         get_players(players, pnum, "c")                 for (new i = 0; i < pnum; i++)         {             len = format(msg, 255, "%L", players[i], "ADMIN")                         if (activity == 1)                 len += copy(msg[len], 255-len, ":")             else                 len += format(msg[len], 255-len, " %s:", name)                         len += format(msg[len], 255-len, " %L", players[i], "BAN")             len += format(msg[len], 255-len, " %s ", name2)                     format(msg[len], 255-len, "%L", players[i], "FOR_MIN", minutes)             client_print(players[i], print_chat, "%s", msg)         }     }     console_print(id, "[AMXX] %L", id, "CLIENT_BANNED", name2)         return PLUGIN_HANDLED }

neogeo 05-30-2007 00:34

Re: amx_ban
 
thanks , i will try :D

Lee 05-30-2007 01:01

Re: amx_ban
 
Note that it will log unsuccessful attempts should a reason or time not be specified as if there were no problems. If you would rather a log entry was only made if a player is actually banned move the log_amx() call to below the server_cmd() used to kick and ban the player.

hcxx 05-30-2007 01:52

Re: amx_ban
 
check http://www.amxbans.net/

neogeo 06-01-2007 14:26

Re: amx_ban
 
doesn't work :(
Code:

Welcome to the AMX Mod X 1.76-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

/home/groups/amxmodx/tmp3/phphiEv1I.sma(0) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/tmp3/phphiEv1I.sma(3) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/tmp3/phphiEv1I.sma(4) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/tmp3/phphiEv1I.sma(7) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/tmp3/phphiEv1I.sma(10) : error 001: expected token: ";", but found " "
/home/groups/amxmodx/tmp3/phphiEv1I.sma(13) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/tmp3/phphiEv1I.sma(16) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/tmp3/phphiEv1I.sma(17) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/tmp3/phphiEv1I.sma(18) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/tmp3/phphiEv1I.sma(20) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/tmp3/phphiEv1I.sma(21) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/tmp3/phphiEv1I.sma(22) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/tmp3/phphiEv1I.sma(23) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/tmp3/phphiEv1I.sma(24) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/tmp3/phphiEv1I.sma(25) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/tmp3/phphiEv1I.sma(26) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/tmp3/phphiEv1I.sma(27) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/tmp3/phphiEv1I.sma(28) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/tmp3/phphiEv1I.sma(29) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/tmp3/phphiEv1I.sma(30) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/tmp3/phphiEv1I.sma(31) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/tmp3/phphiEv1I.sma(32) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/tmp3/phphiEv1I.sma(33) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/tmp3/phphiEv1I.sma(34) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/tmp3/phphiEv1I.sma(35) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/tmp3/phphiEv1I.sma(36) : error 075: input line too long (after substitutions)

Compilation aborted.
26 Errors.


YamiKaitou 06-01-2007 16:09

Re: amx_ban
 
1 Attachment(s)
Compiled fine for me using the web compiler. Here it is in a file incase you can't get it to compile

neogeo 06-02-2007 05:21

Re: amx_ban
 
thanks

neogeo 06-02-2007 13:26

Re: amx_ban
 
doesn't work , i can ban player without writing a reason.


All times are GMT -4. The time now is 08:46.

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