Raised This Month: $ Target: $400
 0% 

Plugin event HOOKdeathmessage error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 06-29-2010 , 16:18   Plugin event HOOKdeathmessage error
Reply With Quote #1

I'm trying to edit plugin Hns Shop to Deathrun Shop [$ without points]

work perfectly, but also I see in error_log this message:

PHP Code:
L 08/27/2009 23:10:44: [AMXXDisplaying debug trace (plugin "Deathrun_Shop.amxx")
L 08/27/2009 23:10:44: [AMXXRun time error 4index out of bounds 
L 08
/27/2009 23:10:44: [AMXX]    [041590.attach::Hook_Deathmessage (line 449
don't see [line] because I removed any comments..

bus I think this event doesn't work perfectly in deathrun mod :F [trigger_hurt kill and worldspawn..]

PHP Code:
//// DR_Shop.sma
// Header size:           2476 bytes
// Code size:            29812 bytes
// Data size:            13720 bytes
// Stack/heap size:      16384 bytes; estimated max. usage=781 cells (3124 bytes
)
// Total requirements:   62392 bytes
// Done.
//
// Compilation Time: 0,7 sec
// ---------------------------------------- 
PHP Code:
/* --| Event when player died */
public Hook_Deathmessage()
{
    
/* --| If plugin is on... */
    
if( get_pcvar_numgDrShopOn ) == )
    {
        
/* --| Get the killer and attacker */
        
new killer read_data);
        new 
victim read_data);

        
/* --| If player has died with world / trigger_hurt */
        
if( killer == victim )
        {
            return 
PLUGIN_HANDLED;
        }
        if ( 
is_user_bot(victim) )
        {
            return 
PLUGIN_HANDLED;
        }
        if ( 
is_user_bot(killer) )
        {
            return 
PLUGIN_HANDLED;
        }
        if ( !
is_user_connected(killer) )
        {
            return 
PLUGIN_HANDLED;
        }
        if ( !
is_user_connected(victim) )
        {
            return 
PLUGIN_HANDLED;
        }
        
        
/* --| Setting killer points when killed a enemy */
        
new money cs_get_user_money(killer);
        
cs_set_user_money(killermoney+get_pcvar_numgKillerPointsCvar ) );
    
        
/* --| Reseting items */
        
HasHevictim ] = false;
        
HasBothGrenvictim ] = false;
        
HasSilentvictim ] = false;
        
HasHealthvictim ] = false;
        
HasArmorvictim ] = false;
        
HasSpeedvictim ] = false;
        
HasGravityvictim ] = false;
        
HasInvisvictim ] = false;
        
HasNoclipvictim ] = false;
        
HasJetvictim ] = false;
        
HasDeaglevictim ] = false;
        
//HasLongJump[ victim ] = false;
        
HasGlowvictim ] = false;
        
HasNVGvictim ] = false;
        
        
set_user_gravityvictim1.0 );    
        
set_user_maxspeedvictim0.0 );
        
set_user_footstepsvictim);
        
set_user_noclipvictim);
        
set_user_renderingvictim );
        
set_user_nvgvictim);
        
remove_user_nvgvictim );
        
remove_taskvictim );
    }
    
    return 
PLUGIN_CONTINUE;

and other question to masters , what is better to use fakemeta or <engine> , e.g to create/edit/remove new entities.?
Attached Files
File Type: sma Get Plugin or Get Source (Dr_shop.sma - 648 views - 29.9 KB)

Last edited by AngeIII; 10-17-2012 at 17:25. Reason: [delete]information add
AngeIII is offline
Send a message via Skype™ to AngeIII
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 06-30-2010 , 17:25   Re: Plugin event HOOKdeathmessage error
Reply With Quote #2

what you think about

PHP Code:
if(!killer || !attacker)
{
    return 
PLUGIN_HANDLED;

?
AngeIII is offline
Send a message via Skype™ to AngeIII
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-30-2010 , 17:29   Re: Plugin event HOOKdeathmessage error
Reply With Quote #3

Hook_Deathmessage (line 449

Line 449 is not a part of Hook_Deathmessage in the plugin you attached.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 06-30-2010 , 17:58   Re: Plugin event HOOKdeathmessage error
Reply With Quote #4

Yes. this is because i removed any comments.

in old plugin LINE 449 is a part of
public shop_handler function.

446 case 3:
447 {
448 /* --| If already has item, show a damn print and return */
449 if( HasSilent[ id ] )
450 {
451 allready_have( id );
452 return PLUGIN_HANDLED;
453 }
AngeIII is offline
Send a message via Skype™ to AngeIII
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-01-2010 , 00:51   Re: Plugin event HOOKdeathmessage error
Reply With Quote #5

Again, the line you show is a part of shop_handler() fonction, and not Hook_DeathMsg
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
edgaras85
Senior Member
Join Date: Mar 2010
Location: Lithuania
Old 07-01-2010 , 04:39   Re: Plugin event HOOKdeathmessage error
Reply With Quote #6

hehe
Here plugin
Dr_shop you attached
But error on Deathrun_shop.amxx
edgaras85 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 14:51.


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