Raised This Month: $ Target: $400
 0% 

[REQ] If the player commits suicide...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 02-17-2010 , 17:49   Re: [REQ] If the player commits suicide...
Reply With Quote #1

If you also want to remove +1 death when not killed by player then try this:
PHP Code:
#include <amxmodx>
#include <fun>
#include <cstrike>

new g_frags[33]
new 
g_deaths[33]

public 
plugin_init(){
    
register_plugin("No Frag Loss""1.1""Sylwester")
    
register_message(get_user_msgid("ScoreInfo"), "update_score")
    
register_event("DeathMsg""player_death""a")
}

public 
client_connect(id){
    
g_frags[id] = 0
    g_deaths
[id] = 0
}

public 
player_death(){
    new 
id read_data(2)
    if(!
is_user_connected(id))
        return
    if(
read_data(1)<=0)
        
cs_set_user_deaths(id, --g_deaths[id])
}

public 
update_score(msg_idmsg_destmsg_entity){
    static 
idfragsdeaths
    id 
get_msg_arg_int(1)
    
frags get_msg_arg_int(2)
    
deaths get_msg_arg_int(3)
    if(
g_frags[id]==frags+&& g_deaths[id]==deaths-1){
        
set_msg_arg_int(20g_frags[id])
        
set_msg_arg_int(30g_deaths[id])
        
set_user_frags(idg_frags[id])
        
cs_set_user_deaths(idg_deaths[id])
    }else{
        
g_frags[id] = frags
        g_deaths
[id] = deaths
    
}

__________________
Impossible is Nothing
Sylwester 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 00:18.


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