AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   EventDeathMsg (https://forums.alliedmods.net/showthread.php?t=249563)

Snitch 10-07-2014 18:35

EventDeathMsg
 
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 );
}

xxxperts 10-08-2014 00:55

Re: EventDeathMsg
 
Sorry, I didn't understood, what did you want..! Exactly.

Snitch 10-08-2014 06:43

Re: EventDeathMsg
 
Quote:

Originally Posted by xxxperts (Post 2208521)
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

RateX 10-09-2014 05:35

Re: EventDeathMsg
 
Look at cstrike.inc

Snitch 10-09-2014 09:29

Re: EventDeathMsg
 
Quote:

Originally Posted by RateX (Post 2208906)
Look at cstrike.inc

what??

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

i have already T func kill

RateX 10-09-2014 10:05

Re: EventDeathMsg
 
Quote:

Originally Posted by Snitch (Post 2208972)
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.

Snitch 10-09-2014 17:55

Re: EventDeathMsg
 
Quote:

Originally Posted by RateX (Post 2208986)
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;



xxxperts 10-11-2014 01:13

Re: EventDeathMsg
 
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



Snitch 10-11-2014 06:07

Re: EventDeathMsg
 
Quote:

Originally Posted by xxxperts (Post 2209687)
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

xxxperts 10-11-2014 06:24

Re: EventDeathMsg
 
i had edited the post please check now.


All times are GMT -4. The time now is 17:39.

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