Destroy car after car exit.
#3

pawn Код:
new gAdminVeh[MAX_VEHICLES];

CMD:acar(playerid, params[])
{
    // Blah blah blah
    new vid = CreateVehicle(...);
    gAdminVeh[vid] = 1;
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == 2) SetPVarInt(playerid, "lastveh", GetPlayerVehicleID(playerid));

    new lastveh = GetPVarInt(playerid, "lastveh");
    if(oldstate == 2 && gAdminVeh[lastveh] == 1)
    {
        DestroyVehicle(lastveh);
        gAdminVeh[lastveh] = 0;
    }
}
Not tested.
Reply


Messages In This Thread
Destroy car after car exit. - by cod5devious - 29.05.2012, 17:42
Re: Destroy car after car exit. - by FalconX - 29.05.2012, 17:49
Re: Destroy car after car exit. - by MP2 - 29.05.2012, 17:50
Re: Destroy car after car exit. - by kaisersouse - 29.05.2012, 18:21
Re: Destroy car after car exit. - by MP2 - 29.05.2012, 18:55
Re: Destroy car after car exit. - by Jonny5 - 29.05.2012, 19:12

Forum Jump:


Users browsing this thread: 1 Guest(s)