Raised This Month: $ Target: $400
 0% 

warnings (native "engfunc")


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Closer456
Member
Join Date: May 2013
Old 06-06-2013 , 18:00   warnings (native "engfunc")
Reply With Quote #1

What's wrong this code?
PHP Code:
public fm_Touch(ptrptd)
{
    if ( !
sh_is_active() ) return FMRES_IGNORED
    
if ( !pev_valid(ptr) ) return FMRES_IGNORED

    
static classname[32]
    
classname[0] = '^0'
    
pev(ptrpev_classnameclassname31)

    
// Lets block the picking up of a shield
    
if ( equal(classnamegPowerClass) ) {
        new 
id pev(ptrpev_owner)

        new 
Float:dRatioFloat:distanceBetweendamage
        
new Float:dmgRadius get_pcvar_float(gPcvarRadius)
        new 
maxDamage get_pcvar_num(gPcvarMaxDamage)
        new 
CsTeams:idTeam cs_get_user_team(id)
        new 
FFOn sh_friendlyfire_on()
        new 
Float:vicOrigin[3]
        new 
Float:fl_vExplodeAt[3]

        
pev(ptrpev_originfl_vExplodeAt)

        for ( new 
victim 1victim <= gMaxPlayersvictim++ )
        {
            if ( !
is_user_alive(victim) ) continue
            if ( 
idTeam == cs_get_user_team(victim) && !FFOn && id != victim ) continue

            
pev(victimpev_originvicOrigin)
            
distanceBetween vector_distance(fl_vExplodeAtvicOrigin)

            if ( 
distanceBetween <= dmgRadius )
            {
                
dRatio distanceBetween dmgRadius
                damage 
maxDamage floatround(maxDamage dRatio)

                
// Lessen damage taken by self
                
if (victim == iddamage floatround(damage 2.0)

                if ( !
damage damage 1    // Incase damage cvar is really low cause something if within the radius 
                
sh_extra_damage(victimiddamage"Kamehameha"_SH_DMG_NORMtrue_fl_vExplodeAt)

                
// Make them feel it
                
new Float:fl_vicVelocity[3]
                
fl_vicVelocity[0] = ((vicOrigin[0] - fl_vExplodeAt[0]) / distanceBetween) * 300.0
                fl_vicVelocity
[1] = ((vicOrigin[1] - fl_vExplodeAt[1]) / distanceBetween) * 300.0
                fl_vicVelocity
[2] = 150.0

                set_pev
(victimpev_velocityfl_vicVelocity)
                
sh_screen_shake(victim1.21.21.2)
            }
        }


        
// Make some Effects
        
new blastSize floatround(dmgRadius 12.0)

        
// Explosion Sprite
        
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
write_byte(TE_GLOWSPRITE)    //23
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[0])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[1])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[2])
        
write_short(gSpriteExplosion)    // model
        
write_byte(01)            // life 0.x sec
        
write_byte(blastSize)        // size
        
write_byte(255)            // brightness
        
message_end()

        
// Explosion (smoke, sound/effects)
        
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
write_byte(TE_EXPLOSION)    //3
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[0])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[1])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[2])
        
write_short(gSpriteSmoke)    // model
        
write_byte(blastSize+5)        // scale in 0.1's
        
write_byte(20)            // framerate
        
write_byte(10)            // flags
        
message_end()

        
// Create Burn Decals, if they are used
        
if ( get_pcvar_num(gPcvarDecals) ) {
            
// Change burn decal according to blast size
            
new decal random_num(0,2)
            if (
blastSize 18) {
                
//If radius >~ 216 use larger decals
                
decal += 3
            
}

            
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
            
write_byte(TE_GUNSHOTDECAL)    //109
            
engfunc(EngFunc_WriteCoordfl_vExplodeAt[0])
            
engfunc(EngFunc_WriteCoordfl_vExplodeAt[1])
            
engfunc(EngFunc_WriteCoordfl_vExplodeAt[2])
            
write_short(0)            //?
            
write_byte(gBurnDecal[decal])        //decal
            
message_end()
        }

        
// Stop the sounds
        
emit_sound(ptrCHAN_STATICgSoundBeamVOL_NORMATTN_NORMSND_STOPPITCH_NORM)
        
emit_sound(idCHAN_STATICgSoundReleaseVOL_NORMATTN_NORMSND_STOPPITCH_NORM)

        
engfunc(EngFunc_RemoveEntityptr)

        new 
Float:cooldown get_pcvar_float(gPcvarCooldown)
        if ( 
cooldown 0.0 sh_set_cooldown(idcooldown)

        
// Reset the Varible
        
gPowerID[id] = 0
        gUsingPower
[id] = false

        
// Switch back to previous weapon and reset speed...
        
if ( gLastWeapon[id] != CSW_KNIFE sh_switch_weapon(idgLastWeapon[id])
        else 
sh_reset_max_speed(id)
    }

    return 
FMRES_IGNORED

Here's the log:
PHP Code:
L 02/11/2012 19:28:51: [FAKEMETAInvalid entity
L 02
/11/2012 19:28:51: [AMXXDisplaying debug trace (plugin "modifytest.amxx")
L 02/11/2012 19:28:51: [AMXXRun time error 10native error (native "engfunc")
L 02/11/2012 19:28:51: [AMXX] [0textc9x2LU.sma::fm_Touch (line 432)
L 02/11/2012 19:29:02: [FAKEMETAInvalid entity 
Closer456 is offline
xPez
Member
Join Date: Apr 2013
Location: Sweden
Old 06-07-2013 , 03:30   Re: warnings (native "engfunc")
Reply With Quote #2

Can you please post the whole code?
xPez is offline
Send a message via Skype™ to xPez
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 06-07-2013 , 04:35   Re: warnings (native "engfunc")
Reply With Quote #3

PHP Code:
if( pev_validptr ) )
  
engfuncEngFunc_RemoveEntityptr ); 
__________________
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-07-2013 , 18:03   Re: warnings (native "engfunc")
Reply With Quote #4

Try that version
Attached Files
File Type: sma Get Plugin or Get Source (sh_ssjgohan.sma - 771 views - 16.9 KB)
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 06-07-2013 at 18:37.
ConnorMcLeod is offline
Reply


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 16:18.


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