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
#2

You need an object for each vehicle so CreateObject() is a bad choice I recommend using CreateDynamicObject()
Reply
#3

Quote:
Originally Posted by Pottus
Посмотреть сообщение
You need an object for each vehicle so CreateObject() is a bad choice I recommend using CreateDynamicObject()
yes tnx u but this doesnt help i remake my object to dynamic one but its still not attach them

and another thing if i use dynamic object i got this instead of flames

Reply
#4

Please help my some1
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)