Ned help with multiple things.
#5

Код:
if(strcmp(cmd, "/setrank", true) == 0)
	{
		if(IsPlayerConnected(playerid))
		{
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "[Command] /setrank [playerid/PartOfName] [Number(1-6)]");
				return 1;
			}
			new para1;
			new level;
			para1 = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			level = strval(tmp);
                        if(level > 6 || level < 0) { SendClientMessage(playerid, COLOR_GREY, "Rank Min = 0 & Rank Max = 6"); return 1; }
			if (Player[playerid][IsLeader] == 1 && Player[playerid][Faction] == Player[para1][Faction])
			{
				if(IsPlayerConnected(para1))
				{
					if(para1 != INVALID_PLAYER_ID)
					{
						GetPlayerName(para1, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						Player[para1][Rank] = level;
						// Here you have to save your player (OnPlayerUpdate or whatever you use to do it.
					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, " You are not Leader !");
			}
		}
		return 1;
	}
That's an exemple. Of course, I wrote Player[para1][Faction] but I don't know if you use that in your GM
Same thing for Player[para1][Rank].
Reply


Messages In This Thread
Ned help with multiple things. - by mkmk - 31.10.2014, 13:30
Re: Ned help with multiple things. - by JasperM - 31.10.2014, 13:37
Re: Ned help with multiple things. - by DanishHaq - 31.10.2014, 13:39
Re: Ned help with multiple things. - by mkmk - 31.10.2014, 13:42
Re : Ned help with multiple things. - by ououdu94 - 31.10.2014, 14:04

Forum Jump:


Users browsing this thread: 1 Guest(s)