[AJUDA] Tempo para os comandos (Teleport)
#1

Bom , estou procurando a uns 3 dias como fazer pra colocar um tempo para executar o comando , ex: Eu digito /sf - ai aparece uma mensagem "Espere 10 segundos parados para ir no teleport". , ai eu espero os 10 segundos parados e teleporto , se eu me mexer cancela o teleport ... Preciso muito desse comando por favor me ajudem

---> Ja procurei varias e varias vezes e nunca achei um desse tipo <---

//--------------------------[RESOLVIDO]--------------------------//

pawn Код:
#include <a_samp>

new Aguardando[MAX_PLAYERS];

new Float:RandomSpawns[8][8] =
{
    {-2442.7869,749.5129,35.1786},
    {-2027.5011,-43.5853,38.8047},
    {-1881.2325,-831.0626,32.0234},
    {-2292.8062,180.9209,35.3125},
    {-2507.9167,1106.4122,55.7046},
    {-1753.8597,939.8560,24.8906},
    {-2621.9512,1407.3934,7.1016},
    {-1414.7089,-149.2586,14.1484}
};

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/sf", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid, 0xFFD700AA, "* Aguarde 10 segundos!");
        GameTextForPlayer(playerid, "~g~Aguarde...", 7000, 1);
        Aguardando[playerid] = SetTimerEx("AguardandoTele", 10000, false, "i", playerid);
        return 1;
    }
    if (strcmp("/2sf", cmdtext, true, 10) == 0)
    {
        SetPlayerInterior(playerid,0);
        new rand = random(sizeof(RandomSpawns));
        SetPlayerPos(playerid, RandomSpawns[rand][0], RandomSpawns[rand][1], RandomSpawns[rand][2]);
        SetPlayerFacingAngle(playerid,15);
        SendClientMessage(playerid, 0xFFD700AA, "* Bem vindo a SF =)");
        return 1;
    }
    return 0;
}

forward AguardandoTele(playerid);
public AguardandoTele(playerid)
{
    OnPlayerCommandText(playerid, "/2sf");
    return 1;
}
By : [NWD]Jim._.Carrey
Reply
#2

pawn Код:
//Edit ._.
//Topo
new Despausar[MAX_PLAYERS];
forward Pausar(playerid);
forward PausarOff(playerid);

//Final ou aonde desejar \/
public Pausar(playerid)
{
    TogglePlayerControllable(playerid, false);
    SetPlayerFacingAngle(playerid, 0);
    GameTextForPlayer(playerid, "~g~Carregando...", 3000,1);
    Despausar[playerid] = SetTimerEx("PausarOff", 5000, false, "i", playerid);
}

public PausarOff(playerid)
{
    TogglePlayerControllable(playerid, true);
}

//no comando vocк coloca

Pausar(playerid);
Reply
#3

Esqueceu o

pawn Код:
forward PausarOff(playerid);
Reply
#4

Eu fiz mais deu esses erros

pawn Код:
C:\Documents and Settings\Clique Aqui\Desktop\[D.A] Midnight Club [Brasil]\gamemodes\lvdm.pwn(1339) : error 017: undefined symbol "Despausar"
C:\Documents and Settings\Clique Aqui\Desktop\[D.A] Midnight Club [Brasil]\gamemodes\lvdm.pwn(1339) : warning 215: expression has no effect
C:\Documents and Settings\Clique Aqui\Desktop\[D.A] Midnight Club [Brasil]\gamemodes\lvdm.pwn(1339) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Clique Aqui\Desktop\[D.A] Midnight Club [Brasil]\gamemodes\lvdm.pwn(1339) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Clique Aqui\Desktop\[D.A] Midnight Club [Brasil]\gamemodes\lvdm.pwn(1339) : fatal error 107: too many error messages on one line
Linha :

pawn Код:
Despausar[playerid] = SetTimerEx("PausarOff", 5000, false, "i", playerid);
Reply
#5

Topo GM:

pawn Код:
new Despausar[500]

Dorgas,to ficando puto com isso \/ ja so,ok? -
Quote:

This forum requires that you wait 120 seconds between posts. Please try again in 79 seconds.
This forum requires that you wait 120 seconds between posts. Please try again in 60 seconds.
This forum requires that you wait 120 seconds between posts. Please try again in 59 seconds.
This forum requires that you wait 120 seconds between posts. Please try again in 81 seconds.
This forum requires that you wait 120 seconds between posts. Please try again in 98 seconds.
This forum requires that you wait 120 seconds between posts. Please try again in 120 seconds.
This forum requires that you wait 120 seconds between posts. Please try again in 119 seconds.
This forum requires that you wait 120 seconds between posts. Please try again in 14 seconds.
This forum requires that you wait 120 seconds between posts. Please try again in 1 seconds.
This forum requires that you wait 120 seconds between posts. Please try again in 2 seconds.
This forum requires that you wait 120 seconds between posts. Please try again in 57 seconds.
This forum requires that you wait 120 seconds between posts. Please try again in 7 seconds.
This forum requires that you wait 120 seconds between posts. Please try again in 9 seconds.
This forum requires that you wait 120 seconds between posts. Please try again in 203 seconds.

Reply
#6

Opa funciono , mais nгo й oque eu queria

Eu quero um que Quando eu digito /sf , apareзa uma mensagem " Espere 10 segundos parados " Ai quando terminar os 10 segundos ele faz o comando , esse ele fica congelado apуs o comando .. mais ja me ajudou bastante, Mais se alguem souber como faz esse que estou procurando fico muiito agredecido.
Reply
#7

entaum faz assim:

pawn Код:
//No inicio do gm -
    forward Esperar(playerid);
    if(strcmp("/sf", true) == 0)
    {
        GameTextForPlayer(playerid, "~r~Espere 10 segundos", 3000, 1);
        SetTimer("Esperar", 5000, true);
        TogllePlayerControllable(playerid, 0);
    }
//No final do gm:

public Esperar(playerid)
{
    TogglePlayerControllabe(playerid, 1);
    //Funcoes - Acho euq seja teleporte -.-'
    GameTextForPlayer(playerid, "~g~Vocк foi teleportado!", 3000, 1);
}
Reply
#8

roginho_97 --> Й Esse mesmo que eu queria vlww, mais deu um problema , eu uso Teleport randomico , ai qndo eu uso o /sf teleporta normal , mais fica teleportando de um em um lugar! me ajuda arruma isso?
Reply
#9

Posta o cуdigo aqui do teleporte '-'
Reply
#10

Ele ta assim :

// --- [no topo] --- //

new Float:RandomSpawns[8][8] = {
{-2442.7869,749.5129,35.1786},
{-2027.5011,-43.5853,38.8047},
{-1881.2325,-831.0626,32.0234},
{-2292.8062,180.9209,35.3125},
{-2507.9167,1106.4122,55.7046},
{-1753.8597,939.8560,24.8906},
{-2621.9512,1407.3934,7.1016},
{-1414.7089,-149.2586,14.1484}
};


// ------[Comando]-------- //

if(strcmp(cmd, "/sf", true) == 0)
{
SetPlayerInterior(playerid,0);
new rand = random(sizeof(RandomSpawns));
SetPlayerPos(playerid, RandomSpawns[rand][0], RandomSpawns[rand][1], RandomSpawns[rand][2]);
SetPlayerFacingAngle(playerid,15);
}

(Eu removi o comando q o roginho_97 mais й igual aquele q preciso)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)