zcmd(play3d,playerid,params[]) { new tmp[128]; new idx; tmp = strtok(params, idx); if(!params[0]) { return SendClientMessage(playerid, WHITE, "/play3d (id)"); } textid = Create3DTextLabel("123",0xFFFFFFFF,0.0,0.0,0.0,40.0,0); Attach3DTextLabelToPlayer(textid, strval(tmp), 0.0, 0.0, -0.4); return 1; }
dcmd_play3d(playerid,params[])
{
if(!strlen(params)) return SendClientMessage(playerid, BIALY, "/play3d (id)");
if(!IsPlayerConnected(strval(params))) return SendClientMessage(playerid, BIALY, "Player not connected");
textid = Create3DTextLabel("123",0xFFFFFFFF,0.0,0.0,0.0,40.0,0);
Attach3DTextLabelToPlayer(textid, strval(params), 0.0, 0.0, -0.4);
return 1;
}
Originally Posted by Mikep.
I would use dcmd, as zcmd doesn't really have any documentation.
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;
}
Originally Posted by Y_Leѕѕ
Quote:
Secondly, please don't encourage people to use older methods, it's the same as when dcmd first came out and people told other people to use strtok/strcmp instead as it was easier (a claim I have never believed). zcmd is fsater and simpler than dcmd - dcmd served its purpose well for a long time, but has been surpassed. Thirdly, I was thinking about updating the fast commands wiki page to cover zcmd instead of dcmd, but I'm working on a little something first that will also need to go on there. |
I try to listen to the advice of ******. He is an authority on programming |
Originally Posted by Y_Leѕѕ
And no, I'm working on a new version of sscanf which should be far more powerful and much faster.
|
Originally Posted by Y_Leѕѕ
Of course you can, it works on any strings at all - you cuold use it for reading files if you wanted, or anything else.
|
Originally Posted by Y_Leѕѕ
Quote:
Secondly, please don't encourage people to use older methods, it's the same as when dcmd first came out and people told other people to use strtok/strcmp instead as it was easier (a claim I have never believed). zcmd is fsater and simpler than dcmd - dcmd served its purpose well for a long time, but has been surpassed. Thirdly, I was thinking about updating the fast commands wiki page to cover zcmd instead of dcmd, but I'm working on a little something first that will also need to go on there. |