From 57747fff55975046f82e2b03be322119b7c1ec40 Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Mon, 8 Mar 2004 16:06:11 +0000 Subject: [PATCH] changed to str_to_num/num_to_str | fixed get_modules --- plugins/admincmd.sma | 46 +++++++++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 15 deletions(-) diff --git a/plugins/admincmd.sma b/plugins/admincmd.sma index 9b9f09be..a8e802f0 100755 --- a/plugins/admincmd.sma +++ b/plugins/admincmd.sma @@ -103,9 +103,15 @@ public cmdKick(id,level,cid){ else { #if !defined NO_STEAM - server_cmd("kick #%d ^"%s^"",userid2,reason) + if (reason[0]) + server_cmd("kick #%d ^"%s^"",userid2,reason) + else + server_cmd("kick #%d",userid2) #else - client_cmd(player,"echo ^"%s^";disconnect",reason) + if (reason[0]) + client_cmd(player,"echo ^"Kicked: Reason: %s^";disconnect",reason) + else + client_cmd(player,"echo ^"Kicked^";disconnect",reason) #endif } console_print(id,"Client ^"%s^" kicked",name2) @@ -183,7 +189,7 @@ public cmdBan(id,level,cid){ name,get_user_userid(id),authid, name2,userid2,authid2,minutes,reason) new temp[64] - if (str_to_int(minutes)) + if (str_to_num(minutes)) format(temp,63,"for %s min.",minutes) else temp = "permanently" @@ -192,18 +198,30 @@ public cmdBan(id,level,cid){ new address[32] get_user_ip(player,address,31,1) #if !defined NO_STEAM - server_cmd("kick #%d ^"%s (banned %s)^";wait;addip ^"%s^" ^"%s^";wait;writeip",userid2,reason,temp,minutes,address) + if (reason[0]) + server_cmd("kick #%d ^"%s (banned %s)^";wait;addip ^"%s^" ^"%s^";wait;writeip",userid2,reason,temp,minutes,address) + else + server_cmd("kick #%d ^"banned %s^";wait;addip ^"%s^" ^"%s^";wait;writeip",userid2,temp,minutes,address) #else - client_cmd(player,"echo ^"%s (banned %s)^";disconnect",reason,temp) + if (reason[0]) + client_cmd(player,"echo ^"%s (banned %s)^";disconnect",reason,temp) + else + client_cmd(player,"echo ^"banned %s^";disconnect",temp) server_cmd("addip ^"%s^" ^"%s^";wait;writeip",minutes,address) #endif } else { #if !defined NO_STEAM - server_cmd("kick #%d ^"%s (banned %s)^";wait;banid ^"%s^" ^"%s^";wait;writeid",userid2,reason,temp,minutes,authid2) + if (reason[0]) + server_cmd("kick #%d ^"%s (banned %s)^";wait;banid ^"%s^" ^"%s^";wait;writeid",userid2,reason,temp,minutes,authid2) + else + server_cmd("kick #%d ^"banned %s^";wait;banid ^"%s^" ^"%s^";wait;writeid",userid2,temp,minutes,authid2) #else - client_cmd(player,"echo ^"%s (banned %s)^";disconnect",reason,temp) + if (reason[0]) + client_cmd(player,"echo ^"%s (banned %s)^";disconnect",reason,temp) + else + client_cmd(player,"echo ^"banned %s^";disconnect",temp) server_cmd("banid ^"%s^" ^"%s^";wait;writeip",minutes,authid2) #endif } @@ -256,7 +274,7 @@ public cmdSlap(id,level,cid){ if (!player) return PLUGIN_HANDLED new spower[32],authid[32],name2[32],authid2[32],name[32] read_argv(2,spower,31) - new damage = str_to_int(spower) + new damage = str_to_num(spower) user_slap(player,damage) get_user_authid(id,authid,31) get_user_name(id,name,31) @@ -368,8 +386,9 @@ public cmdPlugins(id,level,cid) return PLUGIN_HANDLED #if !defined NO_STEAM - #define MOTD_LEN 1024 + #define MOTD_LEN 2048 new motd_body[MOTD_LEN],state[4] + new name[32],version[32],author[32],filename[32],status[32] new num = get_pluginsnum() new running = 0 new pos = copy(motd_body,MOTD_LEN,"") @@ -426,8 +444,7 @@ public cmdModules(id,level,cid) { if (equal(state,"one")) copy(state,3,"two") else copy(state,3,"one") - new name[32],version[32],author[32],filename[32],status[32] - get_plugin(i,filename,31,name,31,version,31,author,31,status,31) + get_module(i,name,31,author,31,version,31) pos += format(motd_body[pos],MOTD_LEN-pos,"",state,name,version,author) } format(motd_body[pos],MOTD_LEN-pos,"
NameVersionAuthor
%s%s%s
%d modules",num) @@ -438,7 +455,6 @@ public cmdModules(id,level,cid) console_print(id,"%-23.22s %-8.7s %-20.19s","name","version","author") for (new i=0;i