GetVehicleHealth on trailers
#4

You're only checking trailers IF they are attached. Are you looking for god-mode trailers all the time, or do you actually need the health amounts for individual trailers?

Heres something to start with:
Код:
new vmodel;
for(new v; v < MAX_VEHICLES; v++)
{
     vmodel = GetVehicleModel(v);
     switch(vmodel)
     {
         case 435,450,569,570,584,590,591,606,607,608,610,611: //all trailers according to wiki.sa-mp.com
         {
               SetVehicleHealth(v,1000);
         }
     }
}
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.
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: 1 Guest(s)