Jump to content
  • 0

Destroy trailer dupa 1 minut


Tikitaka

Question

Problema intalnita (descriere):Cum pot face ca trailerul unui tir sa se distruga daca nu e folosit mai mult de 1 minut?
Ero(area / rile) / warning-(ul / urile):
Liniile de cod / sursa / script-ul:
Imagini / Video (optional):
Ati incercat sa rezolvati singur?: da, am inteles ca trebuie sa folosesc cal back-urile astea dar nu am idee ce trebuie sa fac

public OnTrailerUpdate(playerid, vehicleid)
public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z)
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0
public OnVehicleDeath(vehicleid, killerid)
{
    new Timer[sizeof(Vehicle)];
    for(new i = 0; i < sizeof(Vehicle); i++ )
        if(GetVehicleTrailer(vehicleid) != 0) 
            Timer[vehicleid] = SetTimerEx("KillVehicle", 10000, 0, "ii", vehicleid, 1);

    return 1;
}

function KillVehicle(vehicleid, checkplayer)
{
    if(checkplayer == 0)
    {
        DestroyVehicle(vehicleid);
        KillTimer(Timer[vehicleid]);
    }
    else
    {
        foreach(Player, i) if(!IsPlayerInVehicle(i, vehicleid))
        {
            DestroyVehicle(vehicleid);
            KillTimer(Timer[vehicleid]);
        }
    }
    return 1;
}

 

Incearca asa..

Edited by KnowN .

242086.png

Link to comment
Share on other sites

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.