Can someone make this stronger?
#1

Hello,

I'm still learning DCMD a bit, and I want to know how to make dcmd command stronger.
With stronger I mean, that you can type a playerid, something like 102 or something.
In this command:

Код:
dcmd_cplayerlabel(playerid, params[])
{
	if(PlayerInfo[playerid][pAdminLevel] >= 3)
	{
 		if(params[0] == 0 || params[1] == 0)
	    {
	        SendClientMessage(playerid, COLOR_WHITE, "USAGE: /cplayerlabel [playerid] [text] | Attaches a label to a player");
	        return 1;
		}
		new otherplayer = strval(params[0]);
		new str1[256];

		format(str1, sizeof(str1), "There's a label attached to you by an admin. Label: %s", params[1]);

		if(otherplayer == INVALID_PLAYER_ID)
		{
		    SendClientMessage(playerid, COLOR_GREY, "  Bad playerid.");
			return 1;
		}

		PlayerLabel[otherplayer] = Create3DTextLabel(params[1], COLOR_YELLOW, 30.0, 40.0, 50.0, 40.0, 0);
		Attach3DTextLabelToPlayer(PlayerLabel[otherplayer], otherplayer, 0.0, 0.0, 0.7);
		SendClientMessage(otherplayer, COLOR_NICEBLUE, str1);
		SendClientMessage(playerid, COLOR_NICEBLUE, "You attached a label to a player, it will disappear when he / she dies or disconnects.");
	}
	return 1;
}
If I type a invalid playerid, it doesn't say Bad playerid but says that I have attached a
label to it. And if I do (im playerid 0) /cplayerlabel 00 blabla, it says Theres a blabla atachd. Label: 0 blabla,
why the 0 there?

Can someone retype this command but then stronger so I can learn it?

Thank you!
Reply


Messages In This Thread
Can someone make this stronger? - by Ihsan-Cingisiz - 29.03.2011, 21:55
Re: Can someone make this stronger? - by Jefff - 29.03.2011, 22:08
AW: Can someone make this stronger? - by Nero_3D - 29.03.2011, 22:10
Respuesta: Can someone make this stronger? - by kirk - 29.03.2011, 22:14
Re: AW: Can someone make this stronger? - by Ihsan-Cingisiz - 30.03.2011, 06:22
Re: Can someone make this stronger? - by Mike Garber - 30.03.2011, 06:56
Re: AW: Can someone make this stronger? - by Calgon - 30.03.2011, 08:24

Forum Jump:


Users browsing this thread: 1 Guest(s)