AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Problem with entity (https://forums.alliedmods.net/showthread.php?t=215205)

didoWEE 05-04-2013 17:31

Problem with entity
 
Hi all.
I'm trying to make an entity to follow me. But the entity doesn't appears.
Here's the code:
PHP Code:

#include <amxmodx>
#include <engine>
#include <hamsandwich>

new szMdl[] = "models/TEST.mdl";

public 
plugin_init() register_clcmd("say /test""Func");
public 
plugin_precache() precache_model(szMdl);

public 
Func(id)
{
    new 
ent create_entity("info_target");
    
ExecuteHam(Ham_CS_RoundRespawnent);
    
    
entity_set_string(entEV_SZ_classname"classname");
    
    new 
Float:fVecOrigin[3];
    
entity_get_vector(idEV_VEC_originfVecOrigin);
    
entity_set_vector(entEV_VEC_originfVecOrigin);
    
// entity_set_origin(ent, fVecOrigin);
    
    
entity_set_float(entEV_FL_takedamage25.0); // Also can someone tell me what is this for
    // I saw it in the NPC tutorial but I don't know what is it for
    
entity_set_float(entEV_FL_health250.0);
    
    
entity_set_size(entFloat:{0.00.00.0}, Float:{50.050.050.0});
    
entity_set_int(entEV_INT_solidSOLID_NOT);
    
entity_set_model(entszMdl);

    
entity_set_int(entEV_INT_movetypeMOVETYPE_FOLLOW);
    
entity_set_edict(entEV_ENT_aimentid);
    
    
entity_set_int(entEV_INT_renderfxkRenderFxGlowShell);
    
entity_set_int(entEV_INT_rendermodekRenderTransAlpha);
    
entity_set_float(entEV_FL_renderamt50.0);
    
entity_set_vector(entEV_VEC_rendercolorFloat:{0.0200.010.0});
    
    
entity_set_float(entEV_FL_animtime2.0)
    
entity_set_float(entEV_FL_framerate1.0)
    
entity_set_int(entEV_INT_sequence0);



ConnorMcLeod 05-04-2013 18:37

Re: Problem with entity
 
ExecuteHam(Ham_CS_RoundRespawn, ent)

->

DispatchSpawn( ent )

didoWEE 05-05-2013 05:49

Re: Problem with entity
 
Again, didn't work. I mean, it doesn't appears.

Btw, did you see my comments? Can you tell me what is take_damage for because I don't want to make new tread?

hornet 05-05-2013 07:29

Re: Problem with entity
 
Change kRenderTransAlpha to kRenderTransTexture.

.Dare Devil. 05-05-2013 07:38

Re: Problem with entity
 
First, if you add entity_set_edict(ent, EV_ENT_aiment, id) to entity then that id will not see that ent
( Also owner was needed to set if you want to use aiment if i remember correctly )

2. if you use aiment then you cant change render stuff (EV_INT_rendermode, EV_INT_renderfx etc...)
if you do then entity will be invisible for ohter but you can see it with CAMERA_3RDPERSON view mode.

hornet 05-05-2013 08:10

Re: Problem with entity
 
Quote:

Originally Posted by hornet (Post 1946170)
Change kRenderTransAlpha to kRenderTransTexture.

Oh wait seems that it won't work with any render mode that allow alpha change.

didoWEE 05-05-2013 08:38

Re: Problem with entity
 
I'm trying to make entity which moves with me and looks like ZP: Force Field. But it doesn't appears. I can't see problem to see entities with entity_set_edict(ent, EV_ENT_aiment, id);

hornet 05-05-2013 08:43

Re: Problem with entity
 
Quote:

Originally Posted by didoWEE (Post 1946220)
I can't see problem to see entities with entity_set_edict(ent, EV_ENT_aiment, id);

Try to make more sense.
I haven't played zombie plague in a long time so I'm not sure what you mean. Can't you just set glow on the player or is it supposed to appear as a glowing sphere?

didoWEE 05-05-2013 08:50

Re: Problem with entity
 
I want http://www.prikachi.com/users/volinouse/7T.png to move with me everywhere


All times are GMT -4. The time now is 10:50.

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