AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Crash on entity creation (https://forums.alliedmods.net/showthread.php?t=41185)

Obbin 07-10-2006 16:01

Crash on entity creation
 
When I create a entity like this it's fine:

Code:
    client_print(id, print_chat, "Created ent")     new ent = create_entity("info_target")     entity_set_string(ent,EV_SZ_classname,"TeleCity")     entity_set_model(ent,"models/player/arctic/arctic.mdl")     entity_set_origin(ent,origin)     entity_set_int(ent, EV_INT_solid, SOLID_BBOX)     entity_set_int(ent, EV_INT_movetype, MOVETYPE_FLY)     new Float:mina[3]     mina[0]=MINUS_ORIGIN     mina[1]=MINUS_ORIGIN     mina[2]=MINUS_ORIGIN     new Float:maxa[3]     maxa[0]=PLUS_ORIGIN     maxa[1]=PLUS_ORIGIN     maxa[2]=PLUS_ORIGIN     entity_set_size(ent,mina,maxa)

But when I comment out the model setting it crashes:

Code:
    client_print(id, print_chat, "Created ent")     new ent = create_entity("info_target")     entity_set_string(ent,EV_SZ_classname,"TeleCity")     //entity_set_model(ent,"models/player/arctic/arctic.mdl")     entity_set_origin(ent,origin)     entity_set_int(ent, EV_INT_solid, SOLID_BBOX)     entity_set_int(ent, EV_INT_movetype, MOVETYPE_FLY)     new Float:mina[3]     mina[0]=MINUS_ORIGIN     mina[1]=MINUS_ORIGIN     mina[2]=MINUS_ORIGIN     new Float:maxa[3]     maxa[0]=PLUS_ORIGIN     maxa[1]=PLUS_ORIGIN     maxa[2]=PLUS_ORIGIN     entity_set_size(ent,mina,maxa)

Why?

karlos 07-10-2006 16:27

Re: Crash on entity creation
 
try commenting out EV_INT_solid and/or movetype
and setting them later

i had problems with them too

Rolnaaba 07-10-2006 16:28

Re: Crash on entity creation
 
EDIT: nevermind karlos answered you

v3x 07-10-2006 16:32

Re: Crash on entity creation
 
Also, if the entity isn't able to be created for whatever reason, hault the function:
Code:
new ent = create_entity("info_target") if(!ent)   return PLUGIN_HANDLED // use whatever return necessary

Obbin 07-11-2006 06:53

Re: Crash on entity creation
 
Quote:

Originally Posted by karlos
try commenting out EV_INT_solid and/or movetype
and setting them later

i had problems with them too

Later?
You mean with a task or what?

karlos 07-11-2006 07:07

Re: Crash on entity creation
 
yes with a task

Obbin 07-12-2006 08:08

Re: Crash on entity creation
 
Hmm.. it still crashes when i get close to it =/
If anyone could provide me with a transparent, very small model I'd be grateful!

v3x 07-12-2006 12:27

Re: Crash on entity creation
 
Use shell.mdl.

karlos 07-12-2006 13:36

Re: Crash on entity creation
 
i experienced crashes when setting null.mdl ( empty models ) and then looking at it
but only with players, not entities

Obbin 07-12-2006 15:25

Re: Crash on entity creation
 
I solved it using one of the HighFPS models


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

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