TextDraw (...SetPreviewModel) Issue
#1

Код:
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?
Reply
#2

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]); 
Reply
#3

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]); 
Reply
#4

Thanks

Didn't change too much:

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


Forum Jump:


Users browsing this thread: 1 Guest(s)