SA-MP Forums Archive
Rankup / Rankdown - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Rankup / Rankdown (/showthread.php?tid=109765)



Rankup / Rankdown - Naruto4 - 22.11.2009

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



Re: Rankup / Rankdown - Naruto4 - 22.11.2009

up
help me plz


Re: Rankup / Rankdown - Naruto4 - 22.11.2009

up


Re: Rankup / Rankdown - dice7 - 22.11.2009

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



Re: Rankup / Rankdown - Naruto4 - 22.11.2009

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