SA-MP Forums Archive
TextDraw (...SetPreviewModel) Issue - 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: TextDraw (...SetPreviewModel) Issue (/showthread.php?tid=639212)



TextDraw (...SetPreviewModel) Issue - NoDi522 - 13.08.2017

Код:
new igracVozilo = GetPlayerVehicleID(playerid);
Код:
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?


Re: TextDraw (...SetPreviewModel) Issue - DuyDang2412 - 13.08.2017

Set 'igracVozilo' a vehicle modelid before you pass it to PlayerTextDrawSetPreviewModel, example:
PHP код:
igracVozilo 402// Buffalo Vehicle Modelid
PlayerTextDrawSetPreviewModel(playeridTDEditor_PTD[playerid][5], igracVozilo);
PlayerTextDrawShow(playeridTDEditor_PTD[playerid][5]); 



Re: TextDraw (...SetPreviewModel) Issue - Sanady - 13.08.2017

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 код:
new IgracVozilo[MAX_PLAYERS] = GetVehicleModel(vehicleid);
PlayerTextDrawSetPreviewModel(playeridTDEditor_PTD[playerid][5], igracVozilo[playerid]);
PlayerTextDrawShow(playeridTDEditor_PTD[playerid][5]); 



Re: TextDraw (...SetPreviewModel) Issue - NoDi522 - 13.08.2017

Thanks

Didn't change too much:

Код:
new igracVozilo = GetPlayerVehicleID(playerid);
PlayerTextDrawSetPreviewModel(playerid, TDEditor_PTD[playerid][5], GetVehicleModel(igracVozilo));