Fence,Gate,Block Moveing
#1

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

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

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); 
}
Reply
#4

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

try using SetTimerEx
Reply
#6

Example?
Reply
#7

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

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

2 Errors

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)