Raised This Month: $ Target: $400
 0% 

Have no clue why it won't work!


Post New Thread Reply   
 
Thread Tools Display Modes
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
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 06-27-2010 , 11:07   Re: Have no clue why it won't work!
Reply With Quote #2

Don't use read_data in Ham_Killed, use params instead.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 06-27-2010 , 11:11   Re: Have no clue why it won't work!
Reply With Quote #3

Like drekes said, Ham_Killed detect automatically the killer and the victim... just here:

PHP Code:
iVictimiAttacker 
You only have to use as you want...

read_data( ) is for events.
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
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 14:51.


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