29.03.2011, 21:55
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:
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!
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;
}
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!


