Raised This Month: $51 Target: $400
 12% 

Request For Frags Count


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
nflcsinfo
Junior Member
Join Date: Feb 2021
Location: Пло
Old 03-25-2021 , 13:09   Request For Frags Count
Reply With Quote #1

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 ...
__________________
nFL-CS.InFo
My link bio: Steam Acc
HarveyWNvm - Fire Fire ( Official Audio ) 💢 Coming Soon!
nflcsinfo is offline
Send a message via Skype™ to nflcsinfo
 



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 00:52.


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