AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Plugin event HOOKdeathmessage error (https://forums.alliedmods.net/showthread.php?t=130970)

AngeIII 06-29-2010 16:18

Plugin event HOOKdeathmessage error
 
1 Attachment(s)
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.?

AngeIII 06-30-2010 17:25

Re: Plugin event HOOKdeathmessage error
 
what you think about

PHP Code:

if(!killer || !attacker)
{
    return 
PLUGIN_HANDLED;


?

ConnorMcLeod 06-30-2010 17:29

Re: Plugin event HOOKdeathmessage error
 
Hook_Deathmessage (line 449

Line 449 is not a part of Hook_Deathmessage in the plugin you attached.

AngeIII 06-30-2010 17:58

Re: Plugin event HOOKdeathmessage error
 
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 }

ConnorMcLeod 07-01-2010 00:51

Re: Plugin event HOOKdeathmessage error
 
Again, the line you show is a part of shop_handler() fonction, and not Hook_DeathMsg

edgaras85 07-01-2010 04:39

Re: Plugin event HOOKdeathmessage error
 
hehe
Here plugin
Dr_shop you attached
But error on Deathrun_shop.amxx :D


All times are GMT -4. The time now is 14:51.

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