Raised This Month: $ Target: $400
 0% 

Menacing Menu Makes Me Mad


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
smdobay
Member
Join Date: Feb 2005
Old 06-21-2006 , 05:54   Menacing Menu Makes Me Mad
Reply With Quote #1

Sorry for the alliteration. Couldn't help it.

I'm trying to write a simple mirror damage/tk revenge plugin. There are several issues that I cannot seem to find.

First, the mirror damage simply is not occurring, and I don't see a reason. Perhaps I've stared at it too long?

And the Revenge menu call, menuReact, is not getting passed at all. Where's the inconsistency? Any help at all would be amazing.

Code:
#include <amxmodx> #include <cstrike> #include <fun> #include <amxmisc> #include <engine> new killChart[32] public plugin_init() {    register_plugin("Collateral Damage","1.0.1","Hoobs")    register_event("DeathMsg", "hook_death", "a", "1>0")    register_event("Damage", "hook_damage", "b")        register_menucmd(register_menuid("Revenge:^n"), 1023, "menuReact" )        return PLUGIN_CONTINUE } public hook_death() {    new Killer = read_data(1)    new Victim = read_data(2)        if( get_user_team( Killer ) == get_user_team( Victim ) )    {        //Team Killed                killChart[Victim] = Killer                ShowPunishMenu( Victim )    } } public mirror_damage() {     new damage = read_data( 2 );         new victim = read_data( 0 );         new attacker = get_user_attacker( victim )         if( get_user_team( victim ) == get_user_team( attacker ) && victim != attacker )     {         new HP = get_user_health( attacker ) - damage                 if( HP > 0 )             set_user_health( attacker,( get_user_health( attacker )-damage ) )         else user_kill( attacker )     }         return PLUGIN_CONTINUE } public ShowPunishMenu( id ){    new szMenuBody[256]    new keys    new nLen = format( szMenuBody, 255, "Revenge:^n" )    nLen += format( szMenuBody[nLen], 255-nLen, "^n\w1. Slay" )    nLen += format( szMenuBody[nLen], 255-nLen, "^n\w2. Slap for 50 damage" )    nLen += format( szMenuBody[nLen], 255-nLen, "^n\w3. Take to 1 HP" )    nLen += format( szMenuBody[nLen], 255-nLen, "^n\w4. Steal half of killer's money" )        nLen += format( szMenuBody[nLen], 255-nLen, "^n^n\w0. Forgive" )    keys = (1<<0|1<<1|1<<2|1<<3|1<<9)    show_menu( id, keys, szMenuBody, -1 )    return PLUGIN_CONTINUE } public menuReact( id, key ) {     new killer = killChart[id]         client_print( 0, print_chat, "EXECUTING" )         //if( is_user_alive( killer ) && is_user_connected( killer ) )     //{         switch( key )         {             case 0:             {                 user_kill( killer )                 client_print( killer, print_chat, "You have been slain for killing a teammate" )             }             case 1:             {                 user_slap( killer, 50 )                 client_print( killer, print_chat, "You have been slapped for killing a teammate" )             }             case 2:             {                 set_user_health( killer, 1 )                 set_user_armor( killer, 0 )                 client_print( killer, print_chat, "You have reduced to 1 hp for killing a teammate" )             }             case 3:             {                 new amount = floatround( cs_get_user_money( killer ) / 2.0 )                 cs_set_user_money( id, cs_get_user_money( id + amount ) )                 cs_set_user_money( killer, cs_get_user_money( killer - amount ) )                 client_print( killer, print_chat, "You have had half your money stolen for killing a teammate" )             }             case 9:             {                     client_print( killer, print_chat, "You have forgiven for killing a teammate" )               }         //}     }        return PLUGIN_CONTINUE }
__________________
My karma ran over your dogma


+Karma if I helped
smdobay is offline
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 06-21-2006 , 07:34  
Reply With Quote #2

Here are some something you can try
Code:
new killChart[32] // Should be 33   register_event("Damage", "Event_Damage", "be", "2>0") public Event_Damage(id) {     //new iDamageAP = read_data(1) // Armor Damage         // Health Damage     new iDamageHP = read_data(2)            // Damage Type     new DamageType = read_data(3)         // Attacker     new Weapon, Bodypart     new Enemy = get_user_attacker(id, Weapon, Bodypart)     }                                       // Menu name register_menucmd(register_menuid("Revenge"), 1023, "menuReact")                                       // Menu name show_menu(id, keys, szMenuBody, -1, "Revenge")
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.
Cheap_Suit 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 02:40.


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