14.07.2013, 12:10
Hey all.
I am using PPC Trucking Script.I wanted to edit the speedometer textdraw but for some reason it doesnt work properly after editing.I wanted to add a box(TextDrawUseBox) and then the problems appear.When I'm outside of a vehicle,it should not appear but for some reason it appears as 2 stripes.2 because the SpeedometerText and FuelGauge use separate boxes.Here is a video I made,and below I have pasted the code of the speedometer the way I edited it.Note that its only the part of the PPC_Speedometer.inc that contains the speedo setup
[ame]http://www.youtube.com/watch?v=Sx4v4PA1xVo[/ame]
Also please advice me how to make the code look like in PAWNO.Thx in advance.Just to make sure,I have pastebin-ed it too http://pastebin.com/Sxnt11th
I am using PPC Trucking Script.I wanted to edit the speedometer textdraw but for some reason it doesnt work properly after editing.I wanted to add a box(TextDrawUseBox) and then the problems appear.When I'm outside of a vehicle,it should not appear but for some reason it appears as 2 stripes.2 because the SpeedometerText and FuelGauge use separate boxes.Here is a video I made,and below I have pasted the code of the speedometer the way I edited it.Note that its only the part of the PPC_Speedometer.inc that contains the speedo setup
[ame]http://www.youtube.com/watch?v=Sx4v4PA1xVo[/ame]
Код:
// This function sets up the speedometer for the given player Speedometer_Setup(playerid) { // Setup the speedometer for the player APlayerData[playerid][SpeedometerText] = TextDrawCreate(500.0, 395.0, " "); TextDrawBackgroundColor(APlayerData[playerid][SpeedometerText], 255); TextDrawFont(APlayerData[playerid][SpeedometerText], 2); TextDrawLetterSize(APlayerData[playerid][SpeedometerText], 0.350000, 1.500000); TextDrawColor(APlayerData[playerid][SpeedometerText], -1); TextDrawSetShadow(APlayerData[playerid][SpeedometerText], 0); TextDrawUseBox(APlayerData[playerid][SpeedometerText], 1); TextDrawBoxColor(APlayerData[playerid][SpeedometerText], 0x00000066); TextDrawTextSize(APlayerData[playerid][SpeedometerText], 640.000000, 0.000000); APlayerData[playerid][FuelGauge] = TextDrawCreate(500.0, 412.0, " "); TextDrawBackgroundColor(APlayerData[playerid][FuelGauge], 255); TextDrawFont(APlayerData[playerid][FuelGauge], 2); TextDrawLetterSize(APlayerData[playerid][FuelGauge], 0.350000, 1.500000); TextDrawColor(APlayerData[playerid][FuelGauge], -1); TextDrawSetShadow(APlayerData[playerid][FuelGauge], 0); TextDrawUseBox(APlayerData[playerid][FuelGauge], 1); TextDrawBoxColor(APlayerData[playerid][FuelGauge], 0x00000066); TextDrawTextSize(APlayerData[playerid][FuelGauge], 640.000000, 0.000000); // Enable the TextDraw for this player TextDrawShowForPlayer(playerid, APlayerData[playerid][SpeedometerText]); TextDrawShowForPlayer(playerid, APlayerData[playerid][FuelGauge]); // Start the speedometer timer APlayerData[playerid][SpeedometerTimer] = SetTimerEx("Speedometer_Update", 100, true, "i", playerid); return 1; } // This function cleans up the speedometer for the given player Speedometer_Cleanup(playerid) { // Destroy the speedometer textdraw TextDrawDestroy(APlayerData[playerid][SpeedometerText]); TextDrawDestroy(APlayerData[playerid][FuelGauge]); // Kill the speedometer timer KillTimer(APlayerData[playerid][SpeedometerTimer]); // Set player speed to 0 APlayerData[playerid][PlayerSpeed] = 0; return 1; }