SA-MP Forums Archive
[AJUDA] Tempo para os comandos (Teleport) - 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: [AJUDA] Tempo para os comandos (Teleport) (/showthread.php?tid=196848)



[AJUDA] Tempo para os comandos (Teleport) [RESOLVIDO] - Dark.Angel - 07.12.2010

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


Re: [AJUDA] Tempo para os comandos (Teleport) - [NWD]Jim._.Carrey - 07.12.2010

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);



Re: [AJUDA] Tempo para os comandos (Teleport) - Macintosh - 07.12.2010

Esqueceu o

pawn Код:
forward PausarOff(playerid);



Re: [AJUDA] Tempo para os comandos (Teleport) - Dark.Angel - 07.12.2010

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);



Re: [AJUDA] Tempo para os comandos (Teleport) - ipsBruno - 07.12.2010

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.




Re: [AJUDA] Tempo para os comandos (Teleport) - Dark.Angel - 07.12.2010

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.


Re: [AJUDA] Tempo para os comandos (Teleport) - roginho_97 - 07.12.2010

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);
}



Re: [AJUDA] Tempo para os comandos (Teleport) - Dark.Angel - 07.12.2010

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?


Re: [AJUDA] Tempo para os comandos (Teleport) - [NWD]Jim._.Carrey - 07.12.2010

Posta o cуdigo aqui do teleporte '-'


Re: [AJUDA] Tempo para os comandos (Teleport) - Dark.Angel - 07.12.2010

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)