[Ajuda] GetPlayerDistanceFromPoint
#4

olha a minha mensagem!

para quem estiver interessado vou deixar aqui o exemplo tbm

pawn Код:
//no topo do GM
#define TOTAL_DE_HOSPITAIS 3




//no comando


new Float:poshospital[TOTAL_DE_HOSPITAIS][3] = {
    {0.0,0.0,0.0},//coloca as coordenadas do hospital, voce poderб ausa-las para setar a posicao (veja mais abaixo)
    {0.0,0.0,0.0},
    {0.0,0.0,0.0}
};
new Float:menordistancia=0xFFFFFF;//16777215 em decimal
new Float:distactual;
new hospital;

for(new nh=0;nh!=TOTAL_DE_HOSPITAIS;nh++) {
    distactual = GetPlayerDistanceFromPoint(playerid,poshospital[nh][0],poshospital[nh][1],poshospital[nh][2]);
    if (distactual<menordistancia) {
        menordistancia=distactual;
        hospital=nh;
    }
}

//o hospital mais perto й o "hospital"
//agora voce pode usar por exemplo SetPlayerPos(playerid,poshospital[hospital][0],poshospital[hospital][1],poshospital[hospital][2]);
Reply


Messages In This Thread
GetPlayerDistanceFromPoint - by iCracker - 15.06.2013, 01:37
Re: GetPlayerDistanceFromPoint - by lucasgolino - 15.06.2013, 03:45
Re: GetPlayerDistanceFromPoint - by iCracker - 15.06.2013, 08:29
Respuesta: GetPlayerDistanceFromPoint - by DartakousLien - 15.06.2013, 13:56
Re: GetPlayerDistanceFromPoint - by iCracker - 15.06.2013, 23:10
Re: GetPlayerDistanceFromPoint - by iCracker - 15.06.2013, 23:19
Re: GetPlayerDistanceFromPoint - by iCracker - 17.06.2013, 00:56
Respuesta: GetPlayerDistanceFromPoint - by DartakousLien - 17.06.2013, 23:26
Re: Respuesta: GetPlayerDistanceFromPoint - by Lucas_Pawno - 17.06.2013, 23:32

Forum Jump:


Users browsing this thread: 2 Guest(s)