Need some help with the timer
#4

man i have for cars but i dont know for object

pawn Код:
#define MAX_CUSTOM_VEHICLES 5
new CustomVehicles[MAX_CUSTOM_VEHICLES];

//(...)
CustomVehicles[0] = CreateVehicle(541, 300.2742, 1863.9669, 17.2396, 0.0000, -1, -1, 100);

//(...)
public OnPlayerStateChange(playerid, newstate, oldstate) {
    if(newstate & PLAYER_STATE_DRIVER) {
        new vid = GetPlayerVehicleID(playerid), Float:p[4];
        for(new i = 0; i != MAX_CUSTOM_VEHICLES; ++i) { //Alternatively use iterator
        if(CustomVehicles[i] == vid) {
            GetVehiclePos(vid, p[0], p[1], p[2]);
            GetVehicleZAngle(vid, p[3]);
            new model = GetVehicleModel(vid);
            SetTimerEx("RebuildCar", 2000, 0, "iiiffff", playerid, i, model, p[0], p[1], p[2], p[3]);
        }
    }
    }
    return 1;
}

forward RebuildCar(pid, vehi, model, Float:x, Float:y, Float:z, Float:r);
public RebuildCar(pid, vehi, model, Float:x, Float:y, Float:z, Float:r) {
    CustomVehicles[vehi] = CreateVehicle(model, x, y, z, r, -1, -1, 0);
    return 1;
}
Reply


Messages In This Thread
Need some help with the timer - by Don_Cage - 18.03.2013, 05:38
Re: Need some help with the timer - by CBCandyBoy - 18.03.2013, 05:49
Re: Need some help with the timer - by Don_Cage - 18.03.2013, 05:54
Re: Need some help with the timer - by CBCandyBoy - 18.03.2013, 05:58
Re: Need some help with the timer - by Don_Cage - 18.03.2013, 06:06
Re: Need some help with the timer - by CBCandyBoy - 18.03.2013, 06:21
Re: Need some help with the timer - by Don_Cage - 18.03.2013, 06:36
Re: Need some help with the timer - by CBCandyBoy - 18.03.2013, 06:41
Re: Need some help with the timer - by Don_Cage - 18.03.2013, 07:15
Re: Need some help with the timer - by CBCandyBoy - 18.03.2013, 07:17

Forum Jump:


Users browsing this thread: 1 Guest(s)