at 2010 TeraN release the basic if movable 3d text lebels.
Today I improved the include and added some new functions, as seen at the video.
Код:
native CreateMoveable3DText(string[], speed, color, Float:distance, Float:x, Float:y, Float:z, virtualworld = -1, testLOS = 0);
native DeleteMoveable3DTextLabel(textid);
native AttachMoveable3DTextToVehicle(textid, vehid, Float:offsetx = 0.0, Float:offsety = 0.0, Float:offsetz = 0.0);
native AttachMoveable3DTextToPlayer(textid, playerid, Float:offsetx = 0.0, Float:offsety = 0.0, Float:offsetz = 0.0);
native UpdateMoveable3DTextLabelText(textid, string[], color, speed = 1);
Код:
if(!strcmp(cmd, "/Text", true)) {
new text[128];
if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, 0xFF0000FF, "/Text [text]");
new Float:Pos[3];
if(IsPlayerInAnyVehicle(playerid))
GetVehiclePos(GetPlayerVehicleID(playerid), Pos[0], Pos[1], Pos[2]);
else
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
return CreateMoveable3DText(text, 1, 0xFF0000FF, 20.0, Pos[0], Pos[1], Pos[2], 0, 0);
}
if(!strcmp(cmd, "/aText", true)) {
new text[128];
if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, 0xFF0000FF, "/aText [text]");
new txtid = CreateMoveable3DText(text, 1, 0xFF0000FF, 20.0, 0.0, 0.0, 0.0, 0, 0);
if(IsPlayerInAnyVehicle(playerid))
AttachMoveable3DTextToVehicle(txtid, GetPlayerVehicleID(playerid), 0.0, 0.0, 1.0);
else
AttachMoveable3DTextToPlayer(txtid, playerid, 0.0, 0.0, 0.0);
return SendClientFormat(playerid, 0xFF0000FF, str, "text: %s id: %d", text, txtid);
}
if(!strcmp(cmd, "/uText", true)) {
new txtid, text[128];
if(sscanf(params, "ds[128]", txtid, text)) return SendClientMessage(playerid, 0xFF0000FF, "/uText [ID] [text]");
UpdateMoveable3DTextLabelText(txtid, text, 0xFF0000FF);
return SendClientFormat(playerid, 0xFF0000FF, str, "text: %s id: %d", text, txtid);
}
if(!strcmp(cmd, "/dText", true)) {
new txtid;
if(sscanf(params, "d", txtid)) return SendClientMessage(playerid, 0xFF0000FF, "/dText [ID]");
DeleteMoveable3DTextLabel(txtid);
return SendClientFormat(playerid, 0xFF0000FF, str, "id: %d", txtid);
}
* The script is remaked. I'm not own any rights on the idea only on the script!