Vehicle health
#1

Hi second time,


Please tell me anyone how to make function wich would show vehicle health in numeric.. Thanks
Reply
#2

Didn't tested it, but should work:

pawn Код:
new Float:health, msg[128];
        format(msg, sizeof(msg), "Vehicle health: %d", GetVehicleHealth(GetPlayerVehicleID(playerid), health));
        SendClientMessage(playerid, *YOURCOLORGOESHERE*, msg);
Reply
#3

pawn Код:
new string[128], v = GetVehicleModel(v), Float:Health;
format(string,sizeof(string),"You Car Health is %d",GetVehicleHealth(v,Health));
SendClientMessage(playerid,COLOR,string);
Reply
#4

it shows zero (0)
Reply
#5

type /dl ingame
Reply
#6

i need a code
Reply
#7

Quote:
Originally Posted by martynas
Посмотреть сообщение
i need a code
/dl is an integrated command like: /q = quit game etc.

if you need an working one go with zcmd and do like this:

pawn Код:
command(vhealth,playerid,params[])
{
     if(!IsPlayerInAnyVehicle(playerid)) return SendCientMessage( somme params..);
     new vehicleid = GetPlayerVehicleID(playerid);
     new string[20], Float:vHealth;
     GetVehicleHealth(vehicleid, vHealth);
     format(string, 20, "Vehicle health: %d", vHealth);
     SendClientMessage(playerid, COLOR, sting);
     return 1;
}
not tested though.
Reply
#8

pawn Код:
if(strcmp(cmdtext,"/myvehhealth",true) == 0)
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        new Float:h,string[50];
        GetVehicleHealth(GetPlayerVehicleID(playerid),h);
        format(string,sizeof(string),"Your vehicle's health is %f.",floatround(h));
        SendClientMessage(playerid,color,string);
    }
    return 1;
}
Reply
#9

Hello martynas See this script it will be usefull to you

http://forum.sa-mp.com/showthread.ph...758#post855758
Reply
#10

[XST]O_x now shows 0.000000
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)