10.07.2018, 16:25
again wtf is this shit?
why are you repeating useless code liks this?
can be done this
why are you repeating useless code liks this?
PHP Code:
if(PRESSED(KEY_WALK)) {
if(Deep_Deer[playerid] == 1) {
if(IsPlayerInRangeOfPoint(playerid, 3.5, 2046.7698, -799.4532, 126.7188) && Deer[playerid] == 1) {
TogglePlayerControllable(playerid, 0);
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.1, 1, 1, 1, 1, 1, 0);
Deep_Deer[playerid] = 0;
KillTimer(Meeters_BTWDeer[playerid]);
Shoot_Deer[playerid] = 0;
SetTimer("Done_Deer", 3500, false);
}else if(IsPlayerInRangeOfPoint(playerid, 3.5, 2021.1818, -494.0207, 76.1904) && Deer[playerid] == 2) {
TogglePlayerControllable(playerid, 0);
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.1, 1, 1, 1, 1, 1, 0);
Deep_Deer[playerid] = 0;
KillTimer(Meeters_BTWDeer[playerid]);
Shoot_Deer[playerid] = 0;
SetTimer("Done_Deer", 3500, false);
}else if(IsPlayerInRangeOfPoint(playerid, 3.5, 1632.5769, -599.7444, 61.8233) && Deer[playerid] == 3) {
TogglePlayerControllable(playerid, 0);
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.1, 1, 1, 1, 1, 1, 0);
Deep_Deer[playerid] = 0;
KillTimer(Meeters_BTWDeer[playerid]);
Shoot_Deer[playerid] = 0;
SetTimer("Done_Deer", 3500, false);
}else if(IsPlayerInRangeOfPoint(playerid, 3.5, 1741.4386, -979.5817, 36.6115) && Deer[playerid] == 4) {
TogglePlayerControllable(playerid, 0);
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.1, 1, 1, 1, 1, 1, 0);
Deep_Deer[playerid] = 0;
KillTimer(Meeters_BTWDeer[playerid]);
Shoot_Deer[playerid] = 0;
SetTimer("Done_Deer", 3500, false);
}else if(IsPlayerInRangeOfPoint(playerid, 3.5, 2553.6780, -963.4338, 81.6685) && Deer[playerid] == 5) {
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.1, 1, 1, 1, 1, 1, 0);
TogglePlayerControllable(playerid, 0);
Deep_Deer[playerid] = 0;
KillTimer(Meeters_BTWDeer[playerid]);
Shoot_Deer[playerid] = 0;
SetTimer("Done_Deer", 3500, false);
}else if(IsPlayerInRangeOfPoint(playerid, 3.5, 2637.4963, -380.2195, 57.9261) && Deer[playerid] == 6) {
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.1, 1, 1, 1, 1, 1, 0);
TogglePlayerControllable(playerid, 0);
Deep_Deer[playerid] = 0;
KillTimer(Meeters_BTWDeer[playerid]);
Shoot_Deer[playerid] = 0;
SetTimer("Done_Deer", 3500, false);
}else if(IsPlayerInRangeOfPoint(playerid, 3.5, 2406.9773, -403.4681, 72.1762) && Deer[playerid] == 7) {
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.1, 1, 1, 1, 1, 1, 0);
TogglePlayerControllable(playerid, 0);
Deep_Deer[playerid] = 0;
KillTimer(Meeters_BTWDeer[playerid]);
Shoot_Deer[playerid] = 0;
SetTimer("Done_Deer", 3500, false);
}
}
}
PHP Code:
if(Deep_Deer[playerid] == 1) {
if(IsPlayerInRangeOfPoint(playerid, 3.5, 2046.7698, -799.4532, 126.7188) && Deer[playerid] == 1 ||
IsPlayerInRangeOfPoint(playerid, 3.5, 2021.1818, -494.0207, 76.1904) && Deer[playerid] == 2 ||
IsPlayerInRangeOfPoint(playerid, 3.5, 1632.5769, -599.7444, 61.8233) && Deer[playerid] == 3 ||
IsPlayerInRangeOfPoint(playerid, 3.5, 1741.4386, -979.5817, 36.6115) && Deer[playerid] == 4 ||
IsPlayerInRangeOfPoint(playerid, 3.5, 2553.6780, -963.4338, 81.6685) && Deer[playerid] == 5 ||
IsPlayerInRangeOfPoint(playerid, 3.5, 2637.4963, -380.2195, 57.9261) && Deer[playerid] == 6 ||
IsPlayerInRangeOfPoint(playerid, 3.5, 2406.9773, -403.4681, 72.1762) && Deer[playerid] == 7){
TogglePlayerControllable(playerid, 0);
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.1, 1, 1, 1, 1, 1, 0);
Deep_Deer[playerid] = 0;
KillTimer(Meeters_BTWDeer[playerid]);
Shoot_Deer[playerid] = 0;
SetTimer("Done_Deer", 3500, false);
}
}