Encosto aparece mensagem?
#1

Galera tem alguma funзгo que tipo, eu chego perto do player, encosto nele e aparece uma mensagem?
Reply
#2

Tem sim. Terб que verificar se um player estб prуximo ao outro em um looping.

@Edit
Olha, use isso como lуgica, eu nгo testei mais acredito que irб funcionar.

pawn Код:
public OnPlayerUpdate(playerid)
    {
        for(new i = 0; i <MAX_PLAYERS; ++i)
        {
            if(ProxDetectorS(2.0, playerid, i)) SendClientMessage(playerid, -1, "Estou perto de vocк.");
        }
    }
pawn Код:
forward ProxDetectorS(Float:radi, playerid, targetid);
public ProxDetectorS(Float:radi, playerid, targetid)
{
    if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
    {
        new Float:posx, Float:posy, Float:posz;
        new Float:oldposx, Float:oldposy, Float:oldposz;
        new Float:tempposx, Float:tempposy, Float:tempposz;
        GetPlayerPos(playerid, oldposx, oldposy, oldposz);
        GetPlayerPos(targetid, posx, posy, posz);
        tempposx = (oldposx -posx);
        tempposy = (oldposy -posy);
        tempposz = (oldposz -posz);
        if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
        {
            return 1;
        }
    }
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)