Add
Fixing[MAX_VEHICLES];
command [ put in OnPlayerCommand ]
else if (strcmp(cmd, "fix", true) == 0) {
if(Fixing[GetPlayerVehicleID(playerid)] == 1) SendClientMessage(playerid,COLOR_RED," Already Fixing This Vehicle ");
else if(!IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid,COLOR_RED," Not In Vehicle ");
else {
Fixing[GetPlayerVehicleID(playerid)] = 1;
SendClientMessage(playerid,COLOR_RED," Fixing ");
SetTimer("VehicleFixing", 10000, 0);
}
return 1;
}
Timer
forward VehicleFixing();
public VehicleFixing() {
for(new i ; i <MAX_VEHICLES;i++) {
if(Fixing[i] == 1) {
SetVehicleHealth(i, 1000);
SendClientMessageToAll(COLOR_GREEN," Vehicle Has Been Fixed ");
SetVehicleTyre(i,1);
Fixing[i] = 0;
}
}
return 1;
}
Credits : ME