GetVehicleHealth on trailers
#5

Quote:
Originally Posted by kaisersouse
Посмотреть сообщение
Some notes on the loop you provided: If GetPlayerVehicleID returns a value OTHER than INVALID_VEHICLE_ID....you don't need to further check IsPlayerInAnyVehicle. If it returned a valid ID...they are in a vehicle.
Now that's an amazing optimization note we don't often see on these forums!

In fact,
pawn Код:
if(IsPlayerInAnyVehicle(playerid))
{
    vID = GetPlayerVehicleID(playerid);
    // ...
}
is as good as
pawn Код:
if((vID = GetPlayerVehicleID(playerid)) != 0)
or
pawn Код:
vID = GetPlayerVehicleID(playerid);
if(vID != 0)
{
    // ...
}
Reply


Messages In This Thread
GetVehicleHealth on trailers - by tyler12 - 04.11.2012, 16:18
Re: GetVehicleHealth on trailers - by Basssiiie - 05.11.2012, 00:20
Re: GetVehicleHealth on trailers - by tyler12 - 05.11.2012, 07:19
Re: GetVehicleHealth on trailers - by kaisersouse - 05.11.2012, 13:58
Re: GetVehicleHealth on trailers - by AndreT - 05.11.2012, 17:38
Re: GetVehicleHealth on trailers - by kaisersouse - 05.11.2012, 21:19
Re: GetVehicleHealth on trailers - by Kar - 06.11.2012, 23:10

Forum Jump:


Users browsing this thread: 2 Guest(s)