How to open barrier like this?
#1

How I can open barrier like this?

Reply
#2

https://sampwiki.blast.hk/wiki/MoveObject

Is that what you're looking for?
Reply
#3

Quote:
Originally Posted by Arthur Kane
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/MoveObject

Is that what you're looking for?
Thanks for fast answer..
I try that but don't working.. I put like this:
MoveObject(pdgate1,1544.6992188,-1623.8994141,13.0000000,0.005,0.0000000,8.0000000, 265.9982300);

It's same..
Reply
#4

How doesn't it work? What happens?

(If you're using dynamic objects, use MoveDynamicObject.)
Reply
#5

Quote:
Originally Posted by Arthur Kane
Посмотреть сообщение
How doesn't it work? What happens?

(If you're using dynamic objects, use MoveDynamicObject.)
I'm just using this FilterScript, and when i write "/po" barrier open very very fast, not in motion..

Код:
// This is the Gates System with aumomatic Gates
// This filterscript is made by >>>(((   Joksa   )))<<<

#include <a_samp>

new lspdg;
new pdgate1;

forward GateClose(playerid);

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Gates System by Joksa >>>Is Loaded<<<");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print("\n----------------------------------");
	print(" Gates System by Joksa >>>Is Loaded<<<");
	print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
pdgate1 = CreateObject(968,1544.6992188,-1623.8994141,13.0000000,0.0000000,88.0000000,265.9982300); // The gate is the PD garage
return 1;
}

public OnGameModeExit()
{
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/po", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 15,1544.5923,-1627.1566,13.382)) // The gate is the PD garage
{
if(lspdg == 1) { SendClientMessage(playerid, 0xFF000000, "** The door is already open!"); return 1; }
MoveObject(pdgate1,1544.6992188,-1623.8994141,13.0000000,25.0,0.0000000,8.0000000,265.9982300);
SendClientMessage(playerid, 0xFF000000,"The door to the garage open, after 7 seconds it will automatically be lowered.");
SetTimer("GateClose", 7000, 0);
}
return 1;
}
return 0;
}

public GateClose(playerid)
{
      MoveObject(pdgate1, 1544.6992188,-1623.8994141,13.0000000,25.0,0.0000000,88.0000000,265.9982300); // The gate is the PD garage
      PlayerPlaySound(playerid, 1153, 1589.053344,-1638.123168,14.122960);
      lspdg = 0;
      return 1;
}
Reply
#6

The object needs to actually move position (not just rotation) for MoveObject to work correctly. So increase the Z-position by 0.01 or so when opening and decrease by 0.01 when closing.
Reply
#7

Quote:
Originally Posted by Vince
Посмотреть сообщение
The object needs to actually move position (not just rotation) for MoveObject to work correctly. So increase the Z-position by 0.01 or so when opening and decrease by 0.01 when closing.
It's a barrier, it's just going up and down, not moving :-/
Reply
#8

Yes but try what Vince said and you will see what happens.
Reply
#9

He's not telling you to actually move it.



Read the first part.

(Hansrutger was faster, woops.)
Reply
#10

It's working!
Thank you all very much!
+rep
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)