[AJUDA] Onde estб o bug?
#1

pawn Код:
stock IsPlayerInRangeForMessage(playerid, color, const striyng[], Float: range)
{
    for(new x; x < MAX_PLAYERS; x++)
    {
        new Float: Poz[3];
        GetPlayerPos(playerid, Poz[0], Poz[1], Poz[2]);
        if(IsPlayerInRangeOfPoint(x, range, Poz[0], Poz[1], Poz[2]))
        {
            SendClientMessage(x, color, striyng);
            return true;
        }
    }
    return false;
}
pawn Код:
IsPlayerInRangeForMessage(playerid, COR_PURPLE, stringes, 10.0);
O bug й o seguinte, do nada apenas 1 player ve a mensagem, se tiver 3 pessoas apenas 1 vai ver a mensagem, onde ta o bug aew?

+rep
Reply
#2

pawn Код:
SendClientMessage(x, color, striyng);
Mude para:
pawn Код:
SendClientMessageToAll(x, color, striyng);
Reply
#3

pawn Код:
stock IsPlayerInRangeForMessage(playerid, color, const striyng[], Float: range)
{
    for(new x; x < MAX_PLAYERS; x++)
    {
        new Float: Poz[3];
        GetPlayerPos(playerid, Poz[0], Poz[1], Poz[2]);
        if(IsPlayerInRangeOfPoint(x, range, Poz[0], Poz[1], Poz[2]))
        {
            SendClientMessage(x, color, striyng);
        }
    }
    return false;
}
Retornando true no loop voce ira finalizalo... coloque assim e funcionara!
Reply
#4

pawn Код:
stock IsPlayerInRangeForMessage(playerid, color, const striyng[], Float: range)
{
    for(new x; x <= MAX_PLAYERS; x++)
    {
        new Float: Poz[3];
        GetPlayerPos(x, Poz[0], Poz[1], Poz[2]);
        if(IsPlayerInRangeOfPoint(x, range, Poz[0], Poz[1], Poz[2]))
        {
            SendClientMessage(x, color, striyng);
        }
    }
    return false;
}
ve se isso resolve, mas nгo entendi como vocк quer que 3 pessoas entrem num mesmo lugar, e pegue apenas 1 cordenada de uma delas, para isso vocк deveria usar um ramdom..
Reply
#5

Varios postaram@EDIT ¬¬
Reply
#6

do Hiuship funciono obrigado geral ai +rep
Reply
#7

pawn Код:
stock IsPlayerInRangeForMessage(playerid, color, const striyng[], Float: range)
{
    for(new x; x < MAX_PLAYERS; x++)
    {
        new Float: Poz[3];
        GetPlayerPos(playerid, Poz[0], Poz[1], Poz[2]);
        if(IsPlayerInRangeOfPoint(x, range, Poz[0], Poz[1], Poz[2]))
        {
            SendClientMessage(x, color, striyng);
        }
    }
    return false;
}
Sу tirar o return PQP --'
Reply
#8

Quote:
Originally Posted by sanalex
Посмотреть сообщение
pawn Код:
SendClientMessage(x, color, striyng);
Mude para:
pawn Код:
SendClientMessageToAll(x, color, striyng);
LoL, de onde surgiu isso ae ?
Reply
#9

Quote:
Originally Posted by CidadeNovaRP
Посмотреть сообщение
pawn Код:
SendClientMessage(x, color, striyng);
Quote:
Originally Posted by paulor
Посмотреть сообщение
LoL, de onde surgiu isso ae ?
eu tambйm to me perguntando, como o cara conseguiu fazer isso..
Reply
#10

Quote:
Originally Posted by sanalex
Посмотреть сообщение
pawn Код:
SendClientMessage(x, color, striyng);
Mude para:
pawn Код:
SendClientMessageToAll(x, color, striyng);
Sanalex... entenda... o codigo que ele enviou justamente й para nгo usar isso.... ele quer que apenas quem tiver perto leia oque escreveu.. nгo mandar para todos a mensagem!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)