SA-MP Forums Archive
[Pedido] tempo para pular o tutorial - 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: [Pedido] tempo para pular o tutorial (/showthread.php?tid=502773)



tempo para pular o tutorial - MichelScripter - 26.03.2014

o meu tut й em dialog, e os player acabam passando sem ler queria por um tempo de 10seg para proseguir! -'


alguйm me ajuda



Re: tempo para pular o tutorial - DannielCooper - 26.03.2014

pawn Код:
new tempo = 10;

if(GetTickCount < tempo) return SendClientMessage(playerid, -1, "Nгo pode passar do tutorial");
Isso й apenas um exemplo, pode fazer de outro jeito.


Re: tempo para pular o tutorial - DrTHE - 26.03.2014

Quote:
Originally Posted by DannielCooper
Посмотреть сообщение
pawn Код:
new tempo = 10;

if(GetTickCount < tempo) return SendClientMessage(playerid, -1, "Nгo pode passar do tutorial");
Isso й apenas um exemplo, pode fazer de outro jeito.
Nгo faz sentido isso ai.

~

Tente algo assim

Declare uma variбvel global:
pawn Код:
new tempo[MAX_PLAYERS];
Armazene o tempo inicial em segundos (utilizar em cada parte do tutorial).
pawn Код:
tempo[playerid] = gettime();
Verifique o tempo passado (o valor 10 abaixo й referente a 10 segundos passados)
pawn Код:
if(gettime() - tempo[playerid] < 10) return SendClientMessage(playerid, -1, "Aguarde no minimo 10 segundos!");



Re: tempo para pular o tutorial - Marlon_Lorran - 26.03.2014

Pode-se fazer deste jeito aqui tambйm:

PHP код:

// Topo do GameMode
new tempoEsperar[MAX_PLAYERS];
// Callback: OnPlayerConnect
tempoEsperar[playerid] = 0;
public 
esperarTempo(playerid) {
    if(
gettime() - tempoEsperar[playerid] >= 10) {
        
tempoEsperar[playerid] = gettime();
        return 
true;
    }
    else
        
SendClientMessage(playerid, -1"Espere 10 segundos!");
        
    return 
false;

Modo de uso:

PHP код:
CMD:testemarlon(playeridparams[]) {
    
#pragma unused params
    
    
if(esperarTempo(playerid)) {
        
SendClientMessage(playerid, -1"Marlon seu lindo");
    }
    return 
true;




Re: tempo para pular o tutorial - mitsumyy - 27.03.2014

Porque no usa um SetTimerEx ?


Re: tempo para pular o tutorial - VeNuZ_ - 27.03.2014

Realmente...
pawn Код:
new PassarTutorial[MAX_PLAYERS];

forward sairtutorial(playerid);
// coloco assim quando ele receber o diбlog
PassarTutorial[playerid] = 1;
SetTimerEx("sairtutorial", 10000, false, "i", playerid);

// public
public sairtutorial(playerid)
{
PassarTutorial[playerid] = 0;
return 1;
}

// para verificar:
if(PassarTutorial[playerid] != 0) return ShowPlayerDialog...
Apenas um exemplo breve feito atravйs do tlm..


Re: tempo para pular o tutorial - DannielCooper - 27.03.2014

SetTimer nгo й necessбrio pra isso...