Raised This Month: $ Target: $400
 0% 

EventDeathMsg


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Snitch
Veteran Member
Join Date: Sep 2013
Location: Kazakhstan
Old 10-07-2014 , 18:35   EventDeathMsg
Reply With Quote #1

i have this code
Code:
public EventDeathMsg()
{
    static killer, victim, hs, cash;
    
    killer = read_data( 1 );
    victim = read_data( 2 );
    
    hs = read_data( 3 );
    
    if ( !is_user_connected( killer ) || !is_user_connected( victim ) )
        return 0;
    
    static CsTeams:teams[ 2 ];
    
    teams[ 0 ] = cs_get_user_team( killer );
    teams[ 1 ] = cs_get_user_team( victim );

    if ( teams[ 0 ] == teams[ 1 ] || teams[ 0 ] != CS_TEAM_T || teams[ 1 ] != CS_TEAM_CT )
        return 0;    
    
    if ( is_user_connected( killer ) && teams[ 0 ] == CS_TEAM_T )
    {
        cash = hs ? 100 : 100;
        
        user_give_cash( killer, cash );
        
        ColorChat( 0, NORMAL, "%s^x03 %s^x01 has killed^x03 %s^x01 and gain^x04 %i^x01 Cash.", g_szChatPrefix, GetUserName( killer ), GetUserName( victim ), cash );
    }

    return 0;
}
can someone add
CT Kill: Gain 50 cash + Message name kill name and gain amount cash
like this LINE
Quote:
if ( is_user_connected( killer ) && teams[ 0 ] == CS_TEAM_T )
{
cash = hs ? 100 : 100;

user_give_cash( killer, cash );

ColorChat( 0, NORMAL, "%s^x03 %s^x01 has killed^x03 %s^x01 and gain^x04 %i^x01 Cash.", g_szChatPrefix, GetUserName( killer ), GetUserName( victim ), cash );
}

Last edited by Snitch; 10-08-2014 at 06:45.
Snitch is offline
Send a message via Skype™ to Snitch
xxxperts
Senior Member
Join Date: Oct 2013
Location: India
Old 10-08-2014 , 00:55   Re: EventDeathMsg
Reply With Quote #2

Sorry, I didn't understood, what did you want..! Exactly.
__________________
All my work is here
xxxperts is offline
Snitch
Veteran Member
Join Date: Sep 2013
Location: Kazakhstan
Old 10-08-2014 , 06:43   Re: EventDeathMsg
Reply With Quote #3

Quote:
Originally Posted by xxxperts View Post
Sorry, I didn't understood, what did you want..! Exactly.
Read Again the Thread.

i want Counter-Terrorists killed will gain 50 cash, but i dont know how to add it

Last edited by Snitch; 10-08-2014 at 06:46.
Snitch is offline
Send a message via Skype™ to Snitch
RateX
Veteran Member
Join Date: Jun 2012
Location: 0o. SEA .o0
Old 10-09-2014 , 05:35   Re: EventDeathMsg
Reply With Quote #4

Look at cstrike.inc
RateX is offline
Snitch
Veteran Member
Join Date: Sep 2013
Location: Kazakhstan
Old 10-09-2014 , 09:29   Re: EventDeathMsg
Reply With Quote #5

Quote:
Originally Posted by RateX View Post
Look at cstrike.inc
what??

im just want to add CT Kill and he will gain 50 Cash

i have already T func kill
Snitch is offline
Send a message via Skype™ to Snitch
RateX
Veteran Member
Join Date: Jun 2012
Location: 0o. SEA .o0
Old 10-09-2014 , 10:05   Re: EventDeathMsg
Reply With Quote #6

Quote:
Originally Posted by Snitch View Post
what??

im just want to add CT Kill and he will gain 50 Cash

i have already T func kill
Have you actually did what I told you? Because if you did, you would have solved the cash problem by now.
RateX is offline
Snitch
Veteran Member
Join Date: Sep 2013
Location: Kazakhstan
Old 10-09-2014 , 17:55   Re: EventDeathMsg
Reply With Quote #7

Quote:
Originally Posted by RateX View Post
Have you actually did what I told you? Because if you did, you would have solved the cash problem by now.
Please stop responding if you did not understand and did not you read my post.

I added myself, but I do not get a message that I have killed the terrorist
PHP Code:
public EventDeathMsgclient )
{
    static 
killervictimcash;
    
    
killer read_data);
    
victim read_data);
    
    if ( !
is_user_connectedvictim ) )
        return 
0;
    
    static 
CsTeams:teams];
    
    if ( 
is_user_connectedkiller ) )
        
teams] = cs_get_user_teamkiller );
    
    
teams] = cs_get_user_teamvictim );
    
    if ( 
teams] == teams] || teams] != CS_TEAM_T || teams] != CS_TEAM_CT )
        return 
0;    
    
    if ( 
is_user_connectedkiller ) && teams] == CS_TEAM_T )
    {
        
cash 100;
        
        
user_give_cashkillercash );
        
        
ColorChat0NORMAL"^x03 %s^x01 has killed^x03 %s^x01 Builder and gain^x04 %i^x01 CP."GetUserNamekiller ), GetUserNamevictim ), cash );
    }
    
    if ( 
is_user_connectedkiller ) && teams] == CS_TEAM_CT )
    {
        
cash 50;
            
        
user_give_cashkillercash );
            
        
ColorChatclientNORMAL"You killed^x03 %s^x01 Zombie and gain^x04 %i^x01 CP."GetUserNamevictim ), cash );
    }

    return 
0;

Snitch is offline
Send a message via Skype™ to Snitch
xxxperts
Senior Member
Join Date: Oct 2013
Location: India
Old 10-11-2014 , 01:13   Re: EventDeathMsg
Reply With Quote #8

Try this, it would work.

PHP Code:
public EventDeathMsg() 

    static 
killervictimhscash
     
    
killer read_data); 
    
victim read_data); 
     
    
hs read_data); 
     
    if ( !
is_user_connectedkiller ) || !is_user_connectedvictim ) ) 
        return 
0

    if ( 
is_user_connectedkiller ) ) 
    {
        switch( 
get_user_teamkiller ) )
        {
            case 
cash hs 100 100;
            case 
cash hs 50 50;
        }
        
//cash = hs ? 100 : 100; 
         
        
user_give_cashkillercash ); 
         
        
ColorChat0NORMAL"%s^x03 %s^x01 has killed^x03 %s^x01 and gain^x04 %i^x01 Cash."g_szChatPrefixGetUserNamekiller ), GetUserNamevictim ), cash ); 
    } 

    return 
0

__________________
All my work is here

Last edited by xxxperts; 10-11-2014 at 06:23. Reason: updating the code :/
xxxperts is offline
Snitch
Veteran Member
Join Date: Sep 2013
Location: Kazakhstan
Old 10-11-2014 , 06:07   Re: EventDeathMsg
Reply With Quote #9

Quote:
Originally Posted by xxxperts View Post
Try this, it would work.

PHP Code:
public EventDeathMsg()
{
    static 
killervictimhscash;
    
    
killer read_data);
    
victim read_data);
    
    
hs read_data);
    
    if ( !
is_user_connectedkiller ) || !is_user_connectedvictim ) )
        return 
0;

    if ( 
is_user_connectedkiller ) )
    {
        
cash hs 100 100;
        
        
user_give_cashkillercash );
        
        
ColorChat0NORMAL"%s^x03 %s^x01 has killed^x03 %s^x01 and gain^x04 %i^x01 Cash."g_szChatPrefixGetUserNamekiller ), GetUserNamevictim ), cash );
    }

    return 
0;

No. No!

i need Terrorists Kill: gain 100 cash
and C-T Kill: gain 50 cash.

i have edit my post..
https://forums.alliedmods.net/showpo...47&postcount=7

Last edited by Snitch; 10-11-2014 at 06:07.
Snitch is offline
Send a message via Skype™ to Snitch
xxxperts
Senior Member
Join Date: Oct 2013
Location: India
Old 10-11-2014 , 06:24   Re: EventDeathMsg
Reply With Quote #10

i had edited the post please check now.
__________________
All my work is here
xxxperts 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 17:39.


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