Some help would be nice.
#1

Let's say I wanted to make an object move back and forth, and I'd want it to move after 4-5 seconds. How would this be done? I tried doing it myself and somewhat failed, but I have the idea.

Anyone?
Reply
#2

Same thing as making a gate
Reply
#3

Код:
public CheckGate()
{
  new c_gate_status;
  for(new i;i<MAX_PLAYERS;i++)
  {
    if(!IsPlayerConnected(i)) continue;
    if(IsPlayerInRangeOfPoint(i,10.0,closed_X,closed_Y,closed_Z))c_gate_status = 1;
  }
  if(c_gate_status)MoveObject(c_gate, open_X, open_Y, open_Z,Moving Speed);
  else MoveObject(c_gate, closed_X, closed_Y, closed_Z,Moving Speed);
What would you do/change?
Reply
#4

Kinda, use the function but not that one. just make your own based with your objects.
Reply
#5

Would you be able to provide an example if it's not too much?
Reply
#6

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

That can move a object!

As for after 4-5 seconds

https://sampwiki.blast.hk/wiki/SetTimer
Reply
#7

Would you be kind enough to form me an example combining those two?
Reply
#8

Click the links it shows you how to use it..
Reply
#9

Alright well I managed to make one myself, but I keep getting 2 errors. Decided to use IsPlayerInRangeOfPoint.

Код:
forward target1check();
Код:
SetTimer("target1check",3000,true);
Код:
public target1check()
{
	new target1_status;
	for(new i;i<MAX_PLAYERS;i++)
	{
	  if(!IsPlayerConnected(i)) continue;
	  if(IsPlayerInRangeOfPoint(i,10.0, 1553.8453,-1019.7006,23.9063))target1_status = 1;
	}
	if(target1_status)MoveObject(target1check, 1549.7900390625, -1006.2829589844, 24.124252319336, 2.00);
	else MoveObject(target1check, 1555.9527587891, -1013.5319824219, 24.828693389893, 2.00);
}
and I get these two errors,

Код:
C:\Users\Chrispy\Documents\SA-MP Server\gamemodes\practicescript.pwn(90) : error 076: syntax error in the expression, or invalid function call
C:\Users\Chrispy\Documents\SA-MP Server\gamemodes\practicescript.pwn(91) : error 076: syntax error in the expression, or invalid function call
Lines 90 & 91 are,
Код:
if(target1_status)MoveObject(target1check, 1549.7900390625, -1006.2829589844, 24.124252319336, 2.00);
else MoveObject(target1check, 1555.9527587891, -1013.5319824219, 24.828693389893, 2.00);
Reply


Forum Jump:


Users browsing this thread: 7 Guest(s)