Warnning: express has no effect
#1

PHP код:
public OnVehicleHealthChange(vehicleidFloat:vehicle_newhealthFloat:vehicle_oldhealth)
{
  new
      
myArray[92], lasthealth;
  if(
vehicle_newhealth vehicle_oldhealth)
  {
    foreach(
Playeru)
    {
      
lasthealth == (vehicle_health_loss vehicle_newhealth);
      if(
IsPlayerInVehicle(uvehicleid) && GetPlayerState(u) == PLAYER_STATE_DRIVER)
      {
        if(
vehicle_newhealth 550 && vehicle_newhealth 649)
        {
            
format(myArraysizeof(myArray), "damage @ vehicleID:%i, newhealth:%.3f, oldhealth:%.3f, difference:%.3f, BatteryL: %d EngineL:%d"vehicleidvehicle_newhealthvehicle_oldhealth, (vehicle_oldhealth vehicle_newhealth), VehicleInfo[vehicleid][carBatteryL], VehicleInfo[vehicleid][carEngineL]);
            
SendClientMessage(u0xFFFFFFFFmyArray);
            
VehicleInfo[vehicleid][carBatteryL] -= (lasthealth/125.0);
            
VehicleInfo[vehicleid][carEngineL] -= (lasthealth/150.0);
        }
        else if(
vehicle_newhealth 390 && vehicle_newhealth 549)
        {
            
format(myArraysizeof(myArray), "damage @ vehicleID:%i, newhealth:%.3f, oldhealth:%.3f, difference:%.3f, BatteryL: %d EngineL:%d"vehicleidvehicle_newhealthvehicle_oldhealth, (vehicle_oldhealth vehicle_newhealth), VehicleInfo[vehicleid][carBatteryL], VehicleInfo[vehicleid][carEngineL]);
            
SendClientMessage(u0xFFFFFFFFmyArray);
              
VehicleInfo[vehicleid][carBatteryL] -= (lasthealth/100.0);
               
VehicleInfo[vehicleid][carEngineL] -= (lasthealth/125.0);
        }
        else if(
vehicle_newhealth 250 && vehicle_newhealth 389)
        {
            
format(myArraysizeof(myArray), "damage @ vehicleID:%i, newhealth:%.3f, oldhealth:%.3f, difference:%.3f, BatteryL: %d EngineL:%d"vehicleidvehicle_newhealthvehicle_oldhealth, (vehicle_oldhealth vehicle_newhealth), VehicleInfo[vehicleid][carBatteryL], VehicleInfo[vehicleid][carEngineL]);
            
SendClientMessage(u0xFFFFFFFFmyArray);
            
VehicleInfo[vehicleid][carBatteryL] -= (lasthealth/75.0);
            
VehicleInfo[vehicleid][carEngineL] -= (lasthealth/100.0);
            
VehicleInfo[vehicleid][carBroken] = 1;
        }
        break;
      }
    }
  }
  return 
true;

Reply
#2

lasthealth and vehicle_health_loss is not a float
Reply
#3

BUMP
Reply
#4

which line has the error please specify it
Reply
#5

PHP код:
lasthealth == (vehicle_health_loss vehicle_newhealth); 
to
PHP код:
lasthealth = (vehicle_health_loss vehicle_newhealth); 
an error that i see
Reply
#6

Quote:
Originally Posted by caoraivoso3
Посмотреть сообщение
PHP код:
lasthealth == (vehicle_health_loss vehicle_newhealth); 
to
PHP код:
lasthealth = (vehicle_health_loss vehicle_newhealth); 
an error that i see
new error: warning 213: tag mismatch
Here is definition of vehicle_health_loss: new vehicle_health_loss = 1000;
Reply
#7

Check this.

Код:
lasthealth = vehicle_health_loss - floatround(vehicle_newhealth);
Reply
#8

Quote:
Originally Posted by ball
Посмотреть сообщение
Check this.

Код:
lasthealth = vehicle_health_loss - floatround(vehicle_newhealth);
It says never used lasthealth
Reply
#9

Declare "lasthealth" as float.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)