Raised This Month: $ Target: $400
 0% 

New Top15


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 03-18-2009 , 11:27   New Top15
Reply With Quote #1

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             // displays first 15 players
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
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(idprint_chat"%L"id"DISABLED_MSG")
        return 
PLUGIN_HANDLED
    
}
    
format_top15(g_sBuffer)

    
    
set_hudmessage(255000.790.0616.015.00.50.151);
    
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(lKills15"%L"LANG_SERVER"KILLS")
    
format(lDeaths15"%L"LANG_SERVER"DEATHS")
    
format(lHits15"%L"LANG_SERVER"HITS")
    
format(lShots15"%L"LANG_SERVER"SHOTS")
    
format(lEff15"%L"LANG_SERVER"EFF")
    
format(lAcc15"%L"LANG_SERVER"ACC")
    
    
ucfirst(lEff)
    
ucfirst(lAcc)

    
iLen format(sBufferMAX_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"lKillslDeathslHitslShots"HS"lEfflAcc)
    
    for (new 
0iMax && MAX_BUFFER_LENGTH iLen 0i++)
    {
        
get_stats(iizStatsizBodyt_sNameMAX_NAME_LENGTH)
        
replace_all(t_sNameMAX_NAME_LENGTH"<""[")
        
replace_all(t_sNameMAX_NAME_LENGTH">""]")
        
iLen += format(sBuffer[iLen], MAX_BUFFER_LENGTH iLen"%2d %-22.22s %6d %6d %6d %6d %4d %3.0f%% %3.0f%%^n"1t_sNameizStats[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 (c1997-2006 ITB CompuPhaseAMX Mod X Team

Error
Invalid expressionassumed zero on line 49
Error
Argument type mismatch (argument 1on 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). 
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
padilha007
Senior Member
Join Date: Jul 2008
Old 03-18-2009 , 11:54   Re: New Top15
Reply With Quote #2

PHP Code:
Float:accuracy(izStats[8])
{
    if (!
izStats[STATS_SHOTS])
        return (
0.0)
    
    return (
100.0 float(izStats[STATS_HITS]) / float(izStats[STATS_SHOTS]))

PHP Code:
show_hudmessage(id"%d"g_sBuffer); 
__________________

padilha007 is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 03-18-2009 , 12:52   Re: New Top15
Reply With Quote #3

Ty but ... see :



& top15 is on.

the plugin shows only "60" on hud. ( see right of screen. )
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Reply



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 08:59.


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