textdraw models - 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 models (
/showthread.php?tid=580126)
textdraw models -
Lajko1 - 02.07.2015
Hey guys I've been thinking it's possible to detect in which vehicle player is and link that to textdraw models, so it will show right textdraw model id?
Re: textdraw models -
kalanerik99 - 02.07.2015
Its possible
I will post it when I will find it
I made one myself long ago
PHP код:
new PlayerText:Model;
ModelTextDraw(playerid,model)
{
Model = CreatePlayerTextDraw(playerid, 330.0 ,400.0, "_");
PlayerTextDrawFont(playerid, Model, TEXT_DRAW_FONT_MODEL_PREVIEW);
PlayerTextDrawUseBox(playerid, Model, 1);
PlayerTextDrawColor(playerid, Model, 0xFFFFFFFF);
PlayerTextDrawBackgroundColor(playerid, Model, 0x88888899);
PlayerTextDrawBoxColor(playerid, Model, 0xF0F0F0);
PlayerTextDrawTextSize(playerid, Model, 60.0, 60.0);
PlayerTextDrawSetPreviewModel(playerid, Model,model);
PlayerTextDrawSetPreviewRot(playerid,Model, -16.0, 0.0, 270.0, 1.0);
PlayerTextDrawShow(playerid,Model);
}
Example
Код:
public VehicleSpawner(playerid,modelid)
{
RemovePlayerFromVehicle(playerid);
DestroyVehicle(veh1[playerid]);
new Float:x,Float:y,Float:z,Float:a;
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);
veh1[playerid] = CreateVehicle(modelid,x+1,y+1,z,a,-1,-1,-1);
PutPlayerInVehicle(playerid, veh1[playerid], 0);
SetVehicleHealth(veh1[playerid], 1000.0);
LinkVehicleToInterior(veh1[playerid], GetPlayerInterior(playerid));
SetVehicleVirtualWorld(veh1[playerid],GetPlayerVirtualWorld(playerid));
ModelTextDraw(playerid,modelid)
}
or
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
if(IsPlayerInAnyVehicle(playerid))
{
new vehicleid = GetPlayerVehicleID(playerid);
ModelTextDraw(playerid,GetVehicleModel(vehicleid)
}
}
return 1;
}
Re: textdraw models -
Lajko1 - 02.07.2015
Thank you
Hvala.