[UNSOLVED] Police Badge
#1

Hello again, I'm trying to create a /showbadge command but I got some small confusions, this is how it looks like so far:

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;
			para1 = ReturnUser(tmp);
			giveplayerid = ReturnUser(tmp);
			if (PlayerInfo[playerid][pLAERank] >= 1)
			{
				if(IsPlayerConnected(para1))
				{
				  if(giveplayerid != INVALID_PLAYER_ID)
				  {
					  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), "Police Officer %s BlahBlah...", 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;
	}
I think it misses something that keeps the player distance?

I hope you know what I mean, thanks
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)