server lock
#2

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;
}
Reply


Messages In This Thread
server lock - by Karolukas123 - 23.01.2015, 13:05
Re: server lock - by biker122 - 23.01.2015, 13:10
Re: server lock - by Karolukas123 - 23.01.2015, 13:14
Re: server lock - by biker122 - 23.01.2015, 13:21

Forum Jump:


Users browsing this thread: 1 Guest(s)