[Ajuda] Relogio up
#1

Entao Galera , estou precisando que o relogio up salve o tempo , exemplo eu saio do servidor com 2:20 , quando eu entrar devolta esteja em 2:20 .
No caso agora quando eu relogo ele volta pra 10:00 Pf me ajudem .

Topo do gm:

PHP код:
new segUP[MAX_PLAYERS];// Variavel de Segundos
new minUP[MAX_PLAYERS];// Variavel de Minutos
new Text:UPRelogio[MAX_PLAYERS];//draw do relogio 
OnPlayerConnect:

PHP код:
minUP[playerid] = 9;
segUP[playerid] = 59
OnGameModeInt:


PHP код:
for(new 0MAX_PLAYERSi++)
    {
        
SetTimerEx("RelogioUP"1000true"i"i);
        
UPRelogio[i] = TextDrawCreate(509.000000222.000000" ");
        
TextDrawBackgroundColor(UPRelogio[i], 255);
        
TextDrawFont(UPRelogio[i], 3);
        
TextDrawLetterSize(UPRelogio[i], 0.4699981.500000);
        
TextDrawColor(UPRelogio[i], -1);
        
TextDrawSetOutline(UPRelogio[i], 1);
        
TextDrawSetProportional(UPRelogio[i], 1);
    } 
OnplayerSpawn
PHP код:
TextDrawShowForPlayer(playeridUPRelogio[playerid]); 
No final do Gm:
PHP код:
forward RelogioUP(playerid);
public 
RelogioUP(playerid)
{
    new 
string[256];
        if(
segUP[playerid] == && minUP[playerid] == 0)
        {
            new 
aname[MAX_PLAYER_NAME];
            
GetPlayerName(playeridanameMAX_PLAYER_NAME);
            
format(filesizeof(file), PASTA_CONTASaname);
            if(
PlayerInfo[playerid][Logged] == 1)
            {
                if(
AFK[playerid] == 0)
                {
                    
dini_IntSet(file"Tempo"dini_Int(file"Tempo")+1);
                    
//====== [EXP] ======
                    
if(dini_Int(file"Tempo") >=1)
                    {
                        
dini_IntSet(file"EXP"dini_Int(file"EXP")+1);
                        
format(stringsizeof(string), "| UP | Vocк ganhou +1 de experiкncia! [ %d / 5 ]",dini_Int(file"EXP"));
                        
PlayerPlaySound(playerid1133000);
                        
SendClientMessage(playerid0x33AAFFFFstring);
                        
dini_IntSet(file"Tempo",0);
                    }
                    if(
dini_Int(file"EXP") >=5)
                    {
                        
dini_IntSet(file"Level"dini_Int(file"Level")+1);
                        
format(stringsizeof(string), "(INFO) Vocк juntou 5 de respeito, e ganhou +1 level. (%d) ",dini_Int(file"Level"));
                        
SendClientMessage(playerid0x75EA00AAstring);
                        
PlayerPlaySound(playerid1057000);
                        
dini_IntSet(file"EXP",0);
                    }
                }
            }
        }
        if(
segUP[playerid] == 0)
        {
            if(
minUP[playerid] == 0)
                
minUP[playerid] = 10;
                
segUP[playerid] = 59;
                
minUP[playerid] --;
        }
        
format(stringsizeof(string), "UP: %02d:%02d"minUP[playerid], segUP[playerid]);
        
TextDrawSetString(UPRelogio[playerid], string);
        
segUP[playerid] --;
        return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)