11.11.2013, 02:07
Como deixar esse comando na RCON somente logando nela pode usar, e sem nenhum ADM usar tambйm!
Код:
CMD:criarempresa(playerid, params[]) { new type, string[128]; if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Vocк precisa fazer o login antes de usar qualquer comando."); if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_GREY, "Vocк nгo estб autorizado a usar este comando."); if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "Vocк nгo estб no dever Admin."); if(sscanf(params, "i", type)) { SendClientMessage(playerid, COLOR_WHITE, "[Use]: /criarempresa [digite]"); SendClientMessage(playerid, COLOR_GREY, "TIPOS: 1) 24/7 | 2) Clothes Shop | 3) Ammunation | 4) Club | 5) Advertisement Agency | 6) Fast Food"); return 1; } if(type < 1 || type > 6) return SendClientMessage(playerid, COLOR_GREY, "As empresas estгo entre 1 e 5."); for(new idx=1; idx<MAX_BIZ; idx++) { if(!BizInfo[idx][bType]) { // Getting Business Setup new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, X, Y, Z); // Making Business BizInfo[idx][bType] = type; BizInfo[idx][bStatus] = 0; format(BizInfo[idx][bOwner], 32, "The State"); BizInfo[idx][bX] = X; BizInfo[idx][bY] = Y; BizInfo[idx][bZ] = Z; BizInfo[idx][bMoney] = 0; BizInfo[idx][bProducts] = 0; BizInfo[idx][bSold] = 0; BizInfo[idx][bLevel] = 1; BizInfo[idx][bPrice] = 200000; BizInfo[idx][bPickup] = CreateDynamicPickup(1272, 1, X, Y, Z, 0); format(string, sizeof(string), "Dono: %s\nEmpresa Tipo: %s\nStatus: Para venda\nPreзo: $%d", BizInfo[idx][bOwner], RBT(idx), BizInfo[idx][bPrice]); BizInfo[idx][bText] = CreateDynamic3DTextLabel(string, COLOR_WHITE, X, Y, Z, 15); format(string, sizeof(string), "AdmWarn: %s criou empresa ID %d.", RPN(playerid), idx); SendAdminMessage(COLOR_DARKRED, 1, string); Log("logs/business.log", string); idx = MAX_BIZ; } } return 1; }