29.03.2017, 18:46
Hi guys, when I use comand like "/set" without id, item and ammount, the command set automat rank 1 in faction, how can I make the command to show text with "Syntax" and "Available Items" ?
Command:
Command:
Код:
CMD:set(playerid, params[]) { new id, item[25], ammount; if(PlayerInfo[playerid][pAdmin] < 4)return SCM(playerid, -1, AdminOnly); if(PinLogged[playerid] == 0)return SCM(playerid, COLOR_LIGHTRED, "Trebuie sa introduci pin-ul mai intai.(/pin)"); if(sscanf(params, "us[250]i", id, item, ammount)) { SCM(playerid, COLOR_GREY,"Syntaxl: /set <id> <item> <ammount> "); SCM(playerid, COLOR_GREY, "Available Items: Group, Rank, Money, BankMoney, PlayedHours, RespecPoints."); SCM(playerid, COLOR_GREY, "Available Items: PremiumPoints, PremiumAccount, Level, FP, TeamViewer, VIP, Skin."); } if(id == INVALID_PLAYER_ID)return SCM(playerid, COLOR_LIGHTRED, "ID sau nume incorect !"); if(strcmp(item, "Rank", true) == 0) { if(PlayerInfo[id][pMember] >= 1) { PlayerInfo[id][pRank] = ammount; new str[256]; mysql_format(SQL,str,sizeof(str),"UPDATE users SET `Rank`='%d' WHERE `name`='%s'",PlayerInfo[id][pRank],PlayerInfo[id][pNormalName]); mysql_tquery(SQL,str,"",""); new IDName[25], AdminName[25]; GetPlayerName(id, IDName, sizeof(IDName)); GetPlayerName(playerid, AdminName, sizeof(AdminName)); new text[128]; format(text, sizeof(text), "AdmWarning: %s i-a setat lui %s rank-ul in factiune la rank %d.", AdminName, IDName, ammount); ABroadCast(COLOR_ORANGE, text, 4); SCM(id, -1, "Your rank in this faction has been changed."); } }