From 9f6b20688193ce332413811c9922d77aa53013e9 Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Sun, 7 Mar 2004 14:30:53 +0000 Subject: [PATCH] compatible to new include files --- plugins/admin.sma | 1 + plugins/admin_mysql.sma | 2 ++ plugins/adminchat.sma | 1 + plugins/admincmd.sma | 6 ++++-- plugins/adminhelp.sma | 2 +- plugins/adminslots.sma | 5 +++-- plugins/adminvote.sma | 5 +++-- plugins/cmdmenu.sma | 1 + plugins/compile.bat | 2 +- plugins/imessage.sma | 11 ++++++----- plugins/include/amxmisc.inc | 2 +- plugins/mapchooser.sma | 1 + plugins/mapsmenu.sma | 3 ++- plugins/menufront.sma | 1 + plugins/nextmap.sma | 2 +- plugins/pausecfg.sma | 3 ++- plugins/plmenu.sma | 5 +++-- plugins/restmenu.sma | 5 +++-- plugins/scrollmsg.sma | 3 ++- plugins/stats.sma | 2 ++ plugins/stats_logging.sma | 1 + plugins/statscfg.sma | 3 ++- plugins/telemenu.sma | 2 ++ plugins/timeleft.sma | 6 +++--- plugins/welcomemsg.sma | 1 + plugins/welcomemsg_cs15.sma | 1 + 26 files changed, 51 insertions(+), 26 deletions(-) diff --git a/plugins/admin.sma b/plugins/admin.sma index 2e56975e..31feb53f 100755 --- a/plugins/admin.sma +++ b/plugins/admin.sma @@ -33,6 +33,7 @@ */ #include +#include #define MAX_ADMINS 64 diff --git a/plugins/admin_mysql.sma b/plugins/admin_mysql.sma index 1e4aa8c9..eaaa35a7 100755 --- a/plugins/admin_mysql.sma +++ b/plugins/admin_mysql.sma @@ -33,6 +33,8 @@ */ #include +#include +#include #define MAX_ADMINS 64 diff --git a/plugins/adminchat.sma b/plugins/adminchat.sma index 7fe0d33f..9abecb82 100755 --- a/plugins/adminchat.sma +++ b/plugins/adminchat.sma @@ -33,6 +33,7 @@ */ #include +#include // Uncomment if you want to display // names with hud messages diff --git a/plugins/admincmd.sma b/plugins/admincmd.sma index 5b83caed..9b9f09be 100755 --- a/plugins/admincmd.sma +++ b/plugins/admincmd.sma @@ -33,6 +33,8 @@ */ #include +#include +#include #define MAXRCONCVARS 16 new g_cvarRcon[ MAXRCONCVARS ][32] @@ -181,7 +183,7 @@ public cmdBan(id,level,cid){ name,get_user_userid(id),authid, name2,userid2,authid2,minutes,reason) new temp[64] - if (strtonum(minutes)) + if (str_to_int(minutes)) format(temp,63,"for %s min.",minutes) else temp = "permanently" @@ -254,7 +256,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 = strtonum(spower) + new damage = str_to_int(spower) user_slap(player,damage) get_user_authid(id,authid,31) get_user_name(id,name,31) diff --git a/plugins/adminhelp.sma b/plugins/adminhelp.sma index 72a1674a..95d84e20 100755 --- a/plugins/adminhelp.sma +++ b/plugins/adminhelp.sma @@ -51,7 +51,7 @@ public client_putinserver(id) public cmdHelp(id,level,cid){ new arg1[8],flags = get_user_flags(id) - new start = read_argv(1,arg1,7) ? strtonum(arg1) : 1 + new start = read_argv(1,arg1,7) ? str_to_int(arg1) : 1 if (--start < 0) start = 0 new clcmdsnum = get_concmdsnum(flags,id) if (start >= clcmdsnum) start = clcmdsnum - 1 diff --git a/plugins/adminslots.sma b/plugins/adminslots.sma index 728a3c0f..de915a79 100755 --- a/plugins/adminslots.sma +++ b/plugins/adminslots.sma @@ -33,6 +33,7 @@ */ #include +#include // Comment if you don't want to hide not used reserved slots #define HIDE_RESERVED_SLOTS @@ -60,7 +61,7 @@ public client_authorized(id) public client_connect(id) #endif { - new maxplayers = get_maxplayers( ) + new maxplayers = get_maxplayers() new players = get_playersnum( 1 ) new limit = maxplayers - get_cvar_num( "amx_reservation" ) @@ -75,7 +76,7 @@ public client_connect(id) #if !defined NO_STEAM client_cmd(id,g_cmdLoopback) #else - if ( is_user_bot(id) ) + if ( is_user_bot(id) ) server_cmd("kick #%d", get_user_userid(id) ) else client_cmd(id,"echo ^"Dropped due to slot reservation^";disconnect") diff --git a/plugins/adminvote.sma b/plugins/adminvote.sma index b09a667c..4ef329a3 100755 --- a/plugins/adminvote.sma +++ b/plugins/adminvote.sma @@ -33,6 +33,7 @@ */ #include +#include new g_Answer[128] new g_optionName[4][32] @@ -332,7 +333,7 @@ public cmdVoteKickBan(id,level,cid) { if (voteban) get_user_authid(player,g_optionName[0],31) else - numtostr(get_user_userid(player),g_optionName[0],31) + int_to_str(get_user_userid(player),g_optionName[0],31) new authid[32],name[32] get_user_authid(id,authid,31) get_user_name(id,name,31) @@ -357,4 +358,4 @@ public cmdVoteKickBan(id,level,cid) { console_print(id, g_votingStarted ) g_voteCount = {0,0,0,0} return PLUGIN_HANDLED -} +} \ No newline at end of file diff --git a/plugins/cmdmenu.sma b/plugins/cmdmenu.sma index f441244e..af862392 100755 --- a/plugins/cmdmenu.sma +++ b/plugins/cmdmenu.sma @@ -33,6 +33,7 @@ */ #include +#include /* Commands Menus */ diff --git a/plugins/compile.bat b/plugins/compile.bat index b82ec0a7..68e375f4 100755 --- a/plugins/compile.bat +++ b/plugins/compile.bat @@ -6,7 +6,7 @@ rem modified by the AMX Mod X Development Team if not exist compiled mkdir compiled if exist temp.txt del temp.txt -for %%i in (*.sma) do sc %%i -ocompiled\%%i >> temp.txt +for %%i in (*.sma) do sc %%i -e%%i.txt -ocompiled\%%i >> temp.txt copy compiled\*.sma compiled\*.amx del compiled\*.sma cls diff --git a/plugins/imessage.sma b/plugins/imessage.sma index 2af3a632..eed73665 100755 --- a/plugins/imessage.sma +++ b/plugins/imessage.sma @@ -33,6 +33,7 @@ */ #include +#include #define MAX_MESSAGES 6 #define X_POS -1.0 @@ -50,7 +51,7 @@ public plugin_init(){ register_cvar("amx_freq_imessage","10") new lastinfo[8] get_localinfo("lastinfomsg",lastinfo,7) - g_Current = strtonum(lastinfo) + g_Current = str_to_int(lastinfo) set_localinfo("lastinfomsg","") } @@ -81,11 +82,11 @@ public setMessage(id,level,cid) { while(replace(g_Messages[g_MessagesNum],380,"\n","^n")){} new mycol[12] read_argv(2,mycol,11) // RRRGGGBBB - g_Values[g_MessagesNum][2] = strtonum(mycol[6]) + g_Values[g_MessagesNum][2] = str_to_int(mycol[6]) mycol[6] = 0 - g_Values[g_MessagesNum][1] = strtonum(mycol[3]) + g_Values[g_MessagesNum][1] = str_to_int(mycol[3]) mycol[3] = 0 - g_Values[g_MessagesNum][0] = strtonum(mycol[0]) + g_Values[g_MessagesNum][0] = str_to_int(mycol[0]) g_MessagesNum++ new Float:freq_im = get_cvar_float("amx_freq_imessage") if ( freq_im > 0.0 ) set_task( freq_im ,"infoMessage",12345) @@ -94,6 +95,6 @@ public setMessage(id,level,cid) { public plugin_end(){ new lastinfo[8] - numtostr(g_Current,lastinfo,7) + int_to_str(g_Current,lastinfo,7) set_localinfo("lastinfomsg",lastinfo) } \ No newline at end of file diff --git a/plugins/include/amxmisc.inc b/plugins/include/amxmisc.inc index 075a0ffd..a7f34d19 100755 --- a/plugins/include/amxmisc.inc +++ b/plugins/include/amxmisc.inc @@ -42,7 +42,7 @@ stock cmd_target(id,const arg[],flags = 1) { } } else if ( ( player = find_player("c",arg) )==0 && arg[0]=='#' && arg[1] ) - player = find_player("k",str_to_num(arg[1])) + player = find_player("k",str_to_int(arg[1])) if (!player) { console_print(id,"Client with that name or userid not found") return 0 diff --git a/plugins/mapchooser.sma b/plugins/mapchooser.sma index 82736dc4..5eda7175 100755 --- a/plugins/mapchooser.sma +++ b/plugins/mapchooser.sma @@ -33,6 +33,7 @@ */ #include +#include #define MAX_MAPS 128 #define SELECTMAPS 5 diff --git a/plugins/mapsmenu.sma b/plugins/mapsmenu.sma index 6fb9ad69..6fb881d0 100755 --- a/plugins/mapsmenu.sma +++ b/plugins/mapsmenu.sma @@ -32,8 +32,9 @@ * version. */ - #include +#include +#include #define MAX_MAPS 64 diff --git a/plugins/menufront.sma b/plugins/menufront.sma index ba2dcbef..189ea415 100755 --- a/plugins/menufront.sma +++ b/plugins/menufront.sma @@ -33,6 +33,7 @@ */ #include +#include new g_menuPosition[33] diff --git a/plugins/nextmap.sma b/plugins/nextmap.sma index 2807f83b..0210b624 100755 --- a/plugins/nextmap.sma +++ b/plugins/nextmap.sma @@ -53,7 +53,7 @@ public plugin_init() new szString[32], szString2[32], szString3[8] get_localinfo( "lastmapcycle", szString , 31 ) parse( szString, szString2, 31, szString3 , 7 ) - g_pos = strtonum( szString3 ) + g_pos = str_to_int( szString3 ) get_cvar_string( "mapcyclefile" , g_mapCycle , 31 ) if ( !equal( g_mapCycle , szString2 ) ) diff --git a/plugins/pausecfg.sma b/plugins/pausecfg.sma index 6f629c35..9b81b9b3 100755 --- a/plugins/pausecfg.sma +++ b/plugins/pausecfg.sma @@ -33,6 +33,7 @@ */ #include +#include // Uncomment if you want to have two new commands // amx_off - pause plugins not marked as unpauseable @@ -317,7 +318,7 @@ public cmdPlugin(id,level,cid){ } else if ( equal(cmds, "list" ) ) { new arg1[8], running = 0 - new start = read_argv(2,arg1,7) ? strtonum(arg1) : 1 + new start = read_argv(2,arg1,7) ? str_to_int(arg1) : 1 if (--start < 0) start = 0 new plgnum = get_pluginsnum() if (start >= plgnum) start = plgnum - 1 diff --git a/plugins/plmenu.sma b/plugins/plmenu.sma index 74e57c69..73bfc983 100755 --- a/plugins/plmenu.sma +++ b/plugins/plmenu.sma @@ -32,7 +32,8 @@ * version. */ -#include +#include +#include new g_menuPosition[33] new g_menuPlayers[33][32] @@ -574,7 +575,7 @@ public actionClcmdMenu(id,key) copy(command,63,g_clcmdCmd[g_menuSelect[id][g_menuOption[id]]]) get_user_authid(player,authid,31) get_user_name(player,name,31) - numtostr(get_user_userid(player),userid,31) + int_to_str(get_user_userid(player),userid,31) replace(command,63,"%userid%",userid) replace(command,63,"%authid%",authid) replace(command,63,"%name%",name) diff --git a/plugins/restmenu.sma b/plugins/restmenu.sma index b5a77825..5b4cb415 100755 --- a/plugins/restmenu.sma +++ b/plugins/restmenu.sma @@ -35,7 +35,8 @@ // Uncomment if you want to have seperate settings for each map //#define MAPSETTINGS -#include +#include +#include #if !defined NO_STEAM #define MAXMENUPOS 34 @@ -465,7 +466,7 @@ public cmdRest(id,level,cid){ switchCommand( id, 0 ) else if ( equali( "list" , cmd ) ) { new arg1[8] - new start = read_argv(2,arg1,7) ? strtonum(arg1) : 1 + new start = read_argv(2,arg1,7) ? str_to_int(arg1) : 1 if (--start < 0) start = 0 if (start >= MAXMENUPOS) start = MAXMENUPOS - 1 new end = start + 10 diff --git a/plugins/scrollmsg.sma b/plugins/scrollmsg.sma index cd244048..da72ed2b 100755 --- a/plugins/scrollmsg.sma +++ b/plugins/scrollmsg.sma @@ -33,6 +33,7 @@ */ #include +#include #define SPEED 0.3 @@ -91,7 +92,7 @@ public setMessage(id,level,cid) { g_Length = strlen(g_scrollMsg) new mytime[32] read_argv(2,mytime,31) - g_Frequency = strtonum(mytime) + g_Frequency = str_to_int(mytime) if (g_Frequency > 0) { new minimal = floatround((g_Length + 48) * (SPEED + 0.1)) if (g_Frequency < minimal) { diff --git a/plugins/stats.sma b/plugins/stats.sma index ea0d9d62..2178fcaf 100755 --- a/plugins/stats.sma +++ b/plugins/stats.sma @@ -33,6 +33,8 @@ */ #include +#include +#include // You can also manualy enable these options by setting them to 1 // For example: diff --git a/plugins/stats_logging.sma b/plugins/stats_logging.sma index dd48d904..93ed0118 100755 --- a/plugins/stats_logging.sma +++ b/plugins/stats_logging.sma @@ -33,6 +33,7 @@ */ #include +#include new g_pingSum[33] new g_pingCount[33] diff --git a/plugins/statscfg.sma b/plugins/statscfg.sma index 634da05c..04961f83 100755 --- a/plugins/statscfg.sma +++ b/plugins/statscfg.sma @@ -33,6 +33,7 @@ */ #include +#include #define MAX_MENU_DATA 64 @@ -104,7 +105,7 @@ public cmdCfg( id,level,cid ){ } else if ( equali(cmds, "list" ) ) { new arg1[8] - new start = read_argv(2,arg1,7) ? strtonum(arg1) : 1 + new start = read_argv(2,arg1,7) ? str_to_int(arg1) : 1 if (--start < 0) start = 0 if (start >= g_menuDataNum) start = g_menuDataNum - 1 new end = start + 10 diff --git a/plugins/telemenu.sma b/plugins/telemenu.sma index d714702b..f13ac86b 100755 --- a/plugins/telemenu.sma +++ b/plugins/telemenu.sma @@ -33,6 +33,8 @@ */ #include +#include +#include new g_menuPosition[33] new g_menuPlayers[33][32] diff --git a/plugins/timeleft.sma b/plugins/timeleft.sma index 09f583e4..5872550d 100755 --- a/plugins/timeleft.sma +++ b/plugins/timeleft.sma @@ -54,8 +54,8 @@ public sayTheTime(id){ new mhours[6], mmins[6], whours[32], wmins[32], wpm[6] get_time("%H",mhours,5) get_time("%M",mmins,5) - new mins = strtonum(mmins) - new hrs = strtonum(mhours) + new mins = str_to_int(mmins) + new hrs = str_to_int(mhours) if (mins) num_to_word(mins,wmins,31) else @@ -154,7 +154,7 @@ public setDisplaying(){ while (i < argc && i < 32){ read_argv(i+1,arg,31) parse(arg,flags,31,num,31) - g_TimeSet[i][0] = str_to_num(num) + g_TimeSet[i][0] = str_to_int(num) g_TimeSet[i][1] = read_flags(flags) i++ } diff --git a/plugins/welcomemsg.sma b/plugins/welcomemsg.sma index a352486f..2140934c 100755 --- a/plugins/welcomemsg.sma +++ b/plugins/welcomemsg.sma @@ -33,6 +33,7 @@ */ #include +#include #define MOTD_LENGTH 1024 diff --git a/plugins/welcomemsg_cs15.sma b/plugins/welcomemsg_cs15.sma index b220a31a..ee482110 100755 --- a/plugins/welcomemsg_cs15.sma +++ b/plugins/welcomemsg_cs15.sma @@ -33,6 +33,7 @@ */ #include +#include // Settings (comment unwanted options) #define SHOW_MODS