Posts: 95
Threads: 14
Joined: Mar 2013
Reputation:
0
i've searched a lot and none of them have worked for me, I just need a barrier that will open for any player, i just need it to open upwards, if someone could help me with that
Posts: 889
Threads: 4
Joined: Mar 2013
Reputation:
0
Get a mapeditor, choose an object to function as your gate, place the object in the "closed" position at LSPD. Save the creation code.
Use the streamer to create the object in your script, then define a dynamic area around your gate. Use OnPlayerEnterDynamicArea to detect if a player is in it, then move the object to the "open" position. Close it when that player OnPlayerLeaveDynamicArea.
Posts: 6,236
Threads: 310
Joined: Jan 2011
Reputation:
0
See my mGates include in my signature.
Posts: 66
Threads: 9
Joined: Nov 2012
Reputation:
0
new barier;
in ongamemodeinit
barier = CreateDynamicObject(object, x, y, z blablabla);
IsAtBarier()
{
if(newkeys & 16)
{
if(isplayerinrangeofpoint blabla
{
MoveDynamicObject(barier blabla);
SetTimerEx(barrierclose blabla)
}
}
return 1;
}
forward barierclose();
public barierclose()
{
//code here
return 1;
}
i hope you can
Posts: 889
Threads: 4
Joined: Mar 2013
Reputation:
0
Don't use timers, use OnPlayerEnterDynamicArea
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
For MoveObject to properly rotate the object, the object must change position. Even if it is 0.0001 units. Don't forget to move it back also, otherwise the object will become offset after opening the barrier a couple hundred times.