[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 i = 0; i < MAX_PLAYERS; i++)
    {
        
SetTimerEx("RelogioUP", 1000, true, "i", i);
        
UPRelogio[i] = TextDrawCreate(509.000000, 222.000000, " ");
        
TextDrawBackgroundColor(UPRelogio[i], 255);
        
TextDrawFont(UPRelogio[i], 3);
        
TextDrawLetterSize(UPRelogio[i], 0.469998, 1.500000);
        
TextDrawColor(UPRelogio[i], -1);
        
TextDrawSetOutline(UPRelogio[i], 1);
        
TextDrawSetProportional(UPRelogio[i], 1);
    } 
OnplayerSpawn
PHP код:
TextDrawShowForPlayer(playerid, UPRelogio[playerid]); 
No final do Gm:
PHP код:
forward RelogioUP(playerid);
public 
RelogioUP(playerid)
{
    new 
string[256];
        if(
segUP[playerid] == 0 && minUP[playerid] == 0)
        {
            new 
aname[MAX_PLAYER_NAME];
            
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
            
format(file, sizeof(file), PASTA_CONTAS, aname);
            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(string, sizeof(string), "| UP | Vocк ganhou +1 de experiкncia! [ %d / 5 ]",dini_Int(file, "EXP"));
                        
PlayerPlaySound(playerid, 1133, 0, 0, 0);
                        
SendClientMessage(playerid, 0x33AAFFFF, string);
                        
dini_IntSet(file, "Tempo",0);
                    }
                    if(
dini_Int(file, "EXP") >=5)
                    {
                        
dini_IntSet(file, "Level", dini_Int(file, "Level")+1);
                        
format(string, sizeof(string), "(INFO) Vocк juntou 5 de respeito, e ganhou +1 level. (%d) ",dini_Int(file, "Level"));
                        
SendClientMessage(playerid, 0x75EA00AA, string);
                        
PlayerPlaySound(playerid, 1057, 0, 0, 0);
                        
dini_IntSet(file, "EXP",0);
                    }
                }
            }
        }
        if(
segUP[playerid] == 0)
        {
            if(
minUP[playerid] == 0)
                
minUP[playerid] = 10;
                
segUP[playerid] = 59;
                
minUP[playerid] --;
        }
        
format(string, sizeof(string), "UP: %02d:%02d", minUP[playerid], segUP[playerid]);
        
TextDrawSetString(UPRelogio[playerid], string);
        
segUP[playerid] --;
        return 
1;
} 
Reply


Forum Jump:


Users browsing this thread: