SA-MP Forums Archive
[Dъvida] Detectar se o jogador estб na "gangzone" - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Dъvida] Detectar se o jogador estб na "gangzone" (/showthread.php?tid=628928)



[Dъvida] Detectar se o jogador estб na "gangzone" - kadek - 17.02.2017

Entгo, criei a seguinte stock para detectar se o jogador estб na "gangzone":
Код:
stock JogadorNaSafeZone(playerid)
{
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid, x, y, z);
    if(x >= 1283.838 && y >= -2003.337 && x <= 1103.631 && y <= -2080.794) return 1;         .
    else return 0;
}
E meu OnPlayerStateChange, ficou da seguinte forma:
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(JogadorNaSafeZone(playerid))
    {
        //Comando
    }
    return 1;
}
Porйm na hora de compilar estou recebendo os seguintes erros:
Код:
(387) : error: 029: invalid expression, assumed zero
(387) : warning: 215: expression has no effect
(387) : error: 001: expected token: ";", but found "else"
(387) : error: 029: invalid expression, assumed zero
(387) : error fatal: 107: too many error messages on one line
E isso sу acontece se eu realmente colocar o comando em OnPlayerStateChange! Entгo veio a dъvida, й impossivel checar se o jogador estб na "gangzone" nessa public? Se nгo, como faзo? Tks


Re: [Dъvida] Detectar se o jogador estб na "gangzone" - PetrickSchoba - 17.02.2017

Quote:
Originally Posted by kadek
Посмотреть сообщение
Entгo, criei a seguinte stock para detectar se o jogador estб na "gangzone":
Код:
stock JogadorNaSafeZone(playerid)
{
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid, x, y, z);
    if(x >= 1283.838 && y >= -2003.337 && x <= 1103.631 && y <= -2080.794) return 1;         .
    else return 0;
}
E meu OnPlayerStateChange, ficou da seguinte forma:
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(JogadorNaSafeZone(playerid))
    {
        //Comando
    }
    return 1;
}
Porйm na hora de compilar estou recebendo os seguintes erros:
Код:
(387) : error: 029: invalid expression, assumed zero
(387) : warning: 215: expression has no effect
(387) : error: 001: expected token: ";", but found "else"
(387) : error: 029: invalid expression, assumed zero
(387) : error fatal: 107: too many error messages on one line
E isso sу acontece se eu realmente colocar o comando em OnPlayerStateChange! Entгo veio a dъvida, й impossivel checar se o jogador estб na "gangzone" nessa public? Se nгo, como faзo? Tks
Retira este return ai e coloca return true;, isso vai retornar a lugar comum e o else
pawn Код:
else return 0;



Re: [Dъvida] Detectar se o jogador estб na "gangzone" - johntrybescripter - 17.02.2017

mas o que tu quer fazer ?


Re: [Dъvida] Detectar se o jogador estб na "gangzone" - kadek - 21.02.2017

Quero que o player fique recebendo vida constantemente na бrea xD.
Deu certo, valeu!