Jump to content
  • 0

Masina in flacari


Question

Posted

Buna,vreau sa fac ca o masina cand are health 0,adica ar trebui sa explodeze.Sa ramana la health 0,dar sa fie in flacari fara a exploda pana la venirea pompierilor,cand focul este stins.Playerul va putea urca in masina sa o conduca,dar pana este in flacari playerul nu va putea merge cu masina,ca si un fel de freeze la masina.

Am incercat asa:

if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)

{

  for(new i = 0; i < MAX_PLAYERS; i++)

{

new Float:health;

    new veh = GetPlayerVehicleID(i);

    GetVehicleHealth(veh, health);

    if(health == 0)

{

  new Float:vehx, Float:vehy, Float:vehz;

    SetVehicleHealth(veh, 1000);

    CreateObject(3461, i, vehx, vehy, vehz-2.61, 0, 0, 0.0);

GetVehiclePos(i, vehx, vehy, vehz);

TogglePlayerControllable(i, false);

    if(PlayerInfo[pLeader] == 4 && PlayerInfo[pMember] == 4)

    {

        SendClientMessage(i, COLOR_LIGHTRED, "ALERT!!! A car is on fire,go to the vehicle fast!");

SetPlayerCheckpoint(i, vehx, vehy, vehz, 5.0);

if(PlayerToPoint(i, vehx, vehy, vehz))

{

    DisablePlayerCheckpoint(i);

    TogglePlayerControllable(i, true);

  }

}

}

}

}

Daca ti-am fost de ajutor +1 Respect!Multumesc

3 answers to this question

Recommended Posts

Posted

Nu. Acolo iti arata la ce valori ale vietii masini va: lua foc, va avea fum, etc. Tu la comanda respectiva pui un GetVehicleHealth si pui un if daca este mai mica decat valoarea respectiva sa nu porneasca motorul.

 

1859311972_BANNER-GIREADAcopy-min.thumb.png.48e5e420ae2185dce5b244965a1d2601.png

 

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.