need help with AttachObjectToVehicle
#1

Hello i want to attach fire object on vehicle when vehicle healt reach 250 hare is my code :

Код:
Flame = CreateObject(18690, 10.0, 10.0, 10.0, 0, 0, 0);

public carcheck()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
           new vehicle, Float:health;
           vehicle = GetPlayerVehicleID(i);
           GetVehicleHealth(vehicle, health);
           if(health <= 250)
           {
           		RemovePlayerFromVehicle(i);
           		AttachObjectToVehicle(Flame, vehicle, 0.0, 1.5, -1.5, 0.000000, 0.000000, 0.000000);
             	health += 150;
                SetVehicleHealth(vehicle, health);
   
           }
     }
     return 1;
}
but its not working and i dont realy know the reason why , i have tested this on game mode int
Код:
test = AddStaticVehicle(411, 1798.6711,-1605.2622,13.5469,260.7245, 1, 1);
Flame = CreateObject(18690, 10.0, 10.0, 10.0, 0, 0, 0);
AttachObjectToVehicle(Flame, test, 0.0, 1.5, -1.5, 0.000000, 0.000000, 0.000000);
yes its works its attach flames to vehicle but if i do that on my carcheck its not working its just add +150 healt to vehicle when she reach 250 . help please
Reply


Messages In This Thread
need help with AttachObjectToVehicle - by cyberlord - 07.01.2015, 13:06
Re: need help with AttachObjectToVehicle - by Pottus - 07.01.2015, 13:16
Re: need help with AttachObjectToVehicle - by cyberlord - 07.01.2015, 13:24
Re: need help with AttachObjectToVehicle - by cyberlord - 07.01.2015, 16:48

Forum Jump:


Users browsing this thread: 2 Guest(s)