Raised This Month: $ Target: $400
 0% 

[ENGINE] Invalid entity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
last_hope
Senior Member
Join Date: Dec 2011
Old 11-12-2013 , 03:03   [ENGINE] Invalid entity
Reply With Quote #1

hi all!
seems I need help with code:

PHP Code:
public create_fart(id)
{
    new 
Float:origin[3]
    
entity_get_vector(idEV_VEC_originorigin)
    new 
FartEnt
    FartEnt 
create_entity("info_target")
    if(
FartEnt <= 0)
    {
        return 
PLUGIN_HANDLED_MAIN
    
}
    
entity_set_string(FartEntEV_SZ_classname"hazardous fart")
    new 
Float:MinBox[3]
    new 
Float:MaxBox[3]
    
MinBox[0] = -70.0
    MinBox
[1] = -70.0
    MinBox
[2] = -70.0
    MaxBox
[0] = 70.0
    MaxBox
[1] = 70.0
    MaxBox
[2] = 70.0
    entity_set_size
(FartEntMinBoxMaxBox)
    
entity_set_int(FartEntEV_INT_solid1)
    
entity_set_edict(FartEntEV_ENT_owner33+id)
    
entity_set_origin(FartEntorigin)
    new 
param[1]
    
param[0]= FartEnt
    set_task
(1.0,"fart_fume",111111+FartEnt,param,1,"b")
    
set_task(get_cvar_float("amx_fart_ttl"),"remove_fart",333333+FartEnt,param,1)
    return 
PLUGIN_CONTINUE

PHP Code:
public fart_fume(param[1])
{
    new 
FartEnt param[0]
    new 
Float:forigin[3], origin[3]
    
entity_get_vector(FartEntEV_VEC_originforigin)
    
FVecIVec(foriginorigin)
    new 
players[32], inum
    get_players
(players,inum)
    for(new 
;inum; ++i)
    {
        
message_begin(MSG_ONE,SVC_TEMPENTITY,{0,0,0},players[i])
        
write_byte(17)
        
write_coord(origin[0])
        
write_coord(origin[1])
        
write_coord(origin[2])
        
write_short(fart_spr)
        
write_byte(30)
        
write_byte(75)
        
message_end()
    }
    return 
PLUGIN_CONTINUE

Code:
L 11/11/2013 - 15:38:41: [ENGINE] Invalid entity 145
L 11/11/2013 - 15:38:41: [AMXX] Displaying debug trace (plugin "fart.amxx", version "0.1")
L 11/11/2013 - 15:38:41: [AMXX] Run time error 10: native error (native "entity_get_vector")
L 11/11/2013 - 15:38:41: [AMXX]    [0] fart.sma::fart_fume
__________________
last_hope is offline
Send a message via ICQ to last_hope
last_hope
Senior Member
Join Date: Dec 2011
Old 11-12-2013 , 03:04   Re: [ENGINE] Invalid entity
Reply With Quote #2

On AMXX 1.8.1 this error not happen.
How to fix it on 1.8.3?
__________________
last_hope is offline
Send a message via ICQ to last_hope
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 11-13-2013 , 10:38   Re: [ENGINE] Invalid entity
Reply With Quote #3

You need to make sure the entity is valid
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou 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 23:22.


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