Making vehicle health with 3dtext label. - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Making vehicle health with 3dtext label. (
/showthread.php?tid=188239)
Making vehicle health with 3dtext label. -
ZamaXor - 06.11.2010
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
Re: Making vehicle health with 3dtext label. -
Kwarde - 07.11.2010
Use ingame
/dl 
Try it, don't make any commands. Just typ /dl.
Oh wait, no, then you only see it yourself.
Whatever, I'm gonna make a fast script (idk if its gonna work). I'll edit this msg. please wait
pawn Код:
//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;
}
Try that :P
idk if it's working. I don't work with 3D text labels
Re: Making vehicle health with 3dtext label. -
(SF)Noobanatior - 07.11.2010
missing a } just before the last return 1;
Re: Making vehicle health with 3dtext label. -
Kwarde - 07.11.2010
Quote:
Originally Posted by (SF)Noobanatior
missing a } just before the last return 1;
|
I see it. Thank you.
*Editted
Re: Making vehicle health with 3dtext label. -
-Rebel Son- - 07.11.2010
Код:
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);
:/