AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Odd double entity problem with EngFunc_CreateNamedEntity (https://forums.alliedmods.net/showthread.php?t=74301)

dodsynthetic 07-15-2008 22:17

Odd double entity problem with EngFunc_CreateNamedEntity
 
OK, here is a strange problem I've been dealing with the last 12 hours. Anytime I spawn a weapon entity (give player that weapon), after about 18 seconds, the place where I spawned it, another will appear and the original dropped gun will go away after 20 seconds like normal. I tested using engine also and got the same problem so I'm wondering if I'm missing something. As a sample:

Code:
wep_ent_id = engfunc(EngFunc_CreateNamedEntity,engfunc(EngFunc_AllocString,"weapon_garand"))         // Let's drop the players current weapon     client_cmd(id, "drop")     // Retrieve player's positional vector     pev(id,pev_origin,temp_player_origin)         // Set weapon vector to player's vector     engfunc(EngFunc_SetOrigin,wep_ent_id,temp_player_origin)         // Force it to drop to the ground     engfunc(EngFunc_DropToFloor,wep_ent_id)         // Make sure it thinks so it goes away on it's own     dllfunc(DLLFunc_Think,wep_ent_id)         // Spawn the ent     dllfunc(DLLFunc_Spawn,wep_ent_id)

I don't have any set_task running to create it a second time and it happens with something as simple as the above. I also can't catch this phantom weapon entity when it appears by either model or classname but still acts like a regular weapon on the ground. :shock: This was all performed on AMX v1.7, Winblows server and 1.8 on Linux. I just want this phantom to not appear or force it to leave but I've been unsuccessful so far.

dodsynthetic 07-15-2008 23:43

Re: Odd double entity problem with EngFunc_CreateNamedEntity
 
I was able to finally see what the odd weapon ent's IDs are with EngFunc_FindEntityInSphere. When a player touches the spawned weapon ent, it gives it to them with the same id it was made with but then a new one is created immediately after for some strange reason which is where this mystery one is coming from. I should be able to fix this issue now though. XD

Vet 07-18-2008 00:24

Re: Odd double entity problem with EngFunc_CreateNamedEntity
 
That's just the nature of weapon_* entities in DOD. Treat them like the spawned bazookas and piats.


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

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