Making vehicle health with 3dtext label.
#1

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
Reply
#2

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
Reply
#3

missing a } just before the last return 1;
Reply
#4

Quote:
Originally Posted by (SF)Noobanatior
Посмотреть сообщение
missing a } just before the last return 1;
I see it. Thank you.
*Editted
Reply
#5

Код:
 	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);
:/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)