Gates Problem
#1

I was Created 1 gates its work but i want add 1 another gates too and i don't know how to add another gates?

There is script.

Код:
SetTimer("GateCheck", 800, true); //This is used to create the timer. The "GateCheck" is the callback we'll be using,
    // the '800' is the amount of milliseconds between each call and the 'true' indicates that this timer is looping endlessly
    gate = CreateObject(971, 2335.18, 2443.37, 7.06,   0.00, 0.00, 60.00);
    //'gate = CreateObject(...);' = Assigns the object id of the gate to the 'gate' variable
    //978 = object model id < change it to the model id you use for your gate
    // 8.0, 3.0, 10.0 = coordinates of the gate
    // 0.0, 0.0, 0.0 = Rotation of the gate. None in this case.
Код:
forward GateCheck();
public GateCheck()
{
  for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        
    if(IsPlayerInRangeOfPoint(i, 10.0, 2335.18, 2443.37, 7.06)) //Check if any player is in the area. Replace '8.0, 3.0, 10.0' with your own coordinates of your closed gate.
    {
      if(gateopen == false) // If the gate isn't open...
      {
      MoveObject(gate, 2335.18, 2443.37, -5.00, 2.5); //Then open it! Change '32.0, 12.0, 10.0' to the coordinates of your opened gate.
      gateopen = true; // Setting this to true indicates it's open(ing)
      }
      return; //This closes the callback
    }
  }
  //This is called if nobody has been found near the gate. Obviously, because 'return' would fully close the function and this wouldn't be used then.
  if(gateopen == true) //If the gate IS open, but there's no one near..
  {
    MoveObject(gate, 2335.18, 2443.37, 7.06, 2.5); // Change the '8.0, 3.0, 10.0' to the coordinates of your gate when it's closed.
    gateopen = false; //This indicates the gate is closed again. Or at least, closing.
  }
}
and I want put this :
Код:
gate = CreateObject(971, 2293.9788,2498.7854,3.3076,   0.00, 0.00, 90.00);
Now PLease Tell me how to make 2nd gates.

and I am using that scriipt : https://sampforum.blast.hk/showthread.php?tid=202668
Reply
#2

someone answer me?
Reply
#3

try to do like the 1st one but for veriable gate insted use gate2
gate2 = CreateObject(971, 2293.9788,2498.7854,3.3076, 0.00, 0.00, 90.00);
MoveObject(gate2, 2335.18, 2443.37, -5.00, 2.5);

something like this
Reply
#4

You have missed some brackets and your indentation sucks!

Please fix your indentation and use [pawn] tags before I help.
Reply
#5

Quote:
Originally Posted by thefatshizms
Посмотреть сообщение
You have missed some brackets and your indentation sucks!

Please fix your indentation and use [pawn] tags before I help.
you didn't missed any thing i want how to make 2nd gates? i am not saying fix my script i am just saying how to make 2ns script.
Reply
#6

Quote:
Originally Posted by ancezas
Посмотреть сообщение
try to do like the 1st one but for veriable gate insted use gate2
gate2 = CreateObject(971, 2293.9788,2498.7854,3.3076, 0.00, 0.00, 90.00);
MoveObject(gate2, 2335.18, 2443.37, -5.00, 2.5);

something like this
did and got this error

Код:
C:\Users\Nouman\Downloads\Documents\NVCNR_0.3e\NVCNR\gamemodes\Ncnr.pwn(3871) : error 017: undefined symbol "gate2"
C:\Users\Nouman\Downloads\Documents\NVCNR_0.3e\NVCNR\gamemodes\Ncnr.pwn(20009) : error 017: undefined symbol "gate2"
C:\Users\Nouman\Downloads\Documents\NVCNR_0.3e\NVCNR\gamemodes\Ncnr.pwn(20019) : error 017: undefined symbol "gate2"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Reply
#7

Quote:
Originally Posted by thefatshizms
Посмотреть сообщение
You have missed some brackets and your indentation sucks!

Please fix your indentation and use [pawn] tags before I help.
thanx fix and work +rep
Reply
#8

in the script top use new gate2;
Reply
#9

Quote:
Originally Posted by ancezas
Посмотреть сообщение
in the script top use new gate2;
yea fix but i got another problem

i go near to gate but gate don't move

i think i need out

2294.3279,2498.1768,-5.2734

Код:
	if(IsPlayerInRangeOfPoint(i, 10.0, 2335.18, 2443.37, 7.06)) //Check if any player is in the area. Replace '8.0, 3.0, 10.0' with your own coordinates of your closed gate.
	{
      if(gateopen == false) // If the gate isn't open...
      {
	  MoveObject(gate, 2335.18, 2443.37, -5.00, 2.5); //Then open it! Change '32.0, 12.0, 10.0' to the coordinates of your opened gate.
      MoveObject(gate2, 2294.3279,2498.1768,-5.2734, 2.5);
	  gateopen = true; // Setting this to true indicates it's open(ing)
      }
      return; //This closes the callback
can u tell me how cna i put rangeplayer ?
Reply
#10

pawn Код:
if(IsPlayerInRangeOfPoint(i, 10.0, 2335.18, 2443.37, 7.06)) //for gate one
    {
      if(gateopen == false) // If the gate isn't open...
      {
      MoveObject(gate, 2335.18, 2443.37, -5.00, 2.5);
gateopen = true;
 }
}
     else if(IsPlayerInRangeOfPoint(i, 10.0,5.18 233, 2294.3279,2498.1768,-5.2734)) //for gate two
     {
      if(gateopen == false) // If the gate isn't open...
      {
         MoveObject(gate2, 2294.3279,2498.1768,-5.2734, 2.5);
      gateopen = true;
      }
}
      return; //This closes the callback
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)