AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Reset movable entities origin on round start (https://forums.alliedmods.net/showthread.php?t=242651)

georgik57 06-22-2014 13:29

Reset movable entities origin on round start
 
As said in the title, I need to reset all the moveable entities' origin on round start(including func_train, etc. everything that can have its origin changed.).

Please help. Thanks in advance.

GuskiS 06-22-2014 14:35

Re: Reset movable entities origin on round start
 
https://forums.alliedmods.net/showth...16291?p=616291
MPNumB is da man for fixes :) <3

georgik57 08-08-2014 07:11

Re: Reset movable entities origin on round start
 
Quote:

Originally Posted by GuskiS (Post 2155747)

thank you. could the same be done for func_train or func_tracktrain?
some escape maps get bugged

Nextra 08-08-2014 10:15

Re: Reset movable entities origin on round start
 
The code is really simple, you could look for yourself if it works for func_train and func_tracktrain aswell. Just replace func_pushable with the desired entity classes. You can also copy-paste the while loop to perform the search with multiple entities, you just need to set iEnt = 0 in front of each while block.

NiHiLaNTh 08-08-2014 13:18

Re: Reset movable entities origin on round start
 
You can also try looping through all desired entities and calling ExecuteHam(Ham_CS_Restart, entity);

.Dare Devil. 08-09-2014 20:40

Re: Reset movable entities origin on round start
 
What if you hook entity spawn and then push all entities ( their index only ) into array and then loop the array in round start instead of that?

function i would use:
[php]
public pfn_keyvalue(ent)
{

static classname[32], key[32], value[32]
copy_keyvalue(classname, 31, key, 31, value, 31)
}
[php]
Is it true if i would say that its only called when server starts or loads map?
( nope, cant test it. I dont have counter strike right now! )

I dont remember seeing it calling when server was already running. I might be wrong tho.


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

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