Portal SAMP
[Ajuda] Como detectar se o player se moveu - Versão de Impressão

+- Portal SAMP (https://portalsamp.com)
+-- Fórum: SA-MP (https://portalsamp.com/forumdisplay.php?fid=5)
+--- Fórum: Área de suporte (https://portalsamp.com/forumdisplay.php?fid=6)
+--- Tópico: [Ajuda] Como detectar se o player se moveu (/showthread.php?tid=1582)

Páginas: 1 2 3


RE: Como detectar se o player se moveu - lilpretovisk - 31/08/2021

(31/08/2021 09:05)Lightz/Conta nova Escreveu:
(31/08/2021 01:34)lilpretovisk Escreveu:
(31/08/2021 01:21)xbruno1000x Escreveu: O que aconteceu é que eu fiz o código enquanto estava em aula e não prestei atenção a todos os detalhes kkkkkkkkkkkkk

Código:
if(!IsPlayerInRangeOfPoint(playerid, 1.0, X, Y, Z))

Eu errei o operador da if, o código seria lido em caso do jogador estar dentro da posição do spawn, quando na verdade precisamos que o código seja lido quando ele não estiver. Basta mudar o operador como fiz acima e tudo funcionará corretamente.

o problema agora que menos parado esta contabilizando que se mexeu, tentei mudar os valores das coordenadas e nao resolveu

Irei mandar uma base ai você tenta adaptar, se não conseguir fala ai que nois da um jeito

Código PHP:
new Float:AFKPos[MAX_PLAYERS][6];

OnPlayerConnect(playerid)
{
    SetTimerEx("VerificarAFK"10*60*10001"i"playerid); 
    return 1;
}

forward VerificarAfk(playerid);
public 
VerificarAfk(playerid)
{
   GetPlayerPos(playeridAFKPos[playerid][0], AFKPos[playerid][1], AFKPos[playerid][2]);
   if(AFKPos[playerid][0] == AFKPos[playerid][3] && AFKPos[playerid][1] == AFKPos[playerid][4] && AFKPos[playerid][2] ==        AFKPos[playerid][5])
 {
     new PlayerName[MAX_PLAYER_NAME];
     new String[100];
     GetPlayerName(playeridPlayerNamesizeof(PlayerName));
     format(Stringsizeof(String), "%s Ficou Ausente Automaticamente."PlayerName);
     SendClientMessageToAll(-1String);
     //Preguiça de colocar funções do comando afk
     AFKPos[playerid][3] = AFKPos[playerid][0];
     AFKPos[playerid][4] = AFKPos[playerid][1];
     AFKPos[playerid][5] = AFKPos[playerid][2];
     return 1;

nao entendi muito bem, ficar afk ou se mover nao seria um coordenadas diferentes? ou em si esse script puxa qualquer coordenada?


RE: Como detectar se o player se moveu - Lightz/Conta nova - 31/08/2021

(31/08/2021 09:09)lilpretovisk Escreveu:
(31/08/2021 09:05)Lightz/Conta nova Escreveu:
(31/08/2021 01:34)lilpretovisk Escreveu:
(31/08/2021 01:21)xbruno1000x Escreveu: O que aconteceu é que eu fiz o código enquanto estava em aula e não prestei atenção a todos os detalhes kkkkkkkkkkkkk

Código:
if(!IsPlayerInRangeOfPoint(playerid, 1.0, X, Y, Z))

Eu errei o operador da if, o código seria lido em caso do jogador estar dentro da posição do spawn, quando na verdade precisamos que o código seja lido quando ele não estiver. Basta mudar o operador como fiz acima e tudo funcionará corretamente.

o problema agora que menos parado esta contabilizando que se mexeu, tentei mudar os valores das coordenadas e nao resolveu

Irei mandar uma base ai você tenta adaptar, se não conseguir fala ai que nois da um jeito

Código PHP:
new Float:AFKPos[MAX_PLAYERS][6];

OnPlayerConnect(playerid)
{
    SetTimerEx("VerificarAFK"10*60*10001"i"playerid); 
    return 1;
}

forward VerificarAfk(playerid);
public 
VerificarAfk(playerid)
{
   GetPlayerPos(playeridAFKPos[playerid][0], AFKPos[playerid][1], AFKPos[playerid][2]);
   if(AFKPos[playerid][0] == AFKPos[playerid][3] && AFKPos[playerid][1] == AFKPos[playerid][4] && AFKPos[playerid][2] ==        AFKPos[playerid][5])
 {
     new PlayerName[MAX_PLAYER_NAME];
     new String[100];
     GetPlayerName(playeridPlayerNamesizeof(PlayerName));
     format(Stringsizeof(String), "%s Ficou Ausente Automaticamente."PlayerName);
     SendClientMessageToAll(-1String);
     //Preguiça de colocar funções do comando afk
     AFKPos[playerid][3] = AFKPos[playerid][0];
     AFKPos[playerid][4] = AFKPos[playerid][1];
     AFKPos[playerid][5] = AFKPos[playerid][2];
     return 1;

nao entendi muito bem, ficar afk ou se mover nao seria um coordenadas diferentes? ou em si esse script puxa qualquer coordenada?

Quase isso, mandei para você entender como funciona, nesse sistema ele pega as coordenadas do jogador, e se ele ficar nela por 10 minutos ele fica ausente automaticamente.


RE: Como detectar se o player se moveu - lilpretovisk - 31/08/2021

(31/08/2021 09:18)Lightz/Conta nova Escreveu:
(31/08/2021 09:09)lilpretovisk Escreveu:
(31/08/2021 09:05)Lightz/Conta nova Escreveu:
(31/08/2021 01:34)lilpretovisk Escreveu:
(31/08/2021 01:21)xbruno1000x Escreveu: O que aconteceu é que eu fiz o código enquanto estava em aula e não prestei atenção a todos os detalhes kkkkkkkkkkkkk

Código:
if(!IsPlayerInRangeOfPoint(playerid, 1.0, X, Y, Z))

Eu errei o operador da if, o código seria lido em caso do jogador estar dentro da posição do spawn, quando na verdade precisamos que o código seja lido quando ele não estiver. Basta mudar o operador como fiz acima e tudo funcionará corretamente.

o problema agora que menos parado esta contabilizando que se mexeu, tentei mudar os valores das coordenadas e nao resolveu

Irei mandar uma base ai você tenta adaptar, se não conseguir fala ai que nois da um jeito

Código PHP:
new Float:AFKPos[MAX_PLAYERS][6];

OnPlayerConnect(playerid)
{
    SetTimerEx("VerificarAFK"10*60*10001"i"playerid); 
    return 1;
}

forward VerificarAfk(playerid);
public 
VerificarAfk(playerid)
{
   GetPlayerPos(playeridAFKPos[playerid][0], AFKPos[playerid][1], AFKPos[playerid][2]);
   if(AFKPos[playerid][0] == AFKPos[playerid][3] && AFKPos[playerid][1] == AFKPos[playerid][4] && AFKPos[playerid][2] ==        AFKPos[playerid][5])
 {
     new PlayerName[MAX_PLAYER_NAME];
     new String[100];
     GetPlayerName(playeridPlayerNamesizeof(PlayerName));
     format(Stringsizeof(String), "%s Ficou Ausente Automaticamente."PlayerName);
     SendClientMessageToAll(-1String);
     //Preguiça de colocar funções do comando afk
     AFKPos[playerid][3] = AFKPos[playerid][0];
     AFKPos[playerid][4] = AFKPos[playerid][1];
     AFKPos[playerid][5] = AFKPos[playerid][2];
     return 1;

nao entendi muito bem, ficar afk ou se mover nao seria um coordenadas diferentes? ou em si esse script puxa qualquer coordenada?

Quase isso, mandei para você entender como funciona, nesse sistema ele pega as coordenadas do jogador, e se ele ficar nela por 10 minutos ele fica ausente automaticamente.
infelizmente nao faco ideia do que to fazendo =( tentei de algumas maneiras, a ultima foi essa, provavelmente ta tudo errado, mas to tentando:

Código:
#include <a_samp>
#define FILTERSCRIPT
#include Pawn.CMD

COMMAND:kill(playerid){

SetPlayerHealth(playerid, 0.0);
return 1;
}

new Float:AFKPos[MAX_PLAYERS][6];
new TimerSpawnKill[MAX_PLAYERS];

public OnPlayerSpawn(playerid)
{
    SetPlayerHealth(playerid, 999999);
    SendClientMessage(playerid, -1, "Você está protegido contra Spawn Kill até se mover.");
    GetPlayerPos(playerid, AFKPos[playerid][0], AFKPos[playerid][1], AFKPos[playerid][2]);{
     AFKPos[playerid][3] = AFKPos[playerid][0];
     AFKPos[playerid][4] = AFKPos[playerid][1];
     AFKPos[playerid][5] = AFKPos[playerid][2];
    SetTimerEx("EndAntiSpawnKill", 1*1*1000, 1, "i", playerid);
    }
    return 1;
}

forward EndAntiSpawnKill(playerid, X, Y, Z);
public EndAntiSpawnKill(playerid, X, Y, Z)
{
           if(AFKPos[playerid][0] == AFKPos[playerid][1] && AFKPos[playerid][2])    {
        SendClientMessage(playerid, -1, "Você não está mais protegido contra Spawn Kill");
        SetPlayerHealth(playerid, 100);
        KillTimer(TimerSpawnKill[playerid]);
    }
        return 1;
}



RE: Como detectar se o player se moveu - Lightz/Conta nova - 31/08/2021

(31/08/2021 09:39)lilpretovisk Escreveu:
(31/08/2021 09:18)Lightz/Conta nova Escreveu:
(31/08/2021 09:09)lilpretovisk Escreveu:
(31/08/2021 09:05)Lightz/Conta nova Escreveu:
(31/08/2021 01:34)lilpretovisk Escreveu: o problema agora que menos parado esta contabilizando que se mexeu, tentei mudar os valores das coordenadas e nao resolveu

Irei mandar uma base ai você tenta adaptar, se não conseguir fala ai que nois da um jeito

Código PHP:
new Float:AFKPos[MAX_PLAYERS][6];

OnPlayerConnect(playerid)
{
    SetTimerEx("VerificarAFK"10*60*10001"i"playerid); 
    return 1;
}

forward VerificarAfk(playerid);
public 
VerificarAfk(playerid)
{
   GetPlayerPos(playeridAFKPos[playerid][0], AFKPos[playerid][1], AFKPos[playerid][2]);
   if(AFKPos[playerid][0] == AFKPos[playerid][3] && AFKPos[playerid][1] == AFKPos[playerid][4] && AFKPos[playerid][2] ==        AFKPos[playerid][5])
 {
     new PlayerName[MAX_PLAYER_NAME];
     new String[100];
     GetPlayerName(playeridPlayerNamesizeof(PlayerName));
     format(Stringsizeof(String), "%s Ficou Ausente Automaticamente."PlayerName);
     SendClientMessageToAll(-1String);
     //Preguiça de colocar funções do comando afk
     AFKPos[playerid][3] = AFKPos[playerid][0];
     AFKPos[playerid][4] = AFKPos[playerid][1];
     AFKPos[playerid][5] = AFKPos[playerid][2];
     return 1;

nao entendi muito bem, ficar afk ou se mover nao seria um coordenadas diferentes? ou em si esse script puxa qualquer coordenada?

Quase isso, mandei para você entender como funciona, nesse sistema ele pega as coordenadas do jogador, e se ele ficar nela por 10 minutos ele fica ausente automaticamente.
infelizmente nao faco ideia do que to fazendo =( tentei de algumas maneiras, a ultima foi essa, provavelmente ta tudo errado, mas to tentando:

Código:
#include <a_samp>
#define FILTERSCRIPT
#include Pawn.CMD

COMMAND:kill(playerid){

SetPlayerHealth(playerid, 0.0);
return 1;
}

new Float:AFKPos[MAX_PLAYERS][6];
new TimerSpawnKill[MAX_PLAYERS];

public OnPlayerSpawn(playerid)
{
    SetPlayerHealth(playerid, 999999);
    SendClientMessage(playerid, -1, "Você está protegido contra Spawn Kill até se mover.");
    GetPlayerPos(playerid, AFKPos[playerid][0], AFKPos[playerid][1], AFKPos[playerid][2]);{
     AFKPos[playerid][3] = AFKPos[playerid][0];
     AFKPos[playerid][4] = AFKPos[playerid][1];
     AFKPos[playerid][5] = AFKPos[playerid][2];
    SetTimerEx("EndAntiSpawnKill", 1*1*1000, 1, "i", playerid);
    }
    return 1;
}

forward EndAntiSpawnKill(playerid, X, Y, Z);
public EndAntiSpawnKill(playerid, X, Y, Z)
{
           if(AFKPos[playerid][0] == AFKPos[playerid][1] && AFKPos[playerid][2])    {
        SendClientMessage(playerid, -1, "Você não está mais protegido contra Spawn Kill");
        SetPlayerHealth(playerid, 100);
        KillTimer(TimerSpawnKill[playerid]);
    }
        return 1;
}

Maninh esse código não tá certo, nas funções do Spawn Kill tu coloca na minha base AFK entendeu ai tipo muda o SetTimerEx OnPlayerConnect pra OnPlayerSpawn ai se tenta colocar um else pra se ele sair o timer para

EDIT: vo tentar fazer aqui

Esse timer tá muito curto o tempo, ai o Anti Spawn Kill acaba rápido, faz o seguinte ai lilpreto apaga todos esses, se eu conseguir fazer certo mando aqui.


RE: Como detectar se o player se moveu - lilpretovisk - 31/08/2021

(31/08/2021 09:43)Lightz/Conta nova Escreveu:
(31/08/2021 09:39)lilpretovisk Escreveu:
(31/08/2021 09:18)Lightz/Conta nova Escreveu:
(31/08/2021 09:09)lilpretovisk Escreveu:
(31/08/2021 09:05)Lightz/Conta nova Escreveu: Irei mandar uma base ai você tenta adaptar, se não conseguir fala ai que nois da um jeito

Código PHP:
new Float:AFKPos[MAX_PLAYERS][6];

OnPlayerConnect(playerid)
{
    SetTimerEx("VerificarAFK"10*60*10001"i"playerid); 
    return 1;
}

forward VerificarAfk(playerid);
public 
VerificarAfk(playerid)
{
   GetPlayerPos(playeridAFKPos[playerid][0], AFKPos[playerid][1], AFKPos[playerid][2]);
   if(AFKPos[playerid][0] == AFKPos[playerid][3] && AFKPos[playerid][1] == AFKPos[playerid][4] && AFKPos[playerid][2] ==        AFKPos[playerid][5])
 {
     new PlayerName[MAX_PLAYER_NAME];
     new String[100];
     GetPlayerName(playeridPlayerNamesizeof(PlayerName));
     format(Stringsizeof(String), "%s Ficou Ausente Automaticamente."PlayerName);
     SendClientMessageToAll(-1String);
     //Preguiça de colocar funções do comando afk
     AFKPos[playerid][3] = AFKPos[playerid][0];
     AFKPos[playerid][4] = AFKPos[playerid][1];
     AFKPos[playerid][5] = AFKPos[playerid][2];
     return 1;

nao entendi muito bem, ficar afk ou se mover nao seria um coordenadas diferentes? ou em si esse script puxa qualquer coordenada?

Quase isso, mandei para você entender como funciona, nesse sistema ele pega as coordenadas do jogador, e se ele ficar nela por 10 minutos ele fica ausente automaticamente.
infelizmente nao faco ideia do que to fazendo =( tentei de algumas maneiras, a ultima foi essa, provavelmente ta tudo errado, mas to tentando:

Código:
#include <a_samp>
#define FILTERSCRIPT
#include Pawn.CMD

COMMAND:kill(playerid){

SetPlayerHealth(playerid, 0.0);
return 1;
}

new Float:AFKPos[MAX_PLAYERS][6];
new TimerSpawnKill[MAX_PLAYERS];

public OnPlayerSpawn(playerid)
{
    SetPlayerHealth(playerid, 999999);
    SendClientMessage(playerid, -1, "Você está protegido contra Spawn Kill até se mover.");
    GetPlayerPos(playerid, AFKPos[playerid][0], AFKPos[playerid][1], AFKPos[playerid][2]);{
     AFKPos[playerid][3] = AFKPos[playerid][0];
     AFKPos[playerid][4] = AFKPos[playerid][1];
     AFKPos[playerid][5] = AFKPos[playerid][2];
    SetTimerEx("EndAntiSpawnKill", 1*1*1000, 1, "i", playerid);
    }
    return 1;
}

forward EndAntiSpawnKill(playerid, X, Y, Z);
public EndAntiSpawnKill(playerid, X, Y, Z)
{
           if(AFKPos[playerid][0] == AFKPos[playerid][1] && AFKPos[playerid][2])    {
        SendClientMessage(playerid, -1, "Você não está mais protegido contra Spawn Kill");
        SetPlayerHealth(playerid, 100);
        KillTimer(TimerSpawnKill[playerid]);
    }
        return 1;
}

Maninh esse código não tá certo, nas funções do Spawn Kill tu coloca na minha base AFK entendeu ai tipo muda o SetTimerEx OnPlayerConnect pra OnPlayerSpawn ai se tenta colocar um else pra se ele sair o timer para

EDIT: vo tentar fazer aqui

Esse timer tá muito curto o tempo, ai o Anti Spawn Kill acaba rápido, faz o seguinte ai lilpreto apaga todos esses, se eu conseguir fazer certo mando aqui.

certo mano agradeco mt


RE: Como detectar se o player se moveu - Lightz/Conta nova - 31/08/2021

(31/08/2021 09:57)lilpretovisk Escreveu:
(31/08/2021 09:43)Lightz/Conta nova Escreveu:
(31/08/2021 09:39)lilpretovisk Escreveu:
(31/08/2021 09:18)Lightz/Conta nova Escreveu:
(31/08/2021 09:09)lilpretovisk Escreveu: nao entendi muito bem, ficar afk ou se mover nao seria um coordenadas diferentes? ou em si esse script puxa qualquer coordenada?

Quase isso, mandei para você entender como funciona, nesse sistema ele pega as coordenadas do jogador, e se ele ficar nela por 10 minutos ele fica ausente automaticamente.
infelizmente nao faco ideia do que to fazendo =( tentei de algumas maneiras, a ultima foi essa, provavelmente ta tudo errado, mas to tentando:

Código:
#include <a_samp>
#define FILTERSCRIPT
#include Pawn.CMD

COMMAND:kill(playerid){

SetPlayerHealth(playerid, 0.0);
return 1;
}

new Float:AFKPos[MAX_PLAYERS][6];
new TimerSpawnKill[MAX_PLAYERS];

public OnPlayerSpawn(playerid)
{
    SetPlayerHealth(playerid, 999999);
    SendClientMessage(playerid, -1, "Você está protegido contra Spawn Kill até se mover.");
    GetPlayerPos(playerid, AFKPos[playerid][0], AFKPos[playerid][1], AFKPos[playerid][2]);{
     AFKPos[playerid][3] = AFKPos[playerid][0];
     AFKPos[playerid][4] = AFKPos[playerid][1];
     AFKPos[playerid][5] = AFKPos[playerid][2];
    SetTimerEx("EndAntiSpawnKill", 1*1*1000, 1, "i", playerid);
    }
    return 1;
}

forward EndAntiSpawnKill(playerid, X, Y, Z);
public EndAntiSpawnKill(playerid, X, Y, Z)
{
           if(AFKPos[playerid][0] == AFKPos[playerid][1] && AFKPos[playerid][2])    {
        SendClientMessage(playerid, -1, "Você não está mais protegido contra Spawn Kill");
        SetPlayerHealth(playerid, 100);
        KillTimer(TimerSpawnKill[playerid]);
    }
        return 1;
}

Maninh esse código não tá certo, nas funções do Spawn Kill tu coloca na minha base AFK entendeu ai tipo muda o SetTimerEx OnPlayerConnect pra OnPlayerSpawn ai se tenta colocar um else pra se ele sair o timer para

EDIT: vo tentar fazer aqui

Esse timer tá muito curto o tempo, ai o Anti Spawn Kill acaba rápido, faz o seguinte ai lilpreto apaga todos esses, se eu conseguir fazer certo mando aqui.

certo mano agradeco mt

Cara não sei porque não ta indo, essa é a função certa, vo dar umas pesquisada ai qualquer coisa se conseguir te mando :/


RE: Como detectar se o player se moveu - xbruno1000x - 31/08/2021

(31/08/2021 01:34)lilpretovisk Escreveu:
(31/08/2021 01:21)xbruno1000x Escreveu: O que aconteceu é que eu fiz o código enquanto estava em aula e não prestei atenção a todos os detalhes kkkkkkkkkkkkk

Código:
if(!IsPlayerInRangeOfPoint(playerid, 1.0, X, Y, Z))

Eu errei o operador da if, o código seria lido em caso do jogador estar dentro da posição do spawn, quando na verdade precisamos que o código seja lido quando ele não estiver. Basta mudar o operador como fiz acima e tudo funcionará corretamente.

o problema agora que menos parado esta contabilizando que se mexeu, tentei mudar os valores das coordenadas e nao resolveu

Tentou alterar o range? tente colocar em 2.0 ou 3.0. Você também pode pegar as coordenadas do spawn e inserir diretamente no código ao invés das variáveis. Pode ser que o código não esteja pegando a coordenada certa de spawn.


RE: Como detectar se o player se moveu - Um cara ai - 31/08/2021

Na verdade... Basta verificar se alguma das keys (KEY_UP / KEY_DOWN / KEY_RIGHT / KEY_LEFT) foi pressionada, seja usando GetPlayerKeys ou OnPlayerChangeKeyState


RE: Como detectar se o player se moveu - Lightz/Conta nova - 31/08/2021

(31/08/2021 17:21)Um cara ai Escreveu: Na verdade... Basta verificar se alguma das keys (KEY_UP / KEY_DOWN / KEY_RIGHT / KEY_LEFT) foi pressionada, seja usando GetPlayerKeys ou OnPlayerChangeKeyState

Ahh! kkkkkk lembrei kkkk, vo fazer e mandar pra ele aqui

(31/08/2021 17:53)Lightz/Conta nova Escreveu:
(31/08/2021 17:21)Um cara ai Escreveu: Na verdade... Basta verificar se alguma das keys (KEY_UP / KEY_DOWN / KEY_RIGHT / KEY_LEFT) foi pressionada, seja usando GetPlayerKeys ou OnPlayerChangeKeyState

Ahh! kkkkkk lembrei kkkk, vo fazer e mandar pra ele aqui

Ai meu mano LilPreto tá funcionando de boa agora:

EDIT: Agora sim comando tá funcionando 100%.

Código PHP:
new Float:PosSpawn[MAX_PLAYERS][3];
new 
boolTimerSpawnKill;
new 
SpawnKillTimer[MAX_PLAYERS];

public 
OnPlayerSpawn(playerid)
{
    SetPlayerHealth(playerid999999);
    SendClientMessage(playerid, -1"Você está protegido contra Spawn Kill até se mover.");
    GetPlayerPos(playeridPosSpawn[playerid][0], PosSpawn[playerid][1], PosSpawn[playerid][2]);
    SpawnKillTimer[playerid] = SetTimerEx("EndAntiSpawnKill"8000true"iiii"playeridPosSpawn[playerid][0], PosSpawn[playerid][1], PosSpawn[playerid][2]);
    TimerSpawnKill true;
    return 
1;
}

public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if (newkeys == KEY_UP)
    {
    
    if(TimerSpawnKill == true)
    
    {
        
    SetPlayerHealth(playerid100);
        
    SendClientMessage(playerid, -1"Você se movimentou e o Spawn Kill acabou.");
        
    KillTimer(SpawnKillTimer[playerid]);
                    
TimerSpawnKill false;
        }
    }
    return 
1;
}

forward EndAntiSpawnKill(playeridXYZ);
public 
EndAntiSpawnKill(playeridXYZ)
{
    SetPlayerHealth(playerid100);
    SendClientMessage(playerid, -1"Você não está mais protegido contra Spawn Kill");
    KillTimer(SpawnKillTimer[playerid]);
    return 1;




RE: Como detectar se o player se moveu - xbruno1000x - 01/09/2021

(31/08/2021 17:53)Lightz/Conta nova Escreveu:
(31/08/2021 17:21)Um cara ai Escreveu: Na verdade... Basta verificar se alguma das keys (KEY_UP / KEY_DOWN / KEY_RIGHT / KEY_LEFT) foi pressionada, seja usando GetPlayerKeys ou OnPlayerChangeKeyState

Ahh! kkkkkk lembrei kkkk, vo fazer e mandar pra ele aqui

(31/08/2021 17:53)Lightz/Conta nova Escreveu:
(31/08/2021 17:21)Um cara ai Escreveu: Na verdade... Basta verificar se alguma das keys (KEY_UP / KEY_DOWN / KEY_RIGHT / KEY_LEFT) foi pressionada, seja usando GetPlayerKeys ou OnPlayerChangeKeyState

Ahh! kkkkkk lembrei kkkk, vo fazer e mandar pra ele aqui

Ai meu mano LilPreto tá funcionando de boa agora:

EDIT: Agora sim comando tá funcionando 100%.

Código PHP:
new Float:PosSpawn[MAX_PLAYERS][3];
new 
boolTimerSpawnKill;
new 
SpawnKillTimer[MAX_PLAYERS];

public 
OnPlayerSpawn(playerid)
{
    SetPlayerHealth(playerid999999);
    SendClientMessage(playerid, -1"Você está protegido contra Spawn Kill até se mover.");
    GetPlayerPos(playeridPosSpawn[playerid][0], PosSpawn[playerid][1], PosSpawn[playerid][2]);
    SpawnKillTimer[playerid] = SetTimerEx("EndAntiSpawnKill"8000true"iiii"playeridPosSpawn[playerid][0], PosSpawn[playerid][1], PosSpawn[playerid][2]);
    TimerSpawnKill true;
    return 
1;
}

public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if (newkeys == KEY_JUMP)
    {
    
    if(TimerSpawnKill == true)
    
    {
        
    SetPlayerHealth(playerid100);
        
    SendClientMessage(playerid, -1"Você se movimentou e o Spawn Kill acabou.");
        
    KillTimer(SpawnKillTimer[playerid]);
        }
    }
    return 
1;
}

forward EndAntiSpawnKill(playeridXYZ);
public 
EndAntiSpawnKill(playeridXYZ)
{
    SetPlayerHealth(playerid100);
    SendClientMessage(playerid, -1"Você não está mais protegido contra Spawn Kill");
    KillTimer(SpawnKillTimer[playerid]);
    return 1;


esse código vai parar em 8 segundos, não ao mover-se. Além disso, a tecla KEY_JUMP é o shift, e sendo assim o spawn protect irá ser encerrada somente ao pular.