23.10.2015, 11:49
Hi!
I was making a promotion command for my RP script when I was wondering how I can make it so that it looks at their current rank in their faction and then promotes them to the one above it. This is my code for it:
THanks if you can help!
I was making a promotion command for my RP script when I was wondering how I can make it so that it looks at their current rank in their faction and then promotes them to the one above it. This is my code for it:
Код:
command(promote, playerid, params[]) { new target, string[128]; if(PlayerInfo[playerid][pRank] == 7) { if(sscanf(params,"ui", target)) return SendClientMessage(playerid, GREY, "SYNTAX:{FFFFFF} /promote [ID]"); { PlayerInfo[target][pRank] = 1; format(string, sizeof(string), "NOTE: You have promoted %s", RPName(target)); SendClientMessage(playerid, ADMINBLUE, string); format(string, sizeof(string), "NOTE: You have been promoted to rank %d ", RPName(playerid), PlayerInfo[playerid][pRank]); SendClientMessage(target, ADMINBLUE, string); } } else { RemoveTextMessage(playerid); TextDrawShowForPlayer(playerid, Text:CantCommand); SetTimerEx("CantCommand", 3500, false, "d", playerid); } return 1; }