Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- FixTire by Johurt, 2014/12/25
- */
- stock FixTire(vehicleid, tireid, bool:isbike = false)
- {
- new p, d, l, tirestate;
- GetVehicleDamageStatus(vehicleid, p, d, l, tirestate);
- new c, t[4];
- if(!isbike)
- {
- if(!(0 < tireid < 5)) return 1;
- while(tirestate > 15) tirestate -= 16;
- new v_t[16][4] =
- {
- {0, 0, 0, 0},
- {0, 0, 0, 1},
- {0, 1, 0, 0},
- {0, 1, 0, 1},
- {0, 0, 1, 0},
- {0, 0, 1, 1},
- {0, 1, 1, 0},
- {0, 1, 1, 1},
- {1, 0, 0, 0},
- {1, 0, 0, 1},
- {1, 1, 0, 0},
- {1, 1, 0, 1},
- {1, 0, 1, 0},
- {1, 0, 1, 1},
- {1, 1, 1, 0},
- {1, 1, 1, 1}
- };
- t[0] = v_t[tirestate][0];
- t[1] = v_t[tirestate][1];
- t[2] = v_t[tirestate][2];
- t[3] = v_t[tirestate][3];
- t[tireid-1] = 0;
- for(c = 0; c < 16; c++)
- {
- if(t[0] == v_t[c][0] && t[1] == v_t[c][1] && t[2] == v_t[c][2] && t[3] == v_t[c][3])
- {
- UpdateVehicleDamageStatus(vehicleid, p, d, l, c);
- break;
- }
- }
- }
- else
- {
- if(!(0 < tireid < 3)) return 1;
- while(tirestate > 3) tirestate -= 4;
- new m_t[4][2] =
- {
- {0, 0},
- {0, 1},
- {1, 0},
- {1, 1}
- };
- t[0] = m_t[tirestate][0];
- t[1] = m_t[tirestate][1];
- t[tireid-1] = 0;
- for(c = 0; c < 4; c++)
- {
- if(t[0] == m_t[c][0] && t[1] == m_t[c][1])
- {
- UpdateVehicleDamageStatus(vehicleid, p, d, l, c);
- break;
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement