[Ajuda] Meu relogio up nгo para quando estou afk
#1

Olб pessoal Meu relogio up nгo estб parando quando estou afk e nem quando saio do jogo alguem me ajuda Valendo REPLY

Relogio
pawn Код:
SetTimerEx("RelogioUP", 1000, true, "i", i);
UPRelogio[i] = TextDrawCreate(501.000000, 6.000000, " ");
TextDrawBackgroundColor(UPRelogio[i], 255);
TextDrawFont(UPRelogio[i], 1);
TextDrawLetterSize(UPRelogio[i], 0.509999, 1.299999);
TextDrawColor(UPRelogio[i], -1);
TextDrawSetOutline(UPRelogio[i], 1);
TextDrawSetProportional(UPRelogio[i], 1);

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);
                    if(dini_Int(file, "RelogioUP") == 1)
                    format(string, sizeof(string), "| UP | Vocк ganhou +1 de experiкncia! [ %d / 5 ]",dini_Int(file, "EXP"));
                    PlayerPlaySound(playerid, 1057, 0, 0, 0);
                    GameTextForPlayer(playerid, "~w~UP!", 3000, 6);
                    SendClientMessage(playerid, 0x75EA00AA, string);
                    dini_IntSet(file, "Tempo",0);
                }
                if(dini_Int(file, "EXP") >=5) {
                    dini_IntSet(file, "Level", dini_Int(file, "Level")+1);
                    SetPlayerScore(playerid,dini_Int(file, "Level"));
                    format(string, sizeof(string), "| UP | Vocк juntou 5 experiкncias, e ganhou +1 level. [ Level: %d ] ",dini_Int(file, "Level"));
                    SendClientMessage(playerid, 0x75EA00AA, string);
                    PlayerPlaySound(playerid, 1057, 0, 0, 0);
                    dini_IntSet(file, "EXP",0);
                    if(GetCasas(playerid) > 0) {
                    //SendClientMessage(playerid, 0xC0C0C0AA,"| IMPOSTOS | Os impostos de sua casa foram cobrados. Luz -350$; бgua: -150$. Totalizando: 500$.");
                    //dini_IntSet(file, "SaldoBancario", dini_Int(file, "SaldoBancario")-500);
                    //new Total;
                        new Total = randomEx(0, 99);
                                                  // ele vai gerar numeros. e + numeros ai tu liga e testa pera
                        new rand = random(200); rand += 4000;
                        format(string, sizeof(string), "| IMPOSTOS | Foram cobrados os impostos de sua casa (бgua e energia eletrica). Total: %d$",Total);
                        SendClientMessage(playerid, 0xC0C0C0AA, string);
                        dini_IntSet(file, "SaldoBancario", dini_Int(file, "SaldoBancario")-Total);
                    }
                }
            }
            else {
                SendClientMessage(playerid, Vermelho, "| ANTI - AFK | Vocк estб no modo ausente, e nгo recebeu uma experiкncia!");
            }
        }
    }
    if(segUP[playerid] == -1) {
        if(minUP[playerid] == 0)
            minUP[playerid] = 10;
        segUP[playerid] = 59;
        minUP[playerid]--;
    }
    format(string, sizeof(string), "~w~+ ~g~UP: ~w~%02d:%02d", minUP[playerid],segUP[playerid]);
    TextDrawSetString(UPRelogio[playerid],string);
    segUP[playerid] --;
    return 1;
}
 stock randomEx(minnum = cellmin,maxnum = cellmax) return random(maxnum - minnum + 1) + minnum;
Sу ele conta certim e tals mais nгo para quando fica afk vlw
Reply
#2

Use a var de afk , se o afk for false (porexemplo) ele fica contando caso nгo seja ele traza
Ex:
pawn Код:
if(PlayerInfo[playerid][AFK] == true)return true;
Reply
#3

Vou tentar tidou noticia '-'
Reply
#4

pawn Код:
C:\Users\pppp\Desktop\MeuRPG\gamemodes\RPG.pwn(20531) : error 033: array must be indexed (variable "AFK")
C:\Users\pppp\Desktop\MeuRPG\gamemodes\RPG.pwn(20568) : warning 209: function "RelogioUP" should return a value
C:\Users\pppp\Desktop\MeuRPG\gamemodes\RPG.pwn(20569) : error 010: invalid function or declaration
C:\Users\pppp\Desktop\MeuRPG\gamemodes\RPG.pwn(20570) : error 010: invalid function or declaration
C:\Users\pppp\Desktop\MeuRPG\gamemodes\RPG.pwn(20578) : error 010: invalid function or declaration
Reply
#5

Falei para voce e apenas um exemplo vocк deve ter uma variavel de afk use ela.

Reply
#6

s eu fiz so deu 1 erro que eu nгo sei arrumar

pawn Код:
C:\Users\pppp\Desktop\MeuRPG\gamemodes\RPG.pwn(20531) : error 033: array must be indexed (variable "AFK")
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)