lspd barrier
#1

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
Reply
#2

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.
Reply
#3

so you need a gate
Reply
#4

See my mGates include in my signature.
Reply
#5

Quote:
Originally Posted by MP2
Посмотреть сообщение
See my mGates include in my signature.
mp2 i already tried your include, but for some reason it didnt work for me.


Closed barrier pos :
CreateDynamicObject(968, 1544.69495, -1630.75745, 12.97999, 2.00000, 270.00000, 270.00000);


open barrier pos:
CreateDynamicObject(968, 1544.69495, -1630.75745, 12.97999, 2.00000, 0.00000, 270.00000);

could someone please help me make it so when a player goes near it opens the barrier
Reply
#6

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
Reply
#7

Don't use timers, use OnPlayerEnterDynamicArea
Reply
#8

Quote:
Originally Posted by Sithis
Посмотреть сообщение
Don't use timers, use OnPlayerEnterDynamicArea
Up To you :v i only give my script how to create gate can open and close
Reply
#9

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)