Raised This Month: $ Target: $400
 0% 

if user die


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Groven
AlliedModders Donor
Join Date: Apr 2011
Location: Sweden
Old 05-07-2011 , 19:26   if user die
Reply With Quote #1

Hello,

I'm new at coding so i'm trying to add so if he commit suicide he lose 1 points.

PHP Code:
public eDeath() 
{
    new 
killer read_data(1);
    new 
victim read_data(2);
    new 
gpoints_kill get_pcvar_num(points_kill);
    new 
gpoints_hs get_pcvar_num(points_hs);
    new 
gpoints_suicide get_pcvar_num(points_suicide);
 
    if( 
IsPlayer(killer) && is_user_connected(killer) )
    {
        if( 
victim != killer )
        {
            if( 
cs_get_user_team(victim) != cs_get_user_team(killer) )
            {
                if( 
is_user_alive(killer) )
                {                    
                    if(!
read_data(3))
                    {
                        
gCM[killer] += gpoints_kill
                        
Print(killer"You gained %d Points!"gpoints_kill );
                    }
                    else if(
read_data(3))
                    {
                        
gCM[killer] += (gpoints_kill gpoints_hs);
                        Print(
killer"You gained %d Points!^x01 (Headshot)", (gpoints_hs gpoints_kill ) );
                    }
                    if( 
is_user_dead(suicide) )
                    {
                        if(!
read_data(3))
                        {
                            
gCM[suicide] += gpoints_suicide
                            
Print(suicide"You lost %d Points for Suicide!"gpoints_suicide );
                        }
    
                    
CheckLevel(killer);
                    
SaveData(killer);
                }
            }
        }
    } 
Groven is offline
 


Thread Tools
Display Modes

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 04:19.


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