[UNSOLVED] Police Badge
#3

Quote:
Originally Posted by Torran
I dont xd, Maybe explain a little better
I think I fixed that problem with the distance:

Code:
if(strcmp(cmd, "/showbadge", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
	  	tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GREY, "	USAGE: /showbadge [playerid]");
				return 1;
			}
			new para1;
			new laerank = PlayerInfo[playerid][pLAERank];
			para1 = ReturnUser(tmp);
			giveplayerid = ReturnUser(tmp);
			if (PlayerInfo[playerid][pLAERank] >= 1)
			{
				if(IsPlayerConnected(para1))
				{
					if(giveplayerid != INVALID_PLAYER_ID)
	  			{
		  			if (GetDistanceBetweenPlayers(playerid,giveplayerid) > 5)
						{
		  				SendClientMessage(playerid, COLOR_GREY, "	You are too far away from the player.");
		  				return 1;
						}
				  	GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						new length = strlen(cmdtext);
						while ((idx < length) && (cmdtext[idx] <= ' '))
						if(!strlen(tmp))
						{
								SendClientMessage(playerid, COLOR_GREY, "	USAGE: /showbadge [playerid]");
								return 1;
						}
						format(string, sizeof(string), "%d %s BlahBlah...", laerank, sendername);
						SendClientMessage(para1, COLOR_BLUE, string);
						format(string, sizeof(string), "You have shown %s your badge.", giveplayer);
						SendClientMessage(playerid, COLOR_BLUE, string);
						return 1;
					}
				}
			}
		}
		return 1;
	}
Anyway, the real question now is, is it possible to create a rank name like, Rank ID 1 = Police Officer (PlayerInfo[playerid][pLAERank]) so it can be shown when you show the badge to a player?

For example, you got Rank 1, and it displays as "Police Officer" at the %d.
Reply


Messages In This Thread
[UNSOLVED] Police Badge - by FreddeN - 23.02.2010, 16:40
Re: [UNSOLVED] Police Badge - by Torran - 23.02.2010, 16:59
Re: [UNSOLVED] Police Badge - by FreddeN - 23.02.2010, 17:10
Re: [UNSOLVED] Police Badge - by Souvlaki - 23.02.2010, 17:30
Re: [UNSOLVED] Police Badge - by Klutty - 23.02.2010, 17:43
Re: [UNSOLVED] Police Badge - by FreddeN - 23.02.2010, 19:26
Re: [SOLVED] Police Badge - by FreddeN - 23.02.2010, 19:41

Forum Jump:


Users browsing this thread: 1 Guest(s)