20.12.2012, 10:19
Eu queria saber se йpossivel fazer com que esse codigo (faz o zombie correr atraz de vocк) nгo funcione,ou a distance tem qe ser menor para o jogador agaixado,porem nao descobri como faz para reconhecer se ele esta agaixado:
PHP код:
public CheckCloserPlayers(playerid){ // Detecta player mais perto e vai atras
if( Zombies[playerid][LastZombieHealth] > 0.0 ){
new cp = GetClosestPlayer(playerid);
new Float:MinDistance = 3.0;
if(IsPlayerInAnyVehicle(cp)){ MinDistance = 5.0; }
Zombies[playerid][ZombieTarget] = cp;
if(GetDistanceToPlayer(playerid,cp) <= 40.0 && GetDistanceToPlayer(playerid,cp) > 10.0){
IrParaPlayer(1,playerid,cp);
}else if(GetDistanceToPlayer(playerid,cp) <= 15.0 && GetDistanceToPlayer(playerid,cp) > MinDistance){
IrParaPlayer(0,playerid,cp);
}else if(GetDistanceToPlayer(playerid,cp) <= MinDistance){
Parar(playerid);
}
if(GetDistanceToPlayer(playerid,cp) <= MinDistance){
new Float:h;
if(IsPlayerInAnyVehicle(cp)){
new cpc = GetPlayerVehicleID(cp);
GetVehicleHealth(cpc,h);
if(GetDistanceToPlayer(playerid,cp) < MinDistance){
SetVehicleHealth(cpc,h-80.0);
ApplyAnimation(playerid,"Gangs","shake_carSH",1,1,1,0,0,0);
}
}else{
GetPlayerHealth(cp,h);
if(GetDistanceToPlayer(playerid,cp) > 0.0){
SetPlayerHealth(cp,h-5.0);
ApplyAnimation(playerid,"FIGHT_D","FightD_3",1,1,0,0,1,0);
}
}
}
}
}