Raised This Month: $ Target: $400
 0% 

Have no clue why it won't work!


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 06-27-2010 , 10:17   Have no clue why it won't work!
Reply With Quote #1

These two should work fine together:

PHP Code:
RegisterHamHam_Killed"player""player_killed"
+

PHP Code:
public player_killediVictimiAttacker )
{
    new 
iAttacker read_data(1)
    new 
iVictim read_data(2)
    
    if( 
iVictim == iAttacker )
        return 
PLUGIN_HANDLED
    
    
if( cs_get_user_teamiVictim ) == CS_TEAM_CT )
    {
        
gShouldSwitch[iVictim] = true
        gShouldSwitch
[iAttacker] = true
        iPoints
[iAttacker] += 35
        client_print_color
iAttackerBlue"^4[DoA] You gained^3 35 iPoints!" )
        
client_print_coloriVictimRed"^4[DoA] You have been killed, and will spawn as a ^3zombie^4 next round." )
    }
    else if( 
cs_get_user_teamiVictim ) == CS_TEAM_T )
    {
        
iPoints[iAttacker] += 35
        client_print_color
iAttackerRed"^4[DoA] You gained^3 35 iPoints!" )
        
client_print_coloriVictimRed"^4[DoA]^3 I trust you will do better next time.." )
    }
    
    return 
PLUGIN_HANDLED;

It won't display the message or add the points. Should I register a death message like this?

PHP Code:
register_event("DeathMsg""EventDeathMsg""a"); 
PHP Code:
public EventDeathMsg()
{
    new 
iAttacker read_data(1)
    new 
iVictim read_data(2)
    
    if( 
iVictim == iAttacker )
        return 
PLUGIN_HANDLED
    
    
if( cs_get_user_teamiVictim ) == CS_TEAM_CT )
    {
        
gShouldSwitch[iVictim] = true
        gShouldSwitch
[iAttacker] = true
        iPoints
[iAttacker] += 35
        client_print_color
iAttackerBlue"^4[DoA] You gained^3 35 iPoints!" )
        
client_print_coloriVictimRed"^4[DoA] You have been killed, and will spawn as a ^3zombie^4 next round." )
    }
    else if( 
cs_get_user_teamiVictim ) == CS_TEAM_T )
    {
        
iPoints[iAttacker] += 35
        client_print_color
iAttackerRed"^4[DoA] You gained^3 35 iPoints!" )
        
client_print_coloriVictimRed"^4[DoA]^3 I trust you will do better next time.." )
    }
    
    return 
PLUGIN_HANDLED;

EDIT: WHEN I REGISTERED A DEATH MESSAGE IT WORKED
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.

Last edited by GXLZPGX; 06-27-2010 at 11:05.
GXLZPGX 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 14:51.


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