10.02.2018, 21:30
Does anyone know how do I lock a server using a command (not through RCON!)
/lock [passhere]
(with explanation please)
/lock [passhere]
(with explanation please)
new serverpass[25];
strmid(serverpass, inputtext, 0, strlen(inputtext), 999);
format(string,sizeof(string),"password %s",serverpass);
SendRconCommand(string);
CMD:lock(playerid, params[]) { if(connected[playerid] == true) return GameTextForPlayer(playerid, "~r~Spawn First", 5000, 5); if(pInfo[playerid][Admin] < 1) return SendClientMessage(playerid, -1, "{C3C3C3}(INFO) You don't have the priviliges to use this command."); { new str[128]; if(sscanf(params, "s[128]", str)) return SendClientMessage(playerid, -1, "{c3c3c3}(INFO) /lock [password]"); format(str, sizeof(str), "{c3c3c3}(INFO) Password: %s", params); SendRconCommand("password text"); format(str, sizeof(str), "{9d64d0}(INFO) An admin has locked the server! (PASSWORD: %s)", params); SendMessageToAdmins(str); } return 1; }
new pass[64];
format(pass,sizeof(pass),"password %s",params);
SendRconCommand(pass);
CMD:lock(playerid, params[])
{
if(connected[playerid] == true) return GameTextForPlayer(playerid, "~r~Spawn First", 5000, 5);
if(pInfo[playerid][Admin] < 1) return SendClientMessage(playerid, -1, "{C3C3C3}(INFO) You don't have the priviliges to use this command.");
{
new str[128];
if(sscanf(params, "s[128]", str)) return SendClientMessage(playerid, -1, "{c3c3c3}(INFO) /lock [password]");
format(str, sizeof(str), "{c3c3c3}(INFO) Password: %s", params);
new pass[64];
format(pass,sizeof(pass),"password %s",params);
SendRconCommand(pass);
format(str, sizeof(str), "{9d64d0}(INFO) An admin has locked the server! (PASSWORD: %s)", params);
SendMessageToAdmins(str);
}
return 1;
}
use this code
PHP код:
PHP код:
|