10.12.2010, 05:04
Hi,is it possible to make a gate with password example /open 1234 and it automatically close?
if(!strcmp(cmdtext, "/open", true,5))
{
if(!strcmp(cmdtext[5], "password"))
{
//Move gate
}
else return SendClientMessage(playerid, RED, "Usage: /open [PASSWORD]");
}
if(!strcmp(cmdtext, "/close", true,5))
{
if(!strcmp(cmdtext[5], "password"))
{
//Move gate to close
}
else return SendClientMessage(playerid, YOUR_COLOR, "Usage: /close [PASSWORD]");
}
if(!strcmp(cmdtext, "/open", true,5))
{
if(!strcmp(cmdtext[5], "password"))
{
//Move gate
SetTimerEx("CloseMyGate", 10000, 0); // This will cale the 'CloseMyGate' after 10 seconds.
}
else return SendClientMessage(playerid, RED, "Usage: /open [PASSWORD]");
}
forward CloseMyGate();
public CloseMyGate()
{
//Move gate back ...
return 1;
}