23.01.2015, 13:10
You need sscanf and zcmd to run and use this.
pawn Код:
new gLockTimer;
CMD:lockserver(playerid, params[])
{
new password[20], seconds, str[60];
if(sscanf(params, "s[20]i", password, seconds)) return SendClientMessage(playerid, -1, "Usage: /lockserver [password] [seconds]");
format(str, 60, "You have successfully locked the server with the password %s!", password);
SendClientMessage(playerid, -1, str);
format(str, 30, "password %s", password);
SendRconCommand(str);
KillTimer(gLockTimer), gLockTimer = SetTimer("UnlockServer", seconds*1000, 0);
return 1;
}
forward UnlockServer();
public UnlockServer()
{
SendRconCommand("password 0");
KillTimer(gLockTimer);
return 1;
}