SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 13/08/2017, 11:21 AM   #1
NoDi522
Huge Clucker
 
NoDi522's Avatar
 
Join Date: Sep 2014
Location: Croatia ❤ ✌
Posts: 319
Reputation: 9
Post TextDraw (...SetPreviewModel) Issue

Code:
new igracVozilo = GetPlayerVehicleID(playerid);

Code:
TDEditor_PTD[playerid][5] = CreatePlayerTextDraw(playerid, 570.000000, 364.416717, "");
			PlayerTextDrawLetterSize(playerid, TDEditor_PTD[playerid][5], 0.000000, 0.000000);
			PlayerTextDrawTextSize(playerid, TDEditor_PTD[playerid][5], 63.767906, 77.027442);
			PlayerTextDrawAlignment(playerid, TDEditor_PTD[playerid][5], 1);
			PlayerTextDrawColor(playerid, TDEditor_PTD[playerid][5], -1);
			PlayerTextDrawSetShadow(playerid, TDEditor_PTD[playerid][5], 0);
			PlayerTextDrawSetOutline(playerid, TDEditor_PTD[playerid][5], 0);
			PlayerTextDrawBackgroundColor(playerid, TDEditor_PTD[playerid][5], 255);
			PlayerTextDrawFont(playerid, TDEditor_PTD[playerid][5], 5);
			PlayerTextDrawSetProportional(playerid, TDEditor_PTD[playerid][5], 0);
			PlayerTextDrawSetShadow(playerid, TDEditor_PTD[playerid][5], 0);
			PlayerTextDrawSetPreviewModel(playerid, TDEditor_PTD[playerid][5], igracVozilo);
			PlayerTextDrawSetPreviewRot(playerid, TDEditor_PTD[playerid][5], 337.000000, 0.000000, 313.000000, 0.931141);
			PlayerTextDrawSetPreviewVehCol(playerid, TDEditor_PTD[playerid][5], 3, 1);
			PlayerTextDrawShow(playerid, TDEditor_PTD[playerid][5]);
I want to display the vehicle model.

When i pass the variable "igracVozilo" to PlayerTextDrawSetPreview, it displays the player skin with ID 1.
But if I pass the vehicleid ID directly, it works.

Any idea?
NoDi522 is offline   Reply With Quote
Old 13/08/2017, 12:00 PM   #2
DuyDang2412
Big Clucker
 
Join Date: Feb 2017
Posts: 126
Reputation: 2
Default Re: TextDraw (...SetPreviewModel) Issue

Set 'igracVozilo' a vehicle modelid before you pass it to PlayerTextDrawSetPreviewModel, example:
PHP Code:
igracVozilo 402// Buffalo Vehicle Modelid
PlayerTextDrawSetPreviewModel(playeridTDEditor_PTD[playerid][5], igracVozilo);
PlayerTextDrawShow(playeridTDEditor_PTD[playerid][5]); 
DuyDang2412 is offline   Reply With Quote
Old 13/08/2017, 12:47 PM   #3
Sanady
High-roller
 
Sanady's Avatar
 
Join Date: May 2012
Location: Los Santos
Posts: 1,427
Reputation: 116
Default Re: TextDraw (...SetPreviewModel) Issue

Vehicle ID and model ID is different, so you are creating variable and inputting into it vehicle id, you need to input model id then textdraw will recognize that like model to preview. So I am suggesting to you this function:
GetVehicleModel

PHP Code:
new IgracVozilo[MAX_PLAYERS] = GetVehicleModel(vehicleid);
PlayerTextDrawSetPreviewModel(playeridTDEditor_PTD[playerid][5], igracVozilo[playerid]);
PlayerTextDrawShow(playeridTDEditor_PTD[playerid][5]); 
__________________


Sanady is offline   Reply With Quote
Old 13/08/2017, 01:19 PM   #4
NoDi522
Huge Clucker
 
NoDi522's Avatar
 
Join Date: Sep 2014
Location: Croatia ❤ ✌
Posts: 319
Reputation: 9
Default Re: TextDraw (...SetPreviewModel) Issue

Thanks

Didn't change too much:

Code:
new igracVozilo = GetPlayerVehicleID(playerid);
PlayerTextDrawSetPreviewModel(playerid, TDEditor_PTD[playerid][5], GetVehicleModel(igracVozilo));
NoDi522 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Textdraw issue. alexanderjb918 Scripting Help 11 13/07/2015 07:40 PM
Textdraw issue kevin1990 Scripting Help 5 25/03/2015 12:51 AM
Textdraw Issue JessThompson Scripting Help 13 29/07/2014 02:42 PM
[Ajuda] Erro no SetPreviewModel Lucas_Pawno Português/Portuguese 5 26/01/2014 01:43 AM
SetPreviewModel only 1x set, if more, not set gamelaster Scripting Help 2 23/01/2013 05:32 PM


All times are GMT. The time now is 11:52 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.