Raised This Month: $ Target: $400
 0% 

Register a death event when rounds end(help)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
wy4 o0
New Member
Join Date: Aug 2010
Old 01-19-2016 , 10:44   Register a death event when rounds end(help)
Reply With Quote #1

Hi. I have a hidenseek server
Some of you knows the mod, and you know if you are TERRORIST, when round ends, and you are alive, you gain 1 frag for winning the round.

Now, i have created a mini frag based life system. When you reach 6 frags you gain 1 life by a DeathMsg event. So i want if it's possible to make an event for round ands, if I have 5 frags when the round ends to gain the life when the servers get me the frag for winning the round.

My code for that seems to be like this, but it doesn't work... like the event doesn't happens.
NOTE: The server gives me the frag when round starts/new round
You can find the hidenseeek plugin here

PHP Code:
public plugin_init(){
register_logevent("GiveALife"2"1=Round_End")  
}

public 
GiveALife() {

    new 
id read_data(1)    // Read id data !
    
new frags get_user_frags(id)
    
        if(
is_user_connected(id) && !is_user_bot(id) && is_user_alive(id) && frags == get_pcvar_num(plrfrags)  ) {
            
g_Life[id]++;
            
client_cmdid"spk woop" );
            
ColorChat(idRED"%s You gained^x04 1 life^x01 becouse you reached[^x03 %d^x01 ]^x04 frags^x01!"LIFETAGget_pcvar_num(plrfrags) )
        
    }
}

If someone wantts to help me with this, and he don't understand what I want to do, or for more lines from the entired code, just ask.
Sorry for my bad english
wy4 o0 is offline
 



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 09:30.


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