[Ajuda] portгo abre ao se aproximar
#8

fmz tenta assim entгo

pawn Код:
#include <a_samp>

new portao;
forward pp();
forward pp2(playerid);

forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);

public OnGameModeExit()
{
    SetTimer("pp", 1000, false);
    return 1;
}

public pp()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        pp2(i);
    }
    return 1;
}
public pp2(playerid)
{
    if(PlayerToPoint(11.0, playerid, 213.8, 1875.0, 11.3))
    {
        MoveObject(portao, 200.8, 1875.0, 11.3, 5);
    }
    else
    {
        MoveObject(portao, 213.8, 1875.0, 11.3, 5);
    }
    return 1;
}

public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
    if(IsPlayerConnected(playerid))
    {

        new Float:oldposx, Float:oldposy, Float:oldposz;
        new Float:tempposx, Float:tempposy, Float:tempposz;
        GetPlayerPos(playerid, oldposx, oldposy, oldposz);
        tempposx = (oldposx -x);
        tempposy = (oldposy -y);
        tempposz = (oldposz -z);
        if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
        {

            return 1;
        }
    }
    return 0;
}
Reply


Messages In This Thread
portгo abre ao se aproximar - by yagomapper - 20.09.2013, 09:38
Re: portгo abre ao se aproximar - by PT - 20.09.2013, 11:21
Re: portгo abre ao se aproximar - by yagomapper - 20.09.2013, 11:37
Re: portгo abre ao se aproximar - by Chefгo - 20.09.2013, 11:38
Re: portгo abre ao se aproximar - by yagomapper - 20.09.2013, 11:42
Re: portгo abre ao se aproximar - by Chefгo - 20.09.2013, 11:46
Re: portгo abre ao se aproximar - by WLSF - 20.09.2013, 11:47
Re: portгo abre ao se aproximar - by Chefгo - 20.09.2013, 12:15
Re: portгo abre ao se aproximar - by yagomapper - 20.09.2013, 12:30

Forum Jump:


Users browsing this thread: 1 Guest(s)