Minus something
#1

I want when the engine of a car starts, to decercase (sorry for my fuckin' english) with 5 the engine life.

Is it correct to be like this?: VehicleInfo[idcar][vEngineLife]-5 (where idcar is the GetPlayerVehicleID function)


Thank you in advance.
Reply
#2

That will subtract 5 from the variable but the result is never used or saved and thus it's useless. You need to assign it and that means it has to have the "=" symbol in it somewhere. You can either do it like this:
pawn Код:
VehicleInfo[idcar][vEngineLife] = VehicleInfo[idcar][vEngineLife] - 5;
Or shorthand (and probably much easier):
pawn Код:
VehicleInfo[idcar][vEngineLife] -= 5;
Reply
#3

Use this:
VehicleInfo[idcar][vEngineLife] -= 5;
Reply
#4

Thank you vince and calvin. REP +
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)