AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   wiered crash (https://forums.alliedmods.net/showthread.php?t=5879)

karlos 09-15-2004 16:17

wiered crash
 
1 Attachment(s)
i have the following code (using NS b5)
Code:
public entholo(id){     entid = create_entity("info_target")     delid = entid     entity_set_string(entid,EV_SZ_classname,"ent")     entity_set_model(entid, "models/dancer.mdl")     new Float:MinBox[3]     new Float:MaxBox[3]     MinBox[0] = -10.0     MinBox[1] = -10.0     MinBox[2] = -45.0     MaxBox[0] = 10.0     MaxBox[1] = 10.0     MaxBox[2] = 33.0         set_size(entid, MinBox, MaxBox)         new pharm[1]     pharm[0] = id     set_task(0.1,"holdent",1000+id,pharm,1,"b")     return PLUGIN_HANDLED } public holdent(pharm[]){     new id = pharm[0]     new Float:look_start_vec[3]         pev(id,pev_origin, look_start_vec)         set_pev(entid, pev_origin, look_start_vec)         if ( !nowdrop  ){         set_pev(entid, pev_solid, 1)         set_pev(entid, pev_renderfx, kRenderFxHologram)         set_pev(entid, pev_rendermode, kRenderTransAdd)         set_pev(entid, pev_renderamt, 100.0)     }else{         remove_task(1000+id)         set_pev(entid, pev_solid, 2)         set_pev(entid, pev_movetype, 4)         nowdrop = 0     }     return PLUGIN_HANDLED } public entdrop(id){     nowdrop = 1     return PLUGIN_HANDLED }
it is working with AMXx 0.2 tp5 + ns2amx but with AMXx 0.2 tp5 + engine + fakemeta it crashes (in NS b4 it has worked),
exactly after using enthold,entdrop,enthold,entdrop and using now enthold it just crashs

any1 can help plz ?

error:

Da Bishop 09-15-2004 17:26

i not very good at reading german ....

karlos 09-15-2004 18:25

"the order 0x77f4215c points to memory 0x00000000. written can not be executed in this memory. press ok"

i dont know the exact terms but this is a fast translation

nethertheless its not realy neccassary to understand the text, its the fact that with ns2amx it works and with engine+fakemta not

karlos 09-16-2004 12:32

but using this it dont crash and i can spawn as many as i want
Code:
public droptest(id){     entid = create_entity("info_target")     entity_set_string(entid,EV_SZ_classname,"ent")         entity_set_model(entid, "models/dancer.mdl")         new Float:MinBox[3]     new Float:MaxBox[3]     MinBox[0] = -10.0     MinBox[1] = -10.0     MinBox[2] = -45.0     MaxBox[0] = 10.0     MaxBox[1] = 10.0     MaxBox[2] = 33.0         entity_set_vector(entid, EV_VEC_mins, MinBox)     entity_set_vector(entid, EV_VEC_maxs, MaxBox)         new Float:orig[3]     entity_get_vector(id,EV_VEC_origin,orig)         entity_set_origin(entid,orig)         entity_set_int(entid, EV_INT_sequence, 1)     entity_set_int(entid,EV_INT_solid,2)     entity_set_int(entid, EV_INT_movetype, 4)     new Float:colorvec[3]     colorvec[0] = 250.0     colorvec[1] = 250.0     colorvec[2] = 250.0     entity_set_int(entid, EV_INT_rendermode, kRenderTransTexture )     entity_set_vector(entid,EV_VEC_rendercolor,colorvec)     entity_set_float(entid, EV_FL_renderamt, 200.0 )     return PLUGIN_HANDLED }

the difference is:
this only spawns, the other spawns and i can place it with mouse where i want

karlos 09-16-2004 13:52

Re: wiered crash
 
advanced code to this
Code:
public entholo(id){     entid = create_entity("info_target")     delid = entid     entity_set_string(entid,EV_SZ_classname,"ent")     entity_set_model(entid, "models/holo_base.mdl")     new Float:MinBox[3]     new Float:MaxBox[3]     MinBox[0] = -10.0     MinBox[1] = -10.0     MinBox[2] = -45.0     MaxBox[0] = 10.0     MaxBox[1] = 10.0     MaxBox[2] = 33.0         set_size(entid, MinBox, MaxBox)         new pharm[1]     pharm[0] = id     set_task(0.1,"holdent",1000+id,pharm,1,"b")     return PLUGIN_HANDLED } public holdent(pharm[]){     new id = pharm[0]     new Float:look_start_vec[3]         pev(id,pev_origin, look_start_vec)     engfunc(EngFunc_GetAimVector, id, 400, look_vec)         look_end_vec[0] = look_start_vec[0] + look_vec[0]     look_end_vec[1] = look_start_vec[1] + look_vec[1]     look_end_vec[2] = look_start_vec[2] + look_vec[2]         trace_line(id, look_start_vec, look_end_vec, look_at_vec)         engfunc(EngFunc_VecToAngles, look_vec, angle_vec)     angle_vec[0] = 0.0     angle_vec[1] += 180     set_pev(baseid, pev_angles_x, angle_vec[0])     set_pev(baseid, pev_angles_y, angle_vec[1])     set_pev(baseid, pev_angles_z, angle_vec[2])         new Float:look_at_vec2[3]     look_at_vec2[0] = look_at_vec[0]     look_at_vec2[1] = look_at_vec[1]     look_at_vec2[2] = look_at_vec[2] - 400     trace_line(baseid, look_at_vec, look_at_vec2, look_at_vec)     set_pev(entid, pev_origin, look_start_vec)         if ( !nowdrop  ){         set_pev(entid, pev_solid, 1)     }else{         remove_task(1000+id)         set_pev(entid, pev_solid, 2)                                 droprest(look_at_vec,angle_vec)         nowdrop = 0     }     return PLUGIN_HANDLED } public entdrop(id){     nowdrop = 1     return PLUGIN_HANDLED } droprest(Float:orig[3], Float:angle[3]){     new Float:orig_place[3]         lightid = create_entity("info_target")     set_pev(baseid,pev_classname,"light")     engfunc(EngFunc_SetModel, lightid, "models/holo_light.mdl")     engfunc(EngFunc_SetOrigin, lightid, orig)     set_pev(lightid, pev_solid, 1)     set_pev(lightid, pev_rendermode, kRenderTransAdd )     set_pev(lightid, pev_renderamt, 100.0 )         girlid = create_entity("info_target")     set_pev(baseid,pev_classname,"girl")     engfunc(EngFunc_SetModel, girlid, "models/dancer.mdl")     orig_place[0] = orig[0]     orig_place[1] = orig[1]     orig_place[2] = orig[2] + 56     set_pev(girlid, pev_angles_x, angle_vec[0])     set_pev(girlid, pev_angles_y, angle_vec[1])     set_pev(girlid, pev_angles_z, angle_vec[2])     engfunc(EngFunc_SetOrigin, girlid, orig_place)     set_pev(girlid, pev_solid, 1)     set_pev(girlid, pev_renderfx, kRenderFxHologram)     set_pev(girlid, pev_rendermode, kRenderTransAdd )     set_pev(girlid, pev_renderamt, 100.0 )     //set_pev(lightid, pev_light_level, 400) }
now it even crashes with amxx tp5 (or nightbuild) + ns2amx but NOT with amx 0.9.8 + ns2amx
plz help, i dont really want to change to amx

mahnsawce 09-17-2004 10:42

Can you do me a favor and paste the entire script, not just the snippet that crashes

karlos 09-17-2004 12:24

this is the entire code, only plugin_init, inculde and defines are missing

in plugin init there is only
register_plugin(...)
register_concmd("amx_makeent","entholo",admin _level_b,"")
register_concmd("amx_drop","entdrop",admin_le vel_b,"")

defines are
new entid, lightid, girlid, nowdrop, delid (delid not needed just remains from debug)

btw the thing with change solid to 1 instead off 2 stopped crash but i need to have collition (hitbox) or whatever its called, its just should not be like a ghost but as a wall


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

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