lol im blind xD thanks ! this problem is fixed but i still need:
2. I understand what means that but i want to the best player who make the most kills even he is terro or ct to get at the end of round the message what is in dhudmessage.
PHP Code:
/* Plugin generated by AMXX-Studio */
#include < amxmodx >
#include < cstrike >
#include < fakemeta >
#include < dhudmessage >
#define PLUGIN "FirstKill & UNREAL"
#define VERSION "1.1"
#define OFFSET_MONEY 115
#define fm_create_entity(%1) engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, %1))
#if cellbits == 32
#define OFFSET_CSMONEY 115
#else
#define OFFSET_CSMONEY 140
#endif
#define OFFSET_LINUX 5
#define MAXENTS 1500
enum {
TERRO_KILL,
CT_KILL,
MAX_KILLS
}
new g_iFirstKillMoney[ MAX_KILLS ];
new bool:g_bFirstKillWasMade;
new g_iMaxPlayers;
public plugin_init( )
{
register_plugin( PLUGIN, VERSION, "askhanar" );
register_event( "HLTV", "ev_NewRound", "a", "1=0", "2=0" );
register_event( "DeathMsg", "ev_DeathMsg", "a" );
// --| Banii primiti pentru fiecare first kill.
g_iFirstKillMoney[ TERRO_KILL ] = 2000; // --| FirstKill de la TERO
g_iFirstKillMoney[ CT_KILL ] = 2000; // --| FirstKill de la CT
g_bFirstKillWasMade= false;
g_iMaxPlayers = get_maxplayers( );
// Add your code here...
}
public ev_NewRound( ) g_bFirstKillWasMade = false;
public plugin_precache()
{
precache_sound("furien/firstblood.wav")
precache_sound("furien/unreal.wav")
return PLUGIN_CONTINUE
}
public ev_DeathMsg( )
{
static iKiller, iVictim;
iKiller = read_data( 1 );
iVictim = read_data( 2 );
if( ( 1 <= iKiller <= g_iMaxPlayers ) && iKiller != iVictim )
{
if( cs_get_user_team( iKiller ) == CS_TEAM_T && !g_bFirstKillWasMade )
{
g_bFirstKillWasMade = true;
fm_set_user_money ( iKiller, fm_get_user_money ( iKiller ) + g_iFirstKillMoney [ TERRO_KILL ], 0 );
client_cmd(0,"spk furien/firstblood")
static szKillerName[ 32 ], szVictimName[ 32 ];
get_user_name( iKiller, szKillerName, sizeof ( szKillerName ) -1 );
get_user_name( iVictim, szVictimName, sizeof ( szVictimName ) -1 );
set_dhudmessage(random(244), random(244), random(244), -1.0, 0.15, 1, 5.1, 5.0);
show_dhudmessage(0, "< ======= FIRST BLOOD ======= >%s^n si a primit %i$!",
szKillerName, szVictimName, g_iFirstKillMoney[ TERRO_KILL ] );
}
else if( cs_get_user_team( iKiller ) == CS_TEAM_CT && !g_bFirstKillWasMade )
{
g_bFirstKillWasMade = true;
fm_set_user_money ( iKiller, fm_get_user_money ( iKiller ) + g_iFirstKillMoney [ CT_KILL ], 0 );
client_cmd(0,"spk furien/firstblood")
static szKillerName[ 32 ], szVictimName[ 32 ];
get_user_name( iKiller, szKillerName, sizeof ( szKillerName ) -1 );
get_user_name( iVictim, szVictimName, sizeof ( szVictimName ) -1 );
set_dhudmessage( random(244), random(244), random(244), -1.0, 0.15, 1, 5.1, 5.0 );
show_dhudmessage( 0, "< ======= FIRST BLOOD ======= >%s^n si a primit %i$!",
szKillerName, szVictimName, g_iFirstKillMoney[ CT_KILL ] );
}
}
new Weapon[8]
read_data(4, Weapon, sizeof(Weapon) -1)
if(iVictim == iKiller || !is_user_connected(iKiller))
return
static szKillerName[ 32 ], szVictimName[ 32 ];
get_user_name( iKiller, szKillerName, sizeof ( szKillerName ) -1 );
get_user_name( iVictim, szVictimName, sizeof ( szVictimName ) -1 );
if(cs_get_user_team(iKiller) == CS_TEAM_CT
&& equali(Weapon, "knife")) {
set_dhudmessage( 85, 170, 255, -1.0, 0.30, 0, 3.1, 3.0 );
show_dhudmessage( 0, " %s a fost IREAL %s^n si a primit 4000$ !",szKillerName, szVictimName );
fm_set_user_money( iKiller, clamp( fm_get_user_money( iKiller ) + 4000, 0, 16000 ), 1 );
client_cmd(0,"spk furien/unreal")
}
}
stock fm_set_user_money(id,money,flash=0)
{
set_pdata_int(id,OFFSET_CSMONEY,money,OFFSET_LINUX);
message_begin(MSG_ONE,get_user_msgid("Money"),{0,0,0},id);
write_long(money);
write_byte(flash);
message_end();
}
stock fm_get_user_money(id)
{
return get_pdata_int(id,OFFSET_CSMONEY,OFFSET_LINUX);
}