Vehicle health - 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: Vehicle health (
/showthread.php?tid=180008)
Vehicle health -
martynas - 29.09.2010
Hi second time,
Please tell me anyone how to make function wich would show vehicle health in numeric.. Thanks
Re: Vehicle health -
rbN. - 29.09.2010
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);
Re: Vehicle health -
willsuckformoney - 29.09.2010
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);
Re: Vehicle health -
martynas - 29.09.2010
it shows zero (0)
Re: Vehicle health -
Cameltoe - 29.09.2010
type /dl ingame
Re: Vehicle health -
martynas - 29.09.2010
i need a code
Re: Vehicle health -
Cameltoe - 29.09.2010
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.
Re: Vehicle health -
[XST]O_x - 29.09.2010
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;
}
Re: Vehicle health -
royal_king - 29.09.2010
Hello martynas See this script it will be usefull to you
http://forum.sa-mp.com/showthread.ph...758#post855758
Re: Vehicle health -
martynas - 29.09.2010
[XST]O_x now shows 0.000000