ajuda playertopoint
#2

Topo GM!
pawn Код:
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
pawn Код:
if(strcmp(cmd, "/trampar", true) == 0)
    {
        if(PlayerToPoint([COLOR="RoyalBlue"]10.0[/COLOR], [COLOR="Olive"]playerid[/COLOR],[COLOR="SandyBrown"]246.6891[/COLOR],[COLOR="YellowGreen"]66.9642[/COLOR],[COLOR="Purple"]1003.6406[/COLOR])
            {
            SendClientMessage(playerid, COR1, ("Vocк estб trampando");
            return 1;
           }
        }
10.0 - Raio
playerid - Funзгo que o player serб usado
246.6891 - X
66.9642 - Y
1003.6406 - Z

pawn Код:
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
ajuda playertopoint - by Guilherme15 - 31.12.2010, 18:43
Re: ajuda playertopoint - by Macintosh - 31.12.2010, 19:09
Re: ajuda playertopoint - by Guilherme15 - 31.12.2010, 19:37
Re: ajuda playertopoint - by Macintosh - 31.12.2010, 20:01
Re: ajuda playertopoint - by Guilherme15 - 31.12.2010, 20:25
Re: ajuda playertopoint - by Macintosh - 31.12.2010, 21:34
Re: ajuda playertopoint - by Guilherme15 - 31.12.2010, 22:34

Forum Jump:


Users browsing this thread: 1 Guest(s)