Car owner name on car. - 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: Car owner name on car. (
/showthread.php?tid=616483)
Car owner name on car. - iLearner - 05.09.2016
Hello,
I have a veh system where players can buy a veh from dealer, and use it. it has some commands like /myveh /lock.....etc
when its locked and another player enter's it server kicks him outta car saying its owned by... name
saving stuff is in sqlite.
now what i wanted to do is, on gamemodeinit attach all cars their owner name on car's head, like Owner\n name here.
anyone? sqlite?
Re: Car owner name on car. - iLearner - 05.09.2016
anyone?
Re: Car owner name on car. - iLearner - 06.09.2016
Can anyone explain how this can be done?
#bump
Re: Car owner name on car. -
Josh_Main - 06.09.2016
Hey iLearner
You can use:
https://sampwiki.blast.hk/wiki/Attach3DTextLabelToVehicle
But first you need to create the text label using:
https://sampwiki.blast.hk/wiki/Create3DTextLabel
example;
pawn Код:
new Text3D:vehicle3Dtext[MAX_VEHICLES],vehicle_id;
// Creating the TextLabel for later use
public OnGameModeInit()
{
Create3DTextLabel("I'm at the coordinates:\n30.0, 40.0, 50.0", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0, 0);
vehicle_id = CreateVehicle( 510, 0.0. 0.0, 15.0, 5, 0, 120 );
vehicle3Dtext[ vehicle_id ] = Create3DTextLabel( "Example Text", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1 );
//Creating the Vehicle
//Attaching Text Label To Vehicle
Attach3DTextLabelToVehicle( vehicle3Dtext[ vehicle_id ] , vehicle_id, 0.0, 0.0, 2.0);
return 1;
}
Remember to remove the text label when the gamemode exits
pawn Код:
public OnGameModeExit ( )
{
Delete3DTextLabel( vehicle3Dtext[ vehicle_id ] );
return true;
}