16.05.2013, 12:05
How to make /lockserver as a admin command?
Код:
CMD:lockserver(playerid, params[]) { 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); return 1; }