[Ajuda] Problemas com Criaзгo de Portгo Automatico
#1

Eu uso este cуdigo:

Код:
     new PortaoCativeiro;
    forward ClosePortaoCativeiro(playerid);

    public OnGameModeInit()
    {
        PortaoCativeiro = CreateObject(980, 988.29998779297, -2129.1000976563, 14.89999961853, 0, 0, 0);
        return 1;
    }

    public OnPlayerCommandText(playerid, cmdtext[])
    {
        if (strcmp("/portaocativeiro", cmdtext, true, 10) == 0)
        {
            if(IsPlayerInRangeOfPoint(playerid,7.0, 1, 2, 3))
            {
            SendClientMessage(playerid, -1, "Portao do Cativeiro Aberto!");
            MoveObject(PortaoCativeiro, 999.5, -2129.6999511719, 14.89999961853, 2.0);
            SetTimer("ClosePortaoCativeiro", 5000, false);
            }
            return 1;
        }
        return 0;
    }

    public ClosePortaoCativeiro(playerid)
    {
        MoveObject(PortaoCativeiro, 988.29998779297, -2129.1000976563, 14.89999961853, 2.0);
        return 1;
    }

    public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
    {
        if ((newkeys==KEY_JUMP))
        {
            OnPlayerCommandText(playerid,"/portaocativeiro");
        }
        return 1;
    }
Ele compila certinho. Porйm, o portгo nгo abre!
Ele simplesmente nгo funciona!

O que hб de errado?
Reply
#2

Coloque as cordenadas em
pawn Код:
if(IsPlayerInRangeOfPoint(playerid,7.0, 1, 2, 3))
Reply
#3

IsPlayerInRangeOfPoint(playerid, Float:range, Float, Float:y, Float:z);

Comece a ver os tutoriais da https://sampwiki.blast.hk/
Reply
#4

Foi apenas eu remover a parte do 7.0, 1, 2, 3 que o comando funcionou!
Obrigado por me mostrarem o problema!

+Rep pros dois!
Reply
#5

Me ajudem nesse portao pf...o q ha de errado? ele abri da um giro, em vez de abrir p eskerda ele vira p frente 1є depois vai p eskerda e quando fecha ele vem reto na direзгo contraria
pawn Код:
Portaoskull = CreateObject(980, 2445.50000000, -1658.90002441, 15.10000038, 0.0000, 0.0000, 90.0000);//fechado
pawn Код:
if(strcmp("/skullopen", cmdtext, true, 10) == 0)
{
    {
        MoveObject(Portaoskull, 2445.50000000, -1658.9000244, 8.8999996185, 2);
        SendClientMessage(playerid, 0xC0C0C0AA, "| INFO | Bem vindo a gang Skull !");
    }
    return 1;
}

if(strcmp("/skullclosed", cmdtext, true, 10) == 0)
{
    {
        MoveObject(Portaoskull, 2445.50000000, -1658.90002441, 15.10000038, 2);
        SendClientMessage(playerid, 0xC0C0C0AA, "| INFO | Fechando o Portao da gang Skull !");
    }
    return 1;
}
Reply
#6

Atualiza o streamer
Caso vocк use.
Reply
#7

Atualizei mas deu no mesmo
Reply
#8

Coordenadas incorretas, se ele vai pra frente e pra esquerda depois tem algum nъmero errado
Reply
#9

Atualizei logo a **** a quatro deu certo man ..te dou uma rep assim q passar 50 poster vlw mo rei
Reply
#10

nada kk lol '-'
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)