I want a gate that opens on a command and closes automaticly in 5 seconds -
OleKristian95 - 14.07.2011
Hi all, What I want is a gate that opens on a command and then closes automaticly in 5 seconds.
I've seen a server having it and I liked it very much so I wanted the same on mine.
I already got gates but I have to type a command every time I open a gate and it would be much easier if the gate just closed itself.
Re: I want a gate that opens on a command and closes automaticly in 5 seconds -
McCarthy - 14.07.2011
Instead of a /close command make a timer
Re: I want a gate that opens on a command and closes automaticly in 5 seconds -
[MG]Dimi - 14.07.2011
Quote:
Originally Posted by McCarthy
Instead of a /close command make a timer
|
Quote:
Originally Posted by OleKristian95
...command and then closes automaticly in 5 seconds.
|
Read before posting -.-
@OleKristian95 Well give us your code and we will edit it so it auto-closes after 5 sec.
Re: I want a gate that opens on a command and closes automaticly in 5 seconds -
OleKristian95 - 14.07.2011
Quote:
Originally Posted by McCarthy
Instead of a /close command make a timer
|
I think I knew that but I don't know how..
Quote:
Originally Posted by [MG]Dimi
Read before posting -.-
@OleKristian95 Well give us your code and we will edit it so it auto-closes after 5 sec.
|
This is the code:
if(strcmp(cmdtext, "/Aopen", true)==0)
{
SendClientMessage(playerid,0xFFFF00AA, "The front gate has opened. Welcome Admin!");
MoveObject(Gate1,2839.70996094, 3261.31054688, 34.70434570, 3.0);
return 1;
}
do you need anymore than that
Re: I want a gate that opens on a command and closes automaticly in 5 seconds -
Adil - 14.07.2011
pawn Код:
if(strcmp(cmdtext, "/Aopen", true)==0)
{
SendClientMessage(playerid,0xFFFF00AA, "The front gate has opened. Welcome Admin!");
MoveObject(Gate1,2839.70996094, 3261.31054688, 34.70434570, 3.0);
SetTimer("GateClose", 5000, 0);
return 1;
}
pawn Код:
public GateClose()
{
MoveObject(Gate1,X,Y,Z,3);//Change X Y Z to the position in Gate1 = Createobject()
}
Re: I want a gate that opens on a command and closes automaticly in 5 seconds -
OleKristian95 - 14.07.2011
Quote:
Originally Posted by Adil
pawn Код:
if(strcmp(cmdtext, "/Aopen", true)==0) { SendClientMessage(playerid,0xFFFF00AA, "The front gate has opened. Welcome Admin!"); MoveObject(Gate1,2839.70996094, 3261.31054688, 34.70434570, 3.0); SetTimer("GateClose", 5000, 0); return 1; }
pawn Код:
public GateClose() { MoveObject(Gate1,X,Y,Z,3);//Change X Y Z to the position in Gate1 = Createobject() }
|
Код:
C:\Users\*\Desktop\0.3b SATDM\filterscripts\AutoCloseGates.pwn(5) : error 001: expected token: "(", but found ";"
C:\Users\*\Desktop\0.3b SATDM\filterscripts\AutoCloseGates.pwn(9) : error 001: expected token: ")", but found "new"
C:\Users\*\Desktop\0.3b SATDM\filterscripts\AutoCloseGates.pwn(9) : error 001: expected token: ";", but found "new"
C:\Users\*\Desktop\0.3b SATDM\filterscripts\AutoCloseGates.pwn(41) : error 029: invalid expression, assumed zero
C:\Users\*Desktop\0.3b SATDM\filterscripts\AutoCloseGates.pwn(41) : error 004: function "GateClose" is not implemented
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
5 Errors.
Re: I want a gate that opens on a command and closes automaticly in 5 seconds -
Adil - 15.07.2011
Last post edited.