SetVehicleColor: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(added info about issue #9033)
No edit summary
Line 1: Line 1:
__NOTOC__
<font face="sans-serif">
{{Server client function}}
<div style="background:#333;">
This function will set the color of a vehicle. Colors are in RGB format, vehicles can have up to 4 colors. Most vehicles have 2 colors only.
<div style="height:4px;background:#AAA;"></div>
 
<font color="#FFF" size="5">
{{New feature|3.0110|1.1|
<p>&nbsp;Ваша версия Adobe Flash Player устарела</p>
==Syntax==
</font>
<syntaxhighlight lang="lua">
<div style="background:#FFF;">
bool setVehicleColor ( vehicle theVehicle, int r1, int g1, int b1, [int r2, int g2, int b2, int r3, int g3, int b3, int r4, int g4, int b4] )           
<font color="#F00" size="2">
</syntaxhighlight>  
<p>Требуется срочное обновление до текущей версии!</p>
 
</font>
{{OOP||[[vehicle]]:setColor}}
<font color="#000" size="4">
===Required Arguments===
<p>Adobe Flash Player 30.0.0.164 <font color="#888" size="2">(~18 kB)</font></p>
*'''theVehicle:''' The [[vehicle]] that you wish to set the color of.
</font>
*'''r1, g1, b1:''' Three integers indicating the red, green and blue components of the first (main) color for the vehicle
<font color="#444" size="2">
===Optional Arguments===
<p><b>Операционная система:</b> Windows<br><b>Язык:</b> Выбирает пользователь</p>
*'''r2, g2, b2:''' Three integers indicating the red, green and blue components of the second color for the vehicle
</font>
*'''r3, g3, b3:''' Three integers indicating the red, green and blue components of the third color for the vehicle
<font color="#000" size="4">
*'''r4, g4, b4:''' Three integers indicating the red, green and blue components of the fourth color for the vehicle
<p>Скачать обновление с Яндекс.Диска: yadi.sk/d/AfbiMAr1PkGdww</p>
}}
</font>
===Returns===
</div>
Returns ''true'' if vehicle's color was set, ''false'' if an invalid vehicle or invalid colors were specified.
</div>
 
</font>
==Example==
<section name="Example 1" class="server" show="true">
This example implements a serverside ''random_color'' console command.
<syntaxhighlight lang="lua">
addCommandHandler( 'random_color',
function( uPlayer )
if isPedInVehicle( uPlayer ) then
local uVehicle = getPedOccupiedVehicle( uPlayer )
if uVehicle then
local r, g, b = math.random( 255 ), math.random( 255 ), math.random( 255 )
setVehicleColor( uVehicle, r, g, b )
end
end
end
)
</syntaxhighlight>  
</section>
 
== Issues ==
{{Issues|
{{Issue|9033|Clientside setVehicleColor doesn't work directly after creation}}
}}
 
==See Also==
{{Vehicle_functions}}

Revision as of 06:01, 9 September 2018

 Ваша версия Adobe Flash Player устарела

Требуется срочное обновление до текущей версии!

Adobe Flash Player 30.0.0.164 (~18 kB)

Операционная система: Windows
Язык: Выбирает пользователь

Скачать обновление с Яндекс.Диска: yadi.sk/d/AfbiMAr1PkGdww