Command Lock
#1

Is there a command that locks the server? Or how do i code one? I want it so i say /lock as a rcon admin and the server locks until restarted.
Reply
#2

pawn Код:
public OnPlayerConnect(playerid)
{
    if(serverstat==0)
    {
        Kick(playerid);
    }
    return 1;
}


public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/lockserver", cmdtext, true, 10) == 0)
    {
        if(serverstat==1)
        {
            SendClientMessage(playerid, 0xFF0000, "Server Un-Locked...");
            serverstat=0;
        }else{
            SendClientMessage(playerid, 0xFF0000, "Server Locked...");
            serverstat=1;
        }
        return 1;
    }
    return 0;
}
Not the best way but was a quick method, You can modify, improve it. etc.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)