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

Firstblood


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ColaSola
Junior Member
Join Date: Apr 2016
Old 04-30-2016 , 16:59   Firstblood
Reply With Quote #1

Hello i got some problems there..when im ct and i kill terro its ok because the hud show my name and money but when im terro and kill ct i don-t get anything only caracters like %s^n and %i$!.

1.One more thing there is like that if(cs_get_user_team(iKiller) == CS_TEAM_CT
&& equali(Weapon, "knife
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. Thanks!

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_iFirstKillMoneyMAX_KILLS ];
new 
bool:g_bFirstKillWasMade;

new 
g_iMaxPlayers;
public 
plugin_init( )
{
    
register_pluginPLUGINVERSION"askhanar" );
    
    
register_event(  "HLTV",  "ev_NewRound",  "a",  "1=0",  "2=0"  );
    
register_event(  "DeathMsg",  "ev_DeathMsg",  "a"  );
    
    
// --| Banii primiti pentru fiecare first kill.
    
g_iFirstKillMoneyTERRO_KILL ] = 2000;        // --| FirstKill de la TERO
    
g_iFirstKillMoneyCT_KILL ] = 2000;        // --| FirstKill de la CT
    
    
g_bFirstKillWasMadefalse;
    
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 
iKilleriVictim;
    
iKiller read_data);
    
iVictim read_data);
    
    
    if( ( 
<= iKiller <= g_iMaxPlayers ) && iKiller != iVictim )
    {
        
        if(  
cs_get_user_teamiKiller ) == CS_TEAM_T && !g_bFirstKillWasMade )
        {
            
g_bFirstKillWasMade true;
            
fm_set_user_money iKillerfm_get_user_money iKiller ) + g_iFirstKillMoney TERRO_KILL ], );
            
client_cmd(0,"spk furien/firstblood")
            
            static 
szKillerName32 ], szVictimName32 ];
            
            
get_user_nameiKillerszKillerNamesizeof szKillerName ) -);
            
get_user_nameiVictimszVictimNamesizeof szVictimName ) -);
            
            
set_dhudmessage(random(244), random(244), random(244), -1.00.1515.15.0);
            
show_dhudmessage(0"< ======= FIRST BLOOD ======= >%s^n si a primit %i$" );
            
szKillerNameszVictimNameg_iFirstKillMoneyTERRO_KILL ] ;
            
        }
        
        else if(  
cs_get_user_teamiKiller ) == CS_TEAM_CT && !g_bFirstKillWasMade )
        {
            
g_bFirstKillWasMade true;
            
fm_set_user_money iKillerfm_get_user_money iKiller ) + g_iFirstKillMoney CT_KILL ], );
            
client_cmd(0,"spk furien/firstblood")
            
            static 
szKillerName32 ], szVictimName32 ];
            
            
get_user_nameiKillerszKillerNamesizeof szKillerName ) -);
            
get_user_nameiVictimszVictimNamesizeof szVictimName ) -);
            
            
set_dhudmessagerandom(244), random(244), random(244), -1.00.1515.15.0 );
            
show_dhudmessage0"< ======= FIRST BLOOD ======= >%s^n si a primit %i$!",
            
szKillerNameszVictimNameg_iFirstKillMoneyCT_KILL ] );
            
        }
        
    }
    new 
Weapon[8]
    
read_data(4Weaponsizeof(Weapon) -1)
    if(
iVictim == iKiller || !is_user_connected(iKiller))
        return
    static 
szKillerName32 ], szVictimName32 ];
    
get_user_nameiKillerszKillerNamesizeof szKillerName ) -);
    
get_user_nameiVictimszVictimNamesizeof szVictimName ) -);
    if(
cs_get_user_team(iKiller) == CS_TEAM_CT
    
&& equali(Weapon"knife")) {  
        
set_dhudmessage85170255, -1.00.3003.13.0 );
        
show_dhudmessage0" %s a fost IREAL %s^n si a primit 4000$ !",szKillerNameszVictimName );
        
fm_set_user_moneyiKillerclampfm_get_user_moneyiKiller ) + 4000016000 ), );
        
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);

ColaSola is offline
Whitez
Member
Join Date: Apr 2016
Location: London, UK
Old 04-30-2016 , 17:36   Re: Firstblood
Reply With Quote #2

Read both carefuly

Code:
show_dhudmessage(0, "< ======= FIRST BLOOD ======= >%s^n si a primit %i$" );
szKillerName, szVictimName, g_iFirstKillMoney[ TERRO_KILL ] ;
Code:
show_dhudmessage( 0, "< ======= FIRST BLOOD ======= >%s^n si a primit %i$!",
szKillerName, szVictimName, g_iFirstKillMoney[ CT_KILL ] );

Last edited by Whitez; 04-30-2016 at 17:37.
Whitez is offline
ColaSola
Junior Member
Join Date: Apr 2016
Old 04-30-2016 , 18:26   Re: Firstblood
Reply With Quote #3

lol im blind xD thanks ! this problem is fixed but i still need:

1.One more thing there is like that if(cs_get_user_team(iKiller) == CS_TEAM_CT
&& equali(Weapon, "knife
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_iFirstKillMoneyMAX_KILLS ];
new 
bool:g_bFirstKillWasMade;

new 
g_iMaxPlayers;
public 
plugin_init( )
{
    
register_pluginPLUGINVERSION"askhanar" );
    
    
register_event(  "HLTV",  "ev_NewRound",  "a",  "1=0",  "2=0"  );
    
register_event(  "DeathMsg",  "ev_DeathMsg",  "a"  );
    
    
// --| Banii primiti pentru fiecare first kill.
    
g_iFirstKillMoneyTERRO_KILL ] = 2000;        // --| FirstKill de la TERO
    
g_iFirstKillMoneyCT_KILL ] = 2000;        // --| FirstKill de la CT
    
    
g_bFirstKillWasMadefalse;
    
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 
iKilleriVictim;
    
iKiller read_data);
    
iVictim read_data);
    
    
    if( ( 
<= iKiller <= g_iMaxPlayers ) && iKiller != iVictim )
    {
        
        if(  
cs_get_user_teamiKiller ) == CS_TEAM_T && !g_bFirstKillWasMade )
        {
            
g_bFirstKillWasMade true;
            
fm_set_user_money iKillerfm_get_user_money iKiller ) + g_iFirstKillMoney TERRO_KILL ], );
            
client_cmd(0,"spk furien/firstblood")
            
            static 
szKillerName32 ], szVictimName32 ];
            
            
get_user_nameiKillerszKillerNamesizeof szKillerName ) -);
            
get_user_nameiVictimszVictimNamesizeof szVictimName ) -);
            
            
set_dhudmessage(random(244), random(244), random(244), -1.00.1515.15.0);
            
show_dhudmessage(0"< ======= FIRST BLOOD ======= >%s^n si a primit %i$!",
            
szKillerNameszVictimNameg_iFirstKillMoneyTERRO_KILL ] );
            
        }
        
        else if(  
cs_get_user_teamiKiller ) == CS_TEAM_CT && !g_bFirstKillWasMade )
        {
            
g_bFirstKillWasMade true;
            
fm_set_user_money iKillerfm_get_user_money iKiller ) + g_iFirstKillMoney CT_KILL ], );
            
client_cmd(0,"spk furien/firstblood")
            
            static 
szKillerName32 ], szVictimName32 ];
            
            
get_user_nameiKillerszKillerNamesizeof szKillerName ) -);
            
get_user_nameiVictimszVictimNamesizeof szVictimName ) -);
            
            
set_dhudmessagerandom(244), random(244), random(244), -1.00.1515.15.0 );
            
show_dhudmessage0"< ======= FIRST BLOOD ======= >%s^n si a primit %i$!",
            
szKillerNameszVictimNameg_iFirstKillMoneyCT_KILL ] );
            
        }
        
    }
    new 
Weapon[8]
    
read_data(4Weaponsizeof(Weapon) -1)
    if(
iVictim == iKiller || !is_user_connected(iKiller))
        return
    static 
szKillerName32 ], szVictimName32 ];
    
get_user_nameiKillerszKillerNamesizeof szKillerName ) -);
    
get_user_nameiVictimszVictimNamesizeof szVictimName ) -);
    if(
cs_get_user_team(iKiller) == CS_TEAM_CT
    
&& equali(Weapon"knife")) {  
        
set_dhudmessage85170255, -1.00.3003.13.0 );
        
show_dhudmessage0" %s a fost IREAL %s^n si a primit 4000$ !",szKillerNameszVictimName );
        
fm_set_user_moneyiKillerclampfm_get_user_moneyiKiller ) + 4000016000 ), );
        
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);

ColaSola is offline
ColaSola
Junior Member
Join Date: Apr 2016
Old 05-01-2016 , 13:53   Re: Firstblood
Reply With Quote #4

up.. still have this problem..
ColaSola is offline
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 14:14.


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