Raised This Month: $ Target: $400
 0% 

Does RoundEnd Event count while dead?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
NiQu
Veteran Member
Join Date: Nov 2009
Old 05-23-2010 , 11:44   Does RoundEnd Event count while dead?
Reply With Quote #1

Hi, im making a sub-plugin for a core-plugin.
The core is not open-source but the sub is so here we go:

I was developing a feature that gives *cash* every roundend to terrorists and here is what i got atm:

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <cashmod>

#define PLUGIN "CM: RoundEnd Cash"
#define VERSION "0.0.5"
#define AUTHOR "ReCon"

new end_mode;

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
//Register Round End
    
register_logevent"eRound_end"2"1=Round_End" );
    
    
//Register A CVAR
    
end_mode register_cvar("cm_endmode""0");
}

public 
eRound_end()
{
    new 
mode get_pcvar_num(end_mode);
    new 
cash;
    
    if( !
EnoughPlayers() )
    {
        return 
PLUGIN_HANDLED;
    }
    
//Bunch of variables
    
new iPlayers[32], iNumiPidformat_text[128];
    
    
//Get all players
    
get_playersiPlayersiNum"a" );
    
    
//Browse through all players
    
for( new iiNumi++ )
    {
        
iPid iPlayers[i];
        new 
CsTeams:team cs_get_user_team(iPid);
        
        if( 
team == CS_TEAM_T )
        {
            switch( 
mode )
            {
                case 
0:
                {
                    if( 
is_user_alive(iPid) )
                    {
                        if( 
cm_get_user_admin(iPid) )
                        {
                            
cash 100;
                            
formatex(format_textsizeof(format_text) - 1"^x03You got 100 cash for surviving as a Terrorist!");
                        }
                        else
                        {
                            
cash 80;
                            
formatex(format_textsizeof(format_text) - 1"^x03You got 80 cash for surviving as a Terrorist!");
                        }
                    }
                }
                case 
1:
                {
                    if( 
is_user_alive(iPid) )
                    {
                        if( 
cm_get_user_admin(iPid) )
                        {
                            
cash 100;
                            
formatex(format_textsizeof(format_text) - 1"^x03You got 100 cash for surviving as a Terrorist!");
                        }
                        else
                        {
                            
cash 80;
                            
formatex(format_textsizeof(format_text) - 1"^x03You got 80 cash for surviving as a Terrorist!");
                        }
                    }
                    else
                    {
                        if( 
cm_get_user_admin(iPid) )
                        {
                            
cash 45;
                            
formatex(format_textsizeof(format_text) - 1"^x03You got 45 cash for being a Terrorist!");
                        }
                        else
                        {
                            
cash 25;
                            
formatex(format_textsizeof(format_text) - 1"^x03You got 25 cash for being a Terrorist!");
                        }
                    }
                }
                case 
2:
                {
                    
cash 0;
                    return 
PLUGIN_HANDLED;
                }
            }
            
cm_set_user_cash(iPidcm_get_user_cash(iPid) + cash);
            Print(
iPidformat_text);
        }
    }
    return 
PLUGIN_HANDLED;

My problem is that , when i have cm_endmode set to 1 and im dead when the roundend occours i dont get the message printed or the cash added.

However if i have cm_endmode set to 1 and i am alive at round end i do get cash, and if i have cm_endmode 2 i get nothing just like it should, but when im dead with cm_endmode 1 i dont get anything. Im suppose to get cash and there suppose to be a message to.

Why doesnt it print hte message and give the cash?
__________________
My Projects
  • RoTAPI V0.0.1 ------- Private
    • Progress - [||||||||||]
  • CashMod V0.0.6 ----- Public
    • Progress - [||||||||||]
  • CashMod V0.0.7 ----- Public
    • Progress - [||||||||||]
NiQu 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 05:18.


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