SA-MP Forums Archive
Fence,Gate,Block Moveing - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Fence,Gate,Block Moveing (/showthread.php?tid=125182)



Fence,Gate,Block Moveing - hardstop - 02.02.2010

I have a zombie server and i want to open Traders Gate,Fence In random time when playing, without command


Re: Fence,Gate,Block Moveing - Correlli - 02.02.2010

https://sampwiki.blast.hk/wiki/SetTimer / https://sampwiki.blast.hk/wiki/SetTimerEx
https://sampwiki.blast.hk/wiki/MoveObject / https://sampwiki.blast.hk/wiki/MovePlayerObject


Re: Fence,Gate,Block Moveing - hardstop - 02.02.2010

Wierd i cant really understand can you give me some examples?

Like this ? Tryed to do something

Код:




forward Traders();
 
public OnGameModeInit( )
{
  print("Starting timer...");
  SetTimer("Traders",1000,false);
}
 
public Traders()
{
  print("Traders doors are now open");
  MoveObject(Trader1,1644.6403,-1717.2532,32.8169,1.5000); 
}



Re: Fence,Gate,Block Moveing - hardstop - 02.02.2010

I have a problem When i start the server it Automatically Opens the gate :S


Re: Fence,Gate,Block Moveing - Hrvo182 - 02.02.2010

try using SetTimerEx


Re: Fence,Gate,Block Moveing - hardstop - 02.02.2010

Example?


Re: Fence,Gate,Block Moveing - Rzzr - 02.02.2010

If you want them to randomly open and close, you have to:
1) Put the timer on true
2) Make a check if the gates are open (use something like new GateOpen;
3) Put gateopen on 0 under ongamemodeinit
4) and check if(GateOpen == 1) --> You close it and if(GateOpen == 1) --> You open it.

Hope I helped!


Re: Fence,Gate,Block Moveing - shady91 - 02.02.2010

pawn Код:
forward Traders();
 
public OnGameModeInit( )
{
  print("Starting timer...");
  SetTimer("Traders",180000,true);
}
 
public Traders()
{
  print("Traders doors are now open");
  MoveObject(Trader1,1644.6403,-1717.2532,32.8169,1.5000);
  SetTimer("close",10000,false);
}

forward close();
public close()
{
  print("Traders doors are now closed");
  MoveObject(Trader1,/*the position of the object closed here */);
}

that's every 3 minutes's it will open after it open in 10 seconds it will close again then the timer when hits 3 mins again will open it then auto 10 seconds later close it and it will do so till you stop your mode.


Re: Fence,Gate,Block Moveing - hardstop - 02.02.2010

2 Errors

Код:
 error 029: invalid expression, assumed zero
Код:
error 035: argument type mismatch (argument 5)



Re: Fence,Gate,Block Moveing - shady91 - 02.02.2010

Quote:
Originally Posted by hardstop
2 Errors

Код:
 error 029: invalid expression, assumed zero
Код:
error 035: argument type mismatch (argument 5)
did you put the co ords of were the gate should go back ?


Re: Fence,Gate,Block Moveing - hardstop - 02.02.2010

Nah got it working i accidentaly put the forward close(); up where defines are