[Ajuda] Configurar Relogio UP
#1

Gente sou novo no lance de Scripts e estou enfrentando um problema nao sei como colocar meu relogio up mostrando o tempo do SEGUNDOSScore...
vou colocar minha script de LevelUp...Agradeзo desde de jб

Quote:

#include <a_samp>
#include <DOF2>

#define Score "ContasBRL/%s.ini" //PASTA PARA SALVAR O Score.
#define SEGUNDOSScore 3600 //TROQUE PARA OS SEGUNDOS DESEJADOS, 3600 SEGUNDOS = 1 HORA

new Text:RelogioUP;

enum Info
{
pSegundos,
pScore
};
new PlayerInfo[MAX_PLAYERS][Info];
new segundos;

public OnFilterScriptInit()
{
segundos = SetTimer("SegundoaMais",1000,1);

RelogioUP = TextDrawCreate(559.0, 372.0, "+UP 00:00");
TextDrawFont(RelogioUP, 2);
TextDrawSetOutline(RelogioUP,1);
TextDrawBackgroundColor(RelogioUP,0x000000FF);
TextDrawColor(RelogioUP,0xFFFFFFFF);
TextDrawSetProportional(RelogioUP, 1);
TextDrawLetterSize(RelogioUP,0.31, 1.10);

return 1;
}

public OnFilterScriptExit()
{
KillTimer(segundos);
TextDrawHideForAll(RelogioUP);
DOF2_Exit();
return 1;
}

public OnPlayerDisconnect(playerid)
{
new arquivo[34], playername[MAX_PLAYER_NAME];
SalvarPlayer(playerid);
GetPlayerName(playerid, playername, sizeof(playername));
format(arquivo, sizeof(arquivo), Score, playername);
if(DOF2_FileExists(arquivo))
{
DOF2_SetInt(arquivo, "Segundos", PlayerInfo[playerid][pSegundos]);
DOF2_SetInt(arquivo, "Score", PlayerInfo[playerid][pScore]);
DOF2_SaveFile();
}
else
{
DOF2_CreateFile(arquivo);
DOF2_SetInt(arquivo, "Segundos", PlayerInfo[playerid][pSegundos]);
DOF2_SetInt(arquivo, "Score", PlayerInfo[playerid][pScore]);
DOF2_SaveFile();
}
return 1;
}

public OnPlayerConnect(playerid)
{
new arquivo[34], playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
format(arquivo, sizeof(arquivo), Score, playername);
PlayerInfo[playerid][pSegundos] = DOF2_GetInt(arquivo, "Segundos");
PlayerInfo[playerid][pScore] = DOF2_GetInt(arquivo, "Score");
SetPlayerScore(playerid, DOF2_GetInt(arquivo,"Score"));
return 1;
}

public OnPlayerSpawn(playerid)
{
TextDrawShowForPlayer(playerid,RelogioUP);
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
TextDrawHideForPlayer(playerid,RelogioUP);
return 1;
}

forward SegundoaMais();
public SegundoaMais()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
PlayerInfo[i][pSegundos] ++;
if(PlayerInfo[i][pSegundos] >= SEGUNDOSScore)
{
PlayerInfo[i][pSegundos] = 0;
ScoreUP(i);
}
}
return 1;
}

ScoreUP(playerid)
{
PlayerInfo[playerid][pScore] ++;
GivePlayerMoney(playerid, 100);
GameTextForPlayer(playerid, "~w~Level ~p~UP", 2000, 1);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
// COLOQUE AQUI AS FUNЗХES QUE DESEJA NO SEU "Score UP"
}

stock SalvarPlayer(playerid)
{
new arquivo[34], playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
format(arquivo, sizeof(arquivo), Score, playername);
DOF2_SetInt(arquivo, "Score", PlayerInfo[playerid][pScore]);
DOF2::SaveFile();
return true;
}

Reply


Messages In This Thread
Configurar Relogio UP - by felipelm3g - 03.12.2015, 00:43
Re: Configurar Relogio UP - by cicinho - 03.12.2015, 09:23
Re: Configurar Relogio UP - by felipelm3g - 03.12.2015, 16:47
Re: Configurar Relogio UP - by cicinho - 03.12.2015, 17:04
Re: Configurar Relogio UP - by felipelm3g - 03.12.2015, 17:23
Re: Configurar Relogio UP - by felipelm3g - 03.12.2015, 20:12
Re: Configurar Relogio UP - by cicinho - 03.12.2015, 20:52
Re: Configurar Relogio UP - by felipelm3g - 04.12.2015, 00:28
Re: Configurar Relogio UP - by matheusspohr - 04.12.2015, 00:53
Re: Configurar Relogio UP - by cicinho - 04.12.2015, 00:55

Forum Jump:


Users browsing this thread: 3 Guest(s)