zcmd is nearly the same as dcmd, but easier.
The only difference for script is that with dcmd you need to add a line under OnPlayerCommandText in order to use dcmd_xxx while with zcmd you do only zcmd(xxx,playerid,params[]) anywhere you want. But there is a big difference in core since zcmd doesn't go though all the commands and search until it finds the right one, but it simply calls it directly.
However about your code. I recommend you to start using sscanf because it's a lot easier. However you will need sscanf function which you can get here:
https://sampwiki.blast.hk/wiki/Sscanf
Btw, when using zcmd you can easily use isnull(params) instead of !strlen(params) or !params[0].
Your command would look like this:
pawn Код:
zcmd(play3d,playerid,params[])
{
new targetid;
if(sscanf(params,"u",targetid)) SendClientMessage(playerid, WHITE, "/play3d (id)");
else if(targetid == INVALID_PLAYER_ID) SendClientMessage(playerid, BIALY, "Player not connected");
else
{
textid = Create3DTextLabel("123",0xFFFFFFFF,0.0,0.0,0.0,40.0,0);
Attach3DTextLabelToPlayer(textid, targetid, 0.0, 0.0, -0.4);
}
return 1;
}