Rankup / Rankdown
#1

And Yes i searched the forum and found some thead but the cmd very buggy.

Код:
//----------------------------------[RANKUP]------------------------------------------------
if(strcmp(cmd, "/rankup", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /rankup [id]");
				return 1;
			}
			new para1;
			para1 = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			if(PlayerInfo[playerid][pLeader] >= 1)
			{
			  if(IsPlayerConnected(para1))
			  {
			    if(para1 != INVALID_PLAYER_ID)
			    {
						GetPlayerName(para1, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						PlayerInfo[para1][pRank] += 1;
						format(string, sizeof(string), "  You have been promoted to a higher Rank by Leader %s", sendername);
						SendClientMessage(para1, COLOR_LIGHTBLUE, string);
						format(string, sizeof(string), "  You have given %s Rank %d.", giveplayer);
						SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_RED, "[Error] You are not allowed to use that command.");
			}
		}
		return 1;
	}
when i promote someone it says promoted to rank 77...i want to fix that but duno how
and to add Restriction that you cant raknup yourself and a higher rank..
(rank 6 Boss,5 Underboss,they can do this)

Thank you,hope you can help me
thx
Reply
#2

up
help me plz
Reply
#3

up
Reply
#4

pawn Код:
para1 = ReturnUser(tmp)
if(PlayerInfo[para1][pRank] >= something) return 1; //exits the function
Reply
#5

part 2 of the problem solved and part 1:
when i promote someone it says promoted to rank 77.
how to make it just some number 1-7 depeneds on rank
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)