New Top15
Hi,
i cant understand why this errors :-((
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx> #include <amxmisc> #include <amxmisc> #include <csx> #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "author" #define MAX_BUFFER_LENGTH 2047 #define MAX_NAME_LENGTH 31 #define STATS_KILLS 0 #define STATS_DEATHS 1 #define STATS_HS 2 #define STATS_TKS 3 #define STATS_SHOTS 4 #define STATS_HITS 5 #define STATS_DAMAGE 6
public SayTop15 = 0 // displays first 15 players public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_dictionary("statsx.txt") register_clcmd("say /top15", "cmdTop15", 0, "- display top 15 players (MOTD)")
// Add your code here... } Float:effec(izStats[8]) { if (!izStats[STATS_KILLS]) return (0.0) return (100.0 * float(izStats[STATS_KILLS]) / float(izStats[STATS_KILLS] + izStats[STATS_DEATHS])) }
new g_sBuffer[MAX_BUFFER_LENGTH + 1] = "" new t_sName[MAX_NAME_LENGTH + 1] = "" public cmdTop15(id) { if (!SayTop15) { client_print(id, print_chat, "%L", id, "DISABLED_MSG") return PLUGIN_HANDLED } format_top15(g_sBuffer)
set_hudmessage(255, 0, 0, 0.79, 0.06, 1, 6.0, 15.0, 0.5, 0.15, 1); show_hudmessage(1, "%d", cmdTop15); return PLUGIN_CONTINUE
} format_top15(sBuffer[MAX_BUFFER_LENGTH + 1]) { new iMax = get_statsnum() new izStats[8], izBody[8] new iLen = 0
if (iMax > 15) iMax = 15
new lKills[16], lDeaths[16], lHits[16], lShots[16], lEff[16], lAcc[16] format(lKills, 15, "%L", LANG_SERVER, "KILLS") format(lDeaths, 15, "%L", LANG_SERVER, "DEATHS") format(lHits, 15, "%L", LANG_SERVER, "HITS") format(lShots, 15, "%L", LANG_SERVER, "SHOTS") format(lEff, 15, "%L", LANG_SERVER, "EFF") format(lAcc, 15, "%L", LANG_SERVER, "ACC") ucfirst(lEff) ucfirst(lAcc)
iLen = format(sBuffer, MAX_BUFFER_LENGTH, "<body bgcolor=#000000><font color=#FFB000><pre>") iLen += format(sBuffer[iLen], MAX_BUFFER_LENGTH - iLen, "%2s %-22.22s %6s %6s %6s %6s %4s %4s %4s^n", "#", "Nick", lKills, lDeaths, lHits, lShots, "HS", lEff, lAcc) for (new i = 0; i < iMax && MAX_BUFFER_LENGTH - iLen > 0; i++) { get_stats(i, izStats, izBody, t_sName, MAX_NAME_LENGTH) replace_all(t_sName, MAX_NAME_LENGTH, "<", "[") replace_all(t_sName, MAX_NAME_LENGTH, ">", "]") iLen += format(sBuffer[iLen], MAX_BUFFER_LENGTH - iLen, "%2d %-22.22s %6d %6d %6d %6d %4d %3.0f%% %3.0f%%^n", i + 1, t_sName, izStats[STATS_KILLS], izStats[STATS_DEATHS], izStats[STATS_HITS], izStats[STATS_SHOTS], izStats[STATS_HS], effec(izStats), accuracy(izStats)) } }
PHP Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler. Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team
Error: Invalid expression, assumed zero on line 49 Error: Argument type mismatch (argument 1) on line 49 Error: Undefined symbol "accuracy" on line 82
3 Errors. Could not locate output file C:\Dokumente und Einstellungen\One\Desktop\aaaaa\Untitled.amx (compile failed).
|