24.02.2013, 16:48
Tipo, se eu tiver em um local alto o bot vem atй mim voando, como faзo para ele ficar no chгo via mapandreas?
pawn Код:
CallBack::PerseguirJogador() {
for(new i; i != MAX_ZUMBIS; i++) {
if(IsPlayerNPC(i)) {
for(new j ; j != MAX_PLAYERS; j ++) {
if(IsPlayerConnected(j) && !IsPlayerNPC(j)) {
static Float: rnpcpos[3], Float: Z_Pos[3];
GetPlayerPos(i,Z_Pos[0],Z_Pos[1],Z_Pos[2]);
if(IsPlayerInRangeOfPoint(j,50.0,Z_Pos[0],Z_Pos[1],Z_Pos[2])) {
GetPlayerPos(j, rnpcpos[0], rnpcpos[1], rnpcpos[2]);
new Float: angle; GetPlayerFacingAngle(i, angle);
MoveRNPC(i, rnpcpos[0] + floatsin(angle - 90.0, degrees) * (1.0 + random(15)), rnpcpos[1] + floatcos(angle - 90.0, degrees) * (1.0 + random(15)), rnpcpos[2], 3);
}
}
}
}
}
}