SA-MP Forums Archive
[Pedido] Comandos /tempoon - 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] Comandos /tempoon (/showthread.php?tid=518868)



Comandos /tempoon - Julinhu - 11.06.2014

Galera queria pedir 2 comandos, para player do meu server.

/meutempoon
/tempoon [id]

/meutempoon - Mostraria o tempo em que o player estб online, quando ele sair do server e logar de novo o tempo seria zerado.

/tempoon [id] - O player digitaria um id e iria aparecer o tempo on do player escolhido, quando ele relogasse iria zerar.

Alguem?


Re: Comandos /tempoon - Mori4rty - 11.06.2014

BASE:
pawn Код:
new tempo_on[MAX_PLAYERS];
new Timer_TempoOn[MAX_PLAYERS];
forward TempoOn_Callback(playerid);
// OnPlayerConect:
tempo_on[playerid] = 0;
Timer_TempoOn[playerid] = SetTimerEx("TempoOn_Callback", 1000, true, "u", playerid);
// OnPlayerDisconect:
KillTimer(Timer_TempoOn[playerid]);
// Qualquer local:
public TempoOn_Callback(playerid) return tempo_on[playerid] ++;
// Comandos:
COMMAND:meutempoon(playerid)
{
    new str[128];
    format(str, sizeof str, "Vocк estб %d segundos online.", tempo_on[playerid]);
    SendClientMessage(playerid, -1, str);
    return true;
}
Agora o /tempoon [id] й com vocк..
A Base jб tб feita, basta otimizar e concluir.


Re: Comandos /tempoon - ForT - 11.06.2014

https://sampwiki.blast.hk/wiki/NetStats_GetConnectedTime


Re: Comandos /tempoon - Julinhu - 12.06.2014

Como faзo o tempoon id?