SA-MP Forums Archive
How to attach 3D Text to cars - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to attach 3D Text to cars (/showthread.php?tid=625240)



How to attach 3D Text to cars - prototype0104 - 30.12.2016

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


Re: How to attach 3D Text to cars - Lordzy - 30.12.2016

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.


Re: How to attach 3D Text to cars - prototype0104 - 30.12.2016

SOLVED ... I write wrong the position..


Re: How to attach 3D Text to cars - prototype0104 - 30.12.2016

How to delete the text when player exit veh?


Re: How to attach 3D Text to cars - ChristolisTV - 30.12.2016

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