open.mp | TextDrawSetPreviewVehCol
  • Home
  • FAQ
  • Forum
  • Servers
  • Docs
  • Blog
  • Login
  • Englishاللغة العربيةar-TNবাংলাbosanski jezikDeutschΕλληνικάEspañoleestiفارسیFrançaisHrvatskimagyarBahasa IndonesiaItaliano日本語ქართულიlietuvių kalbaNederlandsNorskjęzyk polskiPortuguêsRomânăРусскийslovenski jezikсрпски језикไทยWikang TagalogTürkçeУкраїнськаاردوTiếng Việt简体中文繁體中文
warning Not Translated

This page has not been translated into the language that your browser requested. The English content is being shown as a fallback.

If you want to contribute a translation for this page then please click here.

TextDrawSetPreviewVehCol

warning

This function was added in SA-MP 0.3x and will not work in earlier versions!

Description

If a vehicle model is used in a 3D preview textdraw, this sets the two colour values for that vehicle.

NameDescription
textThe textdraw id that is set to display a 3D vehicle model preview.
color1The primary Color ID to set the vehicle to.
color2The secondary Color ID to set the vehicle to.

Returns

This function does not return any specific values.

Examples

new Text: gMyTextdraw;

public OnGameModeInit()
{
    gMyTextdraw = TextDrawCreate(320.0, 240.0, "_");
    TextDrawFont(gMyTextdraw, TEXT_DRAW_FONT_MODEL_PREVIEW);
    TextDrawUseBox(gMyTextdraw, 1);
    TextDrawBoxColor(gMyTextdraw, 0x000000FF);
    TextDrawTextSize(gMyTextdraw, 40.0, 40.0);
    TextDrawSetPreviewModel(gMyTextdraw, 411); // Display model 411 (Infernus)
    TextDrawSetPreviewVehCol(gMyTextdraw, 6, 6); // Set the Infernus to have colour 6 (Yellow)

    // You still have to use TextDrawShowForAll/TextDrawShowForPlayer to make the textdraw visible.
    return 1;
}

Notes

warning

The textdraw MUST use the font type TEXT_DRAW_FONT_MODEL_PREVIEW in order for this function to have effect.

Related Functions

  • TextDrawSetPreviewModel: Set the 3D preview model of a textdraw.
  • TextDrawSetPreviewRot: Set rotation of a 3D textdraw preview.
  • TextDrawFont: Set the font of a textdraw.
  • OnPlayerClickTextDraw: Called when a player clicks on a textdraw.

Community

  • Discord
  • Instagram
  • Twitter
  • Twitch
  • YouTube
  • Facebook
  • VK

More

  • SA-MP
  • Blog
  • GitHub