SA-MP Forums Archive
TextDrawSetPreviewModel not working - 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: TextDrawSetPreviewModel not working (/showthread.php?tid=561068)



TextDrawSetPreviewModel not working - gilhrpenner - 01.02.2015

Hi there, I'm having some troubles with TextDrawSetPreviewModel.
I'm making a inventory system and I would like to display the gun's image but it's not showing up, since this is my first time programming since the update I'm quite lost.

I have 3 slots for the inventory, the first one I'm displaying a drugs pack, the second one is the gun, which is not showing up, the 3 slot I just put a random ID just to show the question mark.

What am I doing wrong?

PHP код:
    //Displays the drugs pack
    
Textdraw11 TextDrawCreate(460.000000165.000000"drugs");
    
TextDrawBackgroundColor(Textdraw1183952640);
    
TextDrawFont(Textdraw115);
    
TextDrawLetterSize(Textdraw110.5000001.000000);
    
TextDrawColor(Textdraw11, -1);
    
TextDrawSetOutline(Textdraw110);
    
TextDrawSetProportional(Textdraw111);
    
TextDrawSetShadow(Textdraw111);
    
TextDrawUseBox(Textdraw111);
    
TextDrawBoxColor(Textdraw11255);
    
TextDrawTextSize(Textdraw1137.00000041.000000);
    
TextDrawSetPreviewModel(Textdraw111576);
    
TextDrawSetPreviewRot(Textdraw110.0000000.000000, -44.0000001.000000);
    
TextDrawSetSelectable(Textdraw110);
    
//Supposed to display the gun
    
Textdraw12 TextDrawCreate(498.000000165.000000"gun");
    
TextDrawBackgroundColor(Textdraw120);
    
TextDrawFont(Textdraw125);
    
TextDrawLetterSize(Textdraw120.5000001.000000);
    
TextDrawColor(Textdraw12, -1);
    
TextDrawSetOutline(Textdraw120);
    
TextDrawSetProportional(Textdraw121);
    
TextDrawSetShadow(Textdraw121);
    
TextDrawUseBox(Textdraw121);
    
TextDrawBoxColor(Textdraw12255);
    
TextDrawTextSize(Textdraw1237.00000041.000000);
    
TextDrawSetPreviewModel(Textdraw12348);
    
TextDrawSetPreviewRot(Textdraw120.00.00.02.5);
    
TextDrawSetSelectable(Textdraw120); 

Link to the picture


Re: TextDrawSetPreviewModel not working - ikey07 - 01.02.2015

First create player textdraw, as it will be per player system, and be sure your model is correct.
Also how are you showing them?


Re: TextDrawSetPreviewModel not working - gilhrpenner - 01.02.2015

Since I'm just playing around and learning I'm using just the regular TextDraw, but yes, I'll definitely change it to PlayerTextDraw.

And I'm showing the text draw at OnPlayerConnect, again, just for trying and learning.


Re : TextDrawSetPreviewModel not working - Dutheil - 01.02.2015

You must using the font : TEXT_DRAW_FONT_MODEL_PREVIEW.

pawn Код:
TextDrawFont(textdraw, TEXT_DRAW_FONT_MODEL_PREVIEW);
And your text must be just an underscore.
pawn Код:
Textdraw11 = TextDrawCreate(460.000000, 165.000000, "_");
Textdraw12 = TextDrawCreate(498.000000, 165.000000, "_");