[Ajuda] Horбrio
#9

Quote:
Originally Posted by RodrigoMSR
Посмотреть сообщение
Vocк deveria criar um sу timer global para seu servidor, com tempo de 1 segundo, nele vocк adiciona tudo que precisa ser atualizado.

Nesse timer vocк faz um loop em todos os jogadores e adiciona valor a uma variбvel que vai ser o tempo vivo em segundos, na OnPlayerDeath essa variбvel reseta e a contagem comeзa automaticamente de novo.

Exemplo:
Код:
new TempoVivo[MAX_PLAYERS];

//No loop do timer, checando se o jogador estб nascido
TempoVivo[i]++;

//Na OnPlayerDeath
TempoVivo[i] = 0;

//para ver o tempo vivo
stock GetTVivo(playerid)
{
	new str[50], time = TempoVivo[playerid];
    format(str, sizeof(str), "%02d:%02d:%02d", time/3600, (time % 3600)/60, time % 60); //1 hora = 3600 segundos, % = resto de divisгo inteira
    return str;
}
Olб, tentei fazer seu exemplo, olhe:

PHP код:
stock paineltime()
{
    for(new 
i=0MAX_PLAYERSi++){
        
PlayerLogin[i][horav] ++;
        
tempologado[i] ++;
        
format(str[i], sizeof(str[i]), "%02d:%02d:%02d"PlayerLogin[i][horav]/3600, (PlayerLogin[i][horav] % 3600)/60PlayerLogin[i][horav] % 60);
        
format(str2[i], sizeof(str2[i]), "%02d:%02d:%02d"tempologado[i]/3600, (tempologado[i] % 3600)/60tempologado[i] % 60);
        
PlayerTextDrawSetString(iTextdraw33str[i]);
        
PlayerTextDrawSetString(iTextdraw35str2[i]);
    }
    return 
1;

mas estб dando estes erros:

Quote:

C:\Users\welli\Desktop\server dayz\gamemodes\GM_KillerZ.pwn(396) : error 001: expected token: "]", but found "-identifier-"
C:\Users\welli\Desktop\server dayz\gamemodes\GM_KillerZ.pwn(396) : warning 215: expression has no effect
C:\Users\welli\Desktop\server dayz\gamemodes\GM_KillerZ.pwn(396) : error 001: expected token: ";", but found "]"
C:\Users\welli\Desktop\server dayz\gamemodes\GM_KillerZ.pwn(396) : error 029: invalid expression, assumed zero
C:\Users\welli\Desktop\server dayz\gamemodes\GM_KillerZ.pwn(396) : fatal error 107: too many error messages on one line

parece algo simples, mas nгo encontro o erro, linha dos erros й os 2 formats
Reply


Messages In This Thread
Horбrio - by Scorpion659 - 06.05.2017, 16:15
Re: Horбrio - by OtimoJogo - 06.05.2017, 16:43
Re: Horбrio - by IlanZ - 06.05.2017, 17:43
Re: Horбrio - by ViniBorn - 06.05.2017, 19:03
Re: Horбrio - by RodrigoMSR - 06.05.2017, 19:05
Re: Horбrio - by Scorpion659 - 06.05.2017, 20:05
Re: Horбrio - by Scorpion659 - 06.05.2017, 22:24
Re: Horбrio - by AuhMaru - 06.05.2017, 22:35
Re: Horбrio - by Scorpion659 - 10.05.2017, 01:29
Re: Horбrio - by KinG7 - 10.05.2017, 01:56

Forum Jump:


Users browsing this thread: 5 Guest(s)