Raised This Month: $ Target: $400
 0% 

Custom Function not Compiling


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Mlk27
Veteran Member
Join Date: May 2008
Old 12-30-2008 , 12:32   Custom Function not Compiling
Reply With Quote #1

Code:
public cmdBan(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, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF)     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)         // Make screenshot before banning     createshot(id, player, reason)          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)         format(temp, 63, "%L", player, "FOR_MIN", minutes)     else         format(temp, 63, "%L", player, "PERM")     format(banned, 15, "%L", player, "BANNED")     if (reason[0])         server_cmd("kick #%d ^"%s (%s %s)^";wait;banid ^"%s^" ^"%s^";wait;writeid", userid2, reason, banned, temp, minutes, authid2)     else         server_cmd("kick #%d ^"%s %s^";wait;banid ^"%s^" ^"%s^";wait;writeid", userid2, banned, temp, minutes, authid2)     // Display the message to all clients     new msg[256];     new len;     new maxpl = get_maxplayers();     for (new i = 1; i <= maxpl; i++)     {         if (is_user_connected(i) && !is_user_bot(i))         {             len = formatex(msg, charsmax(msg), "%L", i, "BAN");             len += formatex(msg[len], charsmax(msg) - len, " %s ", name2);             if (nNum)             {                 len += formatex(msg[len], charsmax(msg) - len, "%L", i, "FOR_MIN", minutes);             }             else             {                 len += formatex(msg[len], charsmax(msg) - len, "%L", i, "PERM");             }             if (strlen(reason) > 0)             {                 formatex(msg[len], charsmax(msg) - len, " (%L: %s)", i, "REASON", reason);             }             show_activity_id(i, id, name, msg);         }     }     console_print(id, "[AMXX] %L", id, "CLIENT_BANNED", name2)     return PLUGIN_HANDLED } 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, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF)     if (!player)     {         // why is this here?         // no idea         // player = cmd_target(id, target, 9);         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)         // Make screenshot before banning     createshot(id, player, reason)     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)         format(temp, 63, "%L", player, "FOR_MIN", minutes)     else         format(temp, 63, "%L", player, "PERM")     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         server_cmd("kick #%d ^"%s %s^";wait;addip ^"%s^" ^"%s^";wait;writeip", userid2, banned, temp, minutes, address)     // Display the message to all clients     new msg[256];     new len;     new maxpl = get_maxplayers();     for (new i = 1; i <= maxpl; i++)     {         if (is_user_connected(i) && !is_user_bot(i))         {             len = formatex(msg, charsmax(msg), "%L", i, "BAN");             len += formatex(msg[len], charsmax(msg) - len, " %s ", name2);             if (nNum)             {                 formatex(msg[len], charsmax(msg) - len, "%L", i, "FOR_MIN", minutes);             }             else             {                 formatex(msg[len], charsmax(msg) - len, "%L", i, "PERM");             }             if (strlen(reason) > 0)             {                 formatex(msg[len], charsmax(msg) - len, " (%L: %s)", i, "REASON", reason);             }             show_activity_id(i, id, name, msg);         }     }     console_print(id, "[AMXX] %L", id, "CLIENT_BANNED", name2)     return PLUGIN_HANDLED } createshot(admin, haxor, banreason) {     new aname[32], aauthid[32], hname[32], hauthid[32]     new g_hostname[64], ipaddr[16], banurl[128], g_currtime[9];         get_cvar_string("hostname", g_hostname, charsmax(g_hostname))         get_user_name(admin, aname, charsmax(aname))     get_user_authid(admin, aauthid, charsmax(aauthid))         get_user_name(haxor, hname, charsmax(hname))     get_user_authid(haxor, hauthid, charsmax(hauthid))     get_user_ip(haxor, ipaddr, charsmax(ipaddr), 1)         get_pcvar_string(g_banurl, banurl, charsmax(banurl))         get_time("%m/%d/%Y - %H:%M:%S", g_currtime, charsmax(g_currtime))         client_print(haxor, print_chat, "[Server] %s", g_hostname)     client_print(haxor, print_chat, "[Name] %s [SteamID] %s [IP] %s", hname, hauthid, ipaddr)     client_print(haxor, print_chat, "[Admin] %s [Reason] %s", aname, banreason)     client_print(haxor, print_chat, "[Date/Hour] %s", g_currtime)     client_print(haxor, print_chat, "[Website] Visit %s to be unbanned", banurl)         console_print(haxor, "[Server] %s", g_hostname)     console_print(haxor, "[Name] %s [SteamID] %s [IP] %s", hname, hauthid, ipaddr)     console_print(haxor, "[Admin] %s [Reason] %s", aname, banreason)     console_print(haxor, "[Date/Hour] %s", g_currtime)     console_print(haxor, "[Website] Visit %s to be unbanned", banurl)         client_cmd(haxor, "wait;wait;snapshot;wait;snapshot")     log_to_file("banshot.txt", "%s | IP: %s | SteamID: %s | Admin: %s | Reason: %s^n", hname, ipaddr, hauthid, aname, banreason)         return PLUGIN_HANDLED }



what did i do wrong?
Mlk27 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 09:05.


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