Player to point?
#5

tenta este

pawn Код:
#include <a_samp>
#include <core>
#include <float>
#include <a_objects>
#include <a_samp>
#include <float>


//----------colors-----------

#define COLOR_GREY 0xAFAFAFAA
#define COLOR_PURPLE 0xC2A2DAAA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_DBLUE 0x2641FEAA
#define COLOR_BLUE 0x33AAFFFF
#define COLOR_GREEN 0x33AA33AA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_PINK 0xFF69B4FF
#define COLOR_BGREEN 0x08FD04FF
#define COLOR_CYAN 0x00FFFFAA
#define COLOR_RED 0xFF3366FF
#define COLOR_YELLOW 0xFFCC33FF
#define COLOR_DGREEN 0x008000FF
#define COLOR_DRED 0x800000FF
#define COLOR_DARK 0x000000FF
#define TEAM_GREEN_COLOR 0x33AA33AA
#define TEAM_BLUE_COLOR 0x3333AAAA
#define COLOR_GRAD2 0xBFC0C2FF
#define SOUND_MUSIC1                1076
#define SOUND_OFF                   1184
#define COLOR_CONTRABANDISTA  0x6A95AEAA

forward PlayerToPoint(Float:radi, playerid, Float:xx, Float:yy, Float:zz);

new p1;

main()
{
    print("\n----------------------------------");
    print("-GGGGGGGGG:)\n");
    print("----------------------------------\n");
    return 0;
}

public OnGameModeInit()
{
    CreateObject(8841, -2684.6569824219, 1341.9689941406, 19.32400894165, 0, 0, 0);
    CreateObject(8040, -2743.4951171875, 1330.271484375, 16.759454727173, 0, 0, 0);
    CreateObject(8947, -2770.6166992188, 1320.0007324219, 19.419242858887, 0, 0, 89.324493408203);
    p1 = CreateObject(18483, -2624.9851074219, 1350.7390136719,9.8020057678223,0,10.410003662109,0);
    AddStaticPickup(1318,1,-3121.2126,1127.3942,20.9771); //enter hq
    return 1;
}


public OnPlayerConnect(playerid)
{
    GameTextForPlayer(playerid,"~w~RPG: ~r~GRUPO [REAL]!",5000,5);
  PlayerPlaySound(playerid,1185,2050.1995, 1344.5500, 13.2378);//Music Off
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    ApplyAnimation(playerid,"COP_AMBIENT", "Coplook_loop", 4.0, 1, 0, 0, 0, 0);
    PlayerPlaySound(playerid,1185,2050.1995, 1344.5500, 13.2378);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    SendClientMessage(playerid,0x800000FF,"Para ver o seu nivel use /vernivel para ajuda nos niveis use /niveis!");
    SendClientMessage(playerid,0xAFAFAFAA,"NOTA: Ganha niveis a cada requesito de nivel pedido aliado as horas de jogo!");
    PlayerPlaySound(playerid,1186,2050.1995, 1344.5500, 13.2378);
    return 1;
}


public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp(cmdtext, "/apark", true) ==0)
    {
        MoveObject(p1,-2624.9851074219, 1350.7390136719,9.8020057678223,1); //CORDENADAS DELE ABERTO
        return 1;
    }
    if (strcmp(cmdtext, "/fpark", true) ==0)
    {
        MoveObject(p1,-2625.7277832031, 1350.6324462891, 5.3520057678223,1); //CORDENADAS DELE FECHADO
        return 1;
    }
    if (strcmp(cmdtext, "/entrarcasa", true)==0)
    {
        SetPlayerInterior(playerid,2);
        SetPlayerPos(playerid,1523.509887,-47.821197,1002.130981);
        return SendClientMessage(playerid,0xFFFFFFAA,"Vc entrou na casa do player Gulono_Camilo, Bem Vindo!");
    }
    if(strcmp(cmdtext,"/Saircasa",true)==0)
    {
        SetPlayerInterior(playerid,0);
        SetPlayerPos(playerid,-3121.2126,1127.3942,20.9771);
        return SendClientMessage(playerid,0xFFFFFFAA,"Vc saiu da casa de Gulono_Camilo!");
    }
    if (strcmp(cmdtext, "/ENTRARSHOP", true)==0)
    {
        if(PlayerToPoint(1, playerid, 746.2035,-2570.2080,10.0439))
        {
            SetPlayerInterior(playerid,10);
            SetPlayerPos(playerid,6.091180,-29.271898,1003.549988);
            return SendClientMessage(playerid,0xFFFFFFAA,"VC entrou no shop, compre algo e Boas Compras ;)!");
        }
        return 1;
    }
    if(strcmp(cmdtext,"/SAIRSHOP",true)==0)
    {
        if(PlayerToPoint(1.0,playerid,6.0007,-31.2342,1003.5494))
        {
            SetPlayerInterior(playerid,0);
            SetPlayerPos(playerid,741.4668,-2570.1621,9.8830);
            return SendClientMessage(playerid,0xFFFFFFAA,"Vc saiu do shop!");
        }
        return 1;
    }
    return 0;
}
public PlayerToPoint(Float:radi, playerid, Float:xx, Float:yy, Float:zz)
{
    if(IsPlayerConnected(playerid))
    {
        new Float:oldposx, Float:oldposy, Float:oldposz;
        new Float:tempposx, Float:tempposy, Float:tempposz;
        GetPlayerPos(playerid, oldposx, oldposy, oldposz);
        tempposx = (oldposx -xx);
        tempposy = (oldposy -yy);
        tempposz = (oldposz -zz);
        if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
        {
            return 1;
        }
    }
    return 0;
}
Reply


Messages In This Thread
Player to point? - by _COTTA_ - 09.03.2010, 15:35
Re: Player to point? - by SlashPT - 09.03.2010, 15:59
Re: Player to point? - by _COTTA_ - 09.03.2010, 16:10
Re: Player to point? - by _COTTA_ - 09.03.2010, 16:13
Re: Player to point? - by SlashPT - 09.03.2010, 16:26
Re: Player to point? - by _COTTA_ - 10.03.2010, 13:11

Forum Jump:


Users browsing this thread: 1 Guest(s)