16.05.2013, 12:08
Код:
CMD:lockserver(playerid, params[]) { if(IsPlayerAdmin ( playerid ) ) { SendAdminText(playerid, "/lockserver", params); if (APlayerData[playerid][PlayerLevel] >= 7) if(isnull(params)) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: /lockserver [password]"); if(strlen(params) < 5 || strlen(params) > 30) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: The password must be between 5 and 30 characters."); new szString[128] ; new str[64]; format(szString, sizeof(szString), "You have set the server password to: %s", params); SendClientMessage(playerid, 0xFF0000AA, szString); new strPName[24]; format(szString, sizeof(szString), "password %s", params); GetPlayerName(playerid, strPName, sizeof(strPName)); format(str, sizeof(str), "Admin %s has locked the server", strPName); SendClientMessageToAll(0xFFFF00AA, str); SendRconCommand(szString); } else return SendClientMessage ( playerid , -1, "You must be rcon admin to use this command" ) ; return 1; }