[C#] Opening Gates?
-
I need to make a script that opens a gate. I have looked for native functions with no luck. I have looked through all the other functions that of in the ScriptHookVDOTNET SDK. Any help?
-
If it's an entity you can try
ENTITY::PLAY_ENTITY_ANIM
Native: http://www.dev-c.com/nativedb/func/info/7fb218262b810701
Anims: www.ls-multiplayer.com/dev/index.php?section=3
-
@sollaholla its for the prison gate
-
@sollaholla I'll try
-
There doors. There is a script controlling them. Use in a loop when you want open.
Function.Call(Hash._DOOR_CONTROL, Function.Call<int>(Hash.GET_HASH_KEY, "prop_gate_prison_01"), 1844.998f, 2604.813f, 44.640, false, 0.0, 0.0, -1.0f);
-
Even better check the state and then set to unlocked if locked. So they open and close.
unsafe
{
bool getlocked;
float getdoorHeading;Function.Call(Hash.GET_STATE_OF_CLOSEST_DOOR_OF_TYPE, Function.Call<int>(Hash.GET_HASH_KEY, "prop_gate_prison_01"), 1844.998f, 2604.813f, 44.640, &getlocked, &getdoorHeading); if (getlocked != false) { Function.Call(Hash._DOOR_CONTROL, Function.Call<int>(Hash.GET_HASH_KEY, "prop_gate_prison_01"), 1844.998f, 2604.813f, 44.640, false, 0.0, 0.0, 0.0f); } }