SA-MP Forums Archive
lspd barrier - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: lspd barrier (/showthread.php?tid=430798)



lspd barrier - BossZk - 15.04.2013

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


Re: lspd barrier - Sithis - 15.04.2013

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.


Re: lspd barrier - tboysamp - 15.04.2013

so you need a gate


Re: lspd barrier - MP2 - 15.04.2013

See my mGates include in my signature.


Re: lspd barrier - BossZk - 15.04.2013

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


Re: lspd barrier - faiznurfaza - 15.04.2013

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


Re: lspd barrier - Sithis - 15.04.2013

Don't use timers, use OnPlayerEnterDynamicArea


Re: lspd barrier - faiznurfaza - 15.04.2013

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


Re: lspd barrier - Vince - 15.04.2013

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.