27.05.2013, 21:42
Olб pessoal Meu relogio up nгo estб parando quando estou afk e nem quando saio do jogo alguem me ajuda Valendo REPLY
Relogio
Sу ele conta certim e tals mais nгo para quando fica afk vlw
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;