06.11.2010, 22:20
I need to create a 3dtext attached only in rhino that will show rhino health. Don't hide the 3dtext when player leaves rhino. Everytime show the 3textlabel health for all.
Thanks
Thanks
//Here ya go
#include <a_samp>
#define FILTERSCRIPT
new Text3D:VehHealth[MAX_VEHICLES];
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
return 1;
}
#else
main()
{
return 1;
}
public OnGameModeInit()
{
return 1;
}
#endif
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/vehhealthon", true))
{
new string[128];
new Float:vX, Float:vY, Float:vZ;
GetVehiclePos(GetPlayerVehicleID(playerid), vX, vY, vZ);
format(string, 128, "%f", GetVehicleHealth(GetPlayerVehicleID(playerid)));
VehHealth[GetPlayerVehicleID(playerid)] = Create3DTextLabel(string, 0xFFFFFFAA, vX, vY, vZ, 50, -1, 0);
Attach3DTextLabelToVehicle(VehHealth[GetPlayerVehicleID(playerid)], GetPlayerVehicleID(playerid), 0.0, 0.0, 1.5);
}
return 1;
}
new Float:vx, Float:vy, Float:vz, Float:vHealth,string[10]; GetVehicleHealth(vehicleid, vHealth); new Text3D:V3D = Create3DTextLabel(string,COLOR_RED,vx,vy,vz, 50, 0,0); Attach3DTextLabelToVehicle(V3D,vehicleid,vx, vy, vz+1.5); format(string, sizeof(string), "%.0f", vHealth);