I want a gate that opens on a command and closes automaticly in 5 seconds
#1

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

Instead of a /close command make a timer
Reply
#3

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

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
Reply
#5

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 Код:
forward GateClose();
pawn Код:
public GateClose()
{
    MoveObject(Gate1,X,Y,Z,3);//Change X Y Z to the position in Gate1 = Createobject()
}
Reply
#6

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 Код:
forward GateClose;
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.
Reply
#7

Last post edited.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)