How to attach 3D Text to cars
#1

Hi. I found this for attach 3D TEXT for cars..
Код HTML:
new car;
new Text3D:label;
car = CreateVehicle(vehicleid, x, y, z, a, -1, -1, -1);
label = Create3DTextLabel("Your Text Hare", 0x00FF00FF, x, y, z, 40, 0, 0);
Attach3DTextLabelToVehicle(label, car, 0.0, 0.0, 1.0);
Ok.. But i want to add a command /carname to attach name of the player to the car. Sorry for my bad english I hope you understand

Код HTML:
CMD:vipname(playerid, params[])
{
    if(PlayerInfo[playerid][pPremiumAccount] == 1)
    {   new name[MAX_PLAYER_NAME];
    	GetPlayerName(playerid, name, sizeof(name));
	new Text3D:text;
        new currentveh;
        currentveh = GetPlayerVehicleID(playerid);
        format(name, sizeof(name), "[VIP] %s", name);
        text = Create3DTextLabel( name, 0xFFFF00, 0.0, 0.0,0.0, 50.0, 0, 1 );
        Attach3DTextLabelToVehicle( text, currentveh, 0.0, 0.0, 2.0);// Attach3D
    }
    else SendClientMessage(playerid, COLOR_WHITE, "Nu ai cont premium!");
    return 1;
}
I try this but it doesn't work
Reply
#2

Increase name array's size.
pawn Код:
new name [MAX_PLAYER_NAME + 7];
Also, the text3D tagged variable must be a global array to be used for players in case if you're planning on removing or editing it.
Reply
#3

SOLVED ... I write wrong the position..
Reply
#4

How to delete the text when player exit veh?
Reply
#5

PHP код:
public OnPlayerStateChange(playeridnewstateoldstate)
{
   if(
oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT)
   {
      
Delete3DTextLabel(label);
   }
   return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)