AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Request For Frags Count (https://forums.alliedmods.net/showthread.php?t=331541)

nflcsinfo 03-25-2021 13:09

Request For Frags Count
 
I can't understand when I compile it why it gives me an error

Source code:
HTML Code:

/* #include <amxmodx>
#include <amxmisc>
#include <fakemeta>

new g_msgDeath, g_msgSay
new g_iFrags[ 33 ]
new g_szName[ 33 ][ 32 ], g_szWeapon[ 33 ][ 11 ]

public plugin_init()
{
    register_plugin( "DeathMSG Frags", "1.0", "amxx" )

    g_msgDeath = get_user_msgid( "DeathMsg" )
    g_msgSay =  get_user_msgid( "SayText" )
    register_message( g_msgDeath, "event_dmg" )
    register_message( g_msgSay, "event_saytxt" ) //prevent chat spam of changing nicks
    register_event("HLTV", "event_new_round", "a", "1=0", "2=0")

}
public client_putinserver( id )
{
    g_iFrags[ id ] = 0
    g_szWeapon[ id ][ 0 ] = EOS
    get_user_name( id, g_szName[ id ], charsmax( g_szName ) )
}
public event_saytxt( msg_id, msg_dest, msg_entity )
{
    new arg[ 32 ]
    get_msg_arg_string( 2, arg, charsmax( arg ) )

    if( equal( arg, "#Cstrike_Name_Change" ) )
        return PLUGIN_HANDLED //prevent chat spam of changing nicks

    return PLUGIN_CONTINUE
}
public event_dmg()
{
    new data[ 4 ]
    data[ 0 ] = get_msg_arg_int( 1 ) //credits to Bugsy
    data[ 1 ] = get_msg_arg_int( 2 )
    data[ 2 ] = get_msg_arg_int( 3 )
    get_msg_arg_string( 4 , g_szWeapon[ data[ 0 ] ], charsmax( g_szWeapon[] ) ) //not so smart part here, but i think it will work properly with set_task                     

    if( data[ 0 ] == data[ 1 ] )
        return PLUGIN_CONTINUE //do nothing if its suicide..

    g_iFrags[ data[ 0 ] ]++
    g_iFrags[ data[ 1 ] ] = 0 //Reset Victim kill streak
    static name2[ 32 ]
    formatex( name2, charsmax( name2 ), "%s + %d", g_szName[ data[ 0 ] ], g_iFrags[ data[ 0 ] ] )
    set_user_info( data[ 0 ], "name", name2 )

    set_task( 0.1, "send_info", 0, data, sizeof data )
    return PLUGIN_HANDLED
}

public event_new_round()
{
    for(new i=0;i < get_maxplayers();i++)
        g_iFrags[i] = 0
}

public send_info( data[] )
{
    message_begin( MSG_ALL, g_msgDeath )
    write_byte( data[ 0 ] )
    write_byte( data[ 1 ] )
    write_byte( data[ 2 ] )
    write_string( g_szWeapon[ data[ 0 ] ] )
    message_end()

    set_user_info( data[ 0 ], "name", g_szName[ data[ 0 ] ] )
}

Fixed erro code:

HTML Code:

//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// dead_msg.sma
//
// C:\Users\musti\Desktop\addons\amxmodx\scripting\dead_msg.sma(74) : warning 216: nested comment
// C:\Users\musti\Desktop\addons\amxmodx\scripting\dead_msg.sma(76) : error 013: no entry point (no public functions)
//
// 1 Error.
// Could not locate output file C:\Users\musti\Desktop\addons\amxmodx\scripting\compiled\dead_msg.amx (compile failed).
//
// Compilation Time: 0,09 sec
// ----------------------------------------

Press enter to exit ...


DON KHAN 1 03-25-2021 13:37

Re: Request For Frags Count
 
Code:
#include <amxmodx> #include <amxmisc> #include <fakemeta> new g_msgDeath, g_msgSay new g_iFrags[ 33 ] new g_szName[ 33 ][ 32 ], g_szWeapon[ 33 ][ 11 ] public plugin_init() {     register_plugin( "DeathMSG Frags", "1.0", "amxx" )     g_msgDeath = get_user_msgid( "DeathMsg" )     g_msgSay =   get_user_msgid( "SayText" )     register_message( g_msgDeath, "event_dmg" )     register_message( g_msgSay, "event_saytxt" ) //prevent chat spam of changing nicks     register_event("HLTV", "event_new_round", "a", "1=0", "2=0") } public client_putinserver( id ) {     g_iFrags[ id ] = 0     g_szWeapon[ id ][ 0 ] = EOS     get_user_name( id, g_szName[ id ], charsmax( g_szName ) ) } public event_saytxt( msg_id, msg_dest, msg_entity ) {     new arg[ 32 ]     get_msg_arg_string( 2, arg, charsmax( arg ) )     if( equal( arg, "#Cstrike_Name_Change" ) )         return PLUGIN_HANDLED //prevent chat spam of changing nicks     return PLUGIN_CONTINUE } public event_dmg() {     new data[ 4 ]     data[ 0 ] = get_msg_arg_int( 1 ) //credits to Bugsy     data[ 1 ] = get_msg_arg_int( 2 )     data[ 2 ] = get_msg_arg_int( 3 )     get_msg_arg_string( 4 , g_szWeapon[ data[ 0 ] ], charsmax( g_szWeapon[] ) ) //not so smart part here, but i think it will work properly with set_task                               if( data[ 0 ] == data[ 1 ] )         return PLUGIN_HANDLED     return PLUGIN_CONTINUE }

OciXCrom 03-25-2021 14:43

Re: Request For Frags Count
 
Probably because your entire code is a comment which is not that hard to figure out when you look at the first line.

nflcsinfo 03-29-2021 05:49

Re: Request For Frags Count
 
Thank you! For help me. Pls Lock Topic


All times are GMT -4. The time now is 23:47.

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