SetVehicleHealth
#1

1000 health = 100 Health precents
10000 health = 1300 Health precents... wtf?
how can i set 1000 health precents then?
Reply
#2

bump cmon it's a silly question pls help me for 1 sec and get ur rep
Reply
#3

What? 100% for what?
Reply
#4

Show some code where it calculates that weird percent value.

10000 health should be 1000 percent.

How did you get 1300 percent?
There is no native function to check health in percent.
Reply
#5

PHP код:
Float:CalculatePercent(Float:valueFloat:maxvalue) {
    return ( (
value maxvalue ) * 100.0 );

Test:
PHP код:
    printf("Value: %0.1f, Max: %0.1f, percent: %0.1f%%"900.01000.0CalculatePercent(900.01000.0));
    
printf("Value: %0.1f, Max: %0.1f, percent: %0.1f%%"9000.01000.0CalculatePercent(9000.01000.0));
    
printf("Value: %0.1f, Max: %0.1f, percent: %0.1f%%"1000.01000.0CalculatePercent(1000.01000.0));
    
printf("Value: %0.1f, Max: %0.1f, percent: %0.1f%%"10000.01000.0CalculatePercent(10000.01000.0));
    
printf("Value: %0.1f, Max: %0.1f, percent: %0.1f%%"845.01000.0CalculatePercent(845.01000.0)); 
Results:
PHP код:
[07:13:38Value900.0Max1000.0percent90.0%
[
07:13:38Value9000.0Max1000.0percent900.0%
[
07:13:38Value1000.0Max1000.0percent100.0%
[
07:13:38Value10000.0Max1000.0percent1000.0%
[
07:13:38Value845.0Max1000.0percent84.5
Reply
#6

Set the vehicle health to 7750 for 1000 Health Percent

PHP код:
#define CalcPercentVehicleHealth(%0) (((%0) * 75) / 10 + 250) 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)