[Ajuda] Verificar a posiзгo do jogador dentro de um timer
#1

Olб!

Como posso fazer para verificar a posiзгo de um jogador em um IF dentro de um timer ?

Preciso que, caso ele estiver nessa posiзгo:
pawn Код:
-2330.598876, -1731.923095, -2266.598876, -1659.923095
ele execute uma funзгo..

Jб tendei fazer isso usando PlayerInRangeOfPoint mas nгo deu certo.. :S
Reply
#2

Use IsPlayerInRangeOfPoint
Reply
#3

Amigo, jб tentei, nгo deu certo.

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(VotouCChilliad[i] == 1 && IsPlayerConnected(i))
        {
            if(IsPlayerInRangeOfPoint(i, 60.0, -2330.598876, -1731.923095, -2266.598876))
            {
            }
        }
Reply
#4

Quote:
Originally Posted by AiaN
Посмотреть сообщение
Amigo, jб tentei, nгo deu certo.

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(VotouCChilliad[i] == 1 && IsPlayerConnected(i))
        {
            if(IsPlayerInRangeOfPoint(i, 60.0, -2330.598876, -1731.923095, -2266.598876))
            {
            }
        }
@EDIT
fail... ja dou edit

@EDIT
Coloque isto dentro de uma Callback e use um timer para verificar se o player estб nesse local ou nao.
Reply
#5

E como vou usar ?

pawn Код:
if(GetPlayerPos(i, -2330.598876, -1731.923095, -2266.598876) == -2330.598876, -1731.923095, -2266.598876)
?? :S
Reply
#6

Quote:
Originally Posted by AiaN
Посмотреть сообщение
E como vou usar ?

pawn Код:
if(GetPlayerPos(i, -2330.598876, -1731.923095, -2266.598876) == -2330.598876, -1731.923095, -2266.598876)
?? :S
Dei edit, confundi :S
Reply
#7

Edit, ele jб estб dentro de um timer.. Estou com problemas para fazer essa verificaзгo
PHP код:
"se o jogador estiver na pos -2330.598876, -1731.923095, -2266.598876, -1659.923095 executar SendClientMessage(playerid, vermelho, "Esta na pos."); 
Entendeu ?
Reply
#8

Quote:
Originally Posted by AiaN
Посмотреть сообщение
Edit, ele jб estб dentro de um timer.. Estou com problemas para fazer essa verificaзгo
PHP код:
"se o jogador estiver na pos -2330.598876, -1731.923095, -2266.598876, -1659.923095 executar SendClientMessage(playerid, vermelho, "Esta na pos."); 
Entendeu ?
Entendi, mais tenho que saber como vocк estб utilizando o timer e a callback, ainda nгo entendi muito bem atй porque vocк colocou 4 coordenadas, seria uma GangZone ?

Ps:
Poste a callback e o local onde voce colou o timer
Reply
#9

Quando o administrador utiliza tal comando, o timer й criado, esse timer deve verificar de tempo em tempo a posiзгo do jogador, caso sejб a que eu postei ele executa tal funзгo.

Sim, utilizei um gang creator para pegar a posiзгo, ela seria a entrada para o "topo" do chilliad.
Reply
#10

Quote:
Originally Posted by AiaN
Посмотреть сообщение
Amigo, jб tentei, nгo deu certo.

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(VotouCChilliad[i] == 1 && IsPlayerConnected(i))
        {
            if(IsPlayerInRangeOfPoint(i, 60.0, -2330.598876, -1731.923095, -2266.598876))
            {
            }
        }
Pra que max_players se e so pra ferificar se o player ta na coord
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)