Raised This Month: $12 Target: $400
 3% 

|REQ| Got a NaN velocity (problem)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 08-14-2015 , 17:47   |REQ| Got a NaN velocity (problem)
Reply With Quote #1

This is the code:
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#include <cstrike>
#include <engine>
#include <fun>
#include <biohazard>

#define Plugin    "Capsule"
#define Version    "2.9"
#define Author    "Asd'"

new CapsuleMdl[] = "models/biohazard/w_hp_armor_capsule.mdl"
new ReceivedSd[] = "biohazard/capsule_alert.wav"
new Capsule[33]
new 
Float:Colors[3][3] = {
    {
0.0200.00.0}, 
    {
200.00.00.0}, 
    {
0.00.0200.0
}

public 
plugin_init( )
{
    
register_pluginPluginVersionAuthor )    
    
register_touch"Capsule""player""CapsuleTouch" )
    
    
register_touch"Capsule""worldspawn""CapsuleBounce" )
    
    
RegisterHamHam_Killed"player""CapsuleCreate")
    
RegisterHamHam_Spawn"player""CapsuleRemoved")
}

public 
plugin_precache( )
{
    
precache_modelCapsuleMdl )
    
precache_soundReceivedSd )        
}

public 
event_infect(victimattacker)
{
      new 
Team get_user_team(attacker)
      new 
Float:Origin[3]
      new 
Float:Velocidad[3]

      if(
is_user_zombie(attacker))
      {

        
set_task(15.0"CapsuleRemove2"attacker)

    
CapsuleRemoveattacker )
    
    new 
Entidad create_entity"info_target" )

    
entity_get_vectorattackerEV_VEC_originOrigin )
    
entity_set_stringEntidadEV_SZ_classname"Capsule" )
    
entity_set_modelEntidadCapsuleMdl )
    
    
entity_set_intEntidadEV_INT_rendermodekRenderNormal)
    
entity_set_intEntidadEV_INT_renderfxkRenderFxGlowShell )
        
entity_set_vectorEntidadEV_VEC_rendercolorColors[0] )    
    
entity_set_floatEntidadEV_FL_renderamt10.0 )

        
entity_set_edictEntidadEV_ENT_ownerattacker )
    
entity_set_intEntidadEV_INT_iuser1Team )
    
entity_set_intEntidadEV_INT_iuser2attacker )
    
    
entity_set_sizeEntidadFloat:{ -10.0, -10.0, -0.0 },  Float:{ 10.010.00.0 } )
    
entity_set_originEntidadOrigin )
    
    
entity_set_intEntidadEV_INT_solidSOLID_TRIGGER )

        
entity_set_intEntidadEV_INT_movetypeMOVETYPE_TOSS )
    
    
entity_get_vectorattackerEV_VEC_velocityVelocidad )
    
entity_set_vectorEntidadEV_VEC_velocityVelocidad )
    
    
Capsule[attacker] = Entidad
    
    entity_set_float
EntidadEV_FL_nextthinkget_gametime( ) + 1.0 )
    
      }
      return 
HAM_HANDLED
}

public 
CapsuleCreateVictimAttackerShouldGib )
{
        
        if( 
is_user_zombieVictim ) )
        return 
PLUGIN_HANDLED

    
new Float:Origin[3]
    new 
Float:Velocidad[3]
    
    
CapsuleRemoveVictim )

        new 
Team get_user_teamVictim )
    
    new 
Entidad create_entity"info_target" )
    
    
entity_get_vectorVictimEV_VEC_originOrigin )
    
entity_set_stringEntidadEV_SZ_classname"Capsule" )
    
entity_set_modelEntidadCapsuleMdl )
    
    
entity_set_intEntidadEV_INT_rendermodekRenderNormal)
    
entity_set_intEntidadEV_INT_renderfxkRenderFxGlowShell )
        
entity_set_vectorEntidadEV_VEC_rendercolorColors[0] )    
    
entity_set_floatEntidadEV_FL_renderamt10.0 )

        
entity_set_edictEntidadEV_ENT_ownerVictim )
    
entity_set_intEntidadEV_INT_iuser1Team )
    
entity_set_intEntidadEV_INT_iuser2Victim )
    
    
entity_set_sizeEntidadFloat:{ -10.0, -10.0, -0.0 },  Float:{ 10.010.00.0 } )
    
entity_set_originEntidadOrigin )
    
    
entity_set_intEntidadEV_INT_solidSOLID_TRIGGER )

        
entity_set_intEntidadEV_INT_movetypeMOVETYPE_TOSS )
    
    
entity_get_vectorVictimEV_VEC_velocityVelocidad )
    
entity_set_vectorEntidadEV_VEC_velocityVelocidad )
    
    
Capsule[Victim] = Entidad
    
    entity_set_float
EntidadEV_FL_nextthinkget_gametime( ) + 1.0 )
    
    return 
HAM_HANDLED
}

public 
CapsuleBounceEntidadWorld )
{
    if( !
is_valid_entEntidad ) )
        return 
PLUGIN_HANDLED
    
    
if( entity_get_edictEntidadEV_ENT_owner ) )
        
entity_set_edictEntidadEV_ENT_owner)
    
    return 
PLUGIN_HANDLED
}

public 
CapsuleRemovedid )
{    
    
CapsuleRemoveid )
    
    return 
HAM_IGNORED
}

public 
CapsuleTouchEntidadIndex )
{
    if( !
is_user_aliveIndex ) )
        return 
PLUGIN_HANDLED

        
if( is_user_zombieIndex ) )
        return 
PLUGIN_HANDLED
    
    
if( !is_valid_entEntidad ) )
        return 
PLUGIN_HANDLED
    
    
if( entity_get_edictEntidadEV_ENT_owner ) )
        return 
PLUGIN_HANDLED

        
new OldEntidad entity_get_intEntidadEV_INT_iuser2 )
    
    
set_user_health(Indexget_user_health(Index) + 35)

        
set_user_armor(Indexget_user_armor(Index) + 35)

    
emit_soundEntidadCHAN_ITEMReceivedSd1.0ATTN_NORM0PITCH_NORM )

        
client_print(Indexprint_center"[You got +35HP +35ARMOR]")

    
CapsuleRemoveOldEntidad )
    
    return 
PLUGIN_HANDLED
}

stock CapsuleRemoveIndex )
{
    if( ( 
Capsule[Index] != ) && is_valid_entCapsule[Index] ) )
    {
        
remove_entityCapsule[Index] )
        
Capsule[Index] = 0
    
}
}

public 
CapsuleRemove2Index )
{
    if( ( 
Capsule[Index] != ) && is_valid_entCapsule[Index] ) )
    {
        
remove_entityCapsule[Index] )
        
Capsule[Index] = 0
    
}

I keep getting these warnings/errors.How can i solve this?

PHP Code:
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule
Got a NaN velocity on Capsule 
Krtola is offline
Send a message via Skype™ to Krtola
Freezo Begin
BANNED
Join Date: Mar 2014
Location: Morocco
Old 08-14-2015 , 20:30   Re: |REQ| Got a NaN velocity (problem)
Reply With Quote #2

Don't repeat a same stock CapsuleRemove & CapsuleRemove2.
Remove CapsuleRemove2 and change the set_task callback(2 par) to CapsuleRemove.

Also event_infect() i didn't see biohazard yet,so i don't know if its a forward or not. if its not remove it.

Code:
entity_get_vector( Victim, EV_VEC_velocity, Velocidad )

shouldn't be entity_set_vector?

Last edited by Freezo Begin; 08-14-2015 at 20:30.
Freezo Begin is offline
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 08-15-2015 , 08:15   Re: |REQ| Got a NaN velocity (problem)
Reply With Quote #3

I do not know, I did not even touch that


entity_get_vector( Victim, EV_VEC_velocity, Velocidad )
Krtola is offline
Send a message via Skype™ to Krtola
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 18:51.


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