12.12.2017, 17:47
Imagem de Teste:https://imgur.com/a/d34R1
new MinutosP[MAX_PLAYERS], SegundosP[MAX_PLAYERS], Text: Textdraw0[MAX_PLAYERS];//variavel minutos e segundos do payday.
Crйditos
DelK_+ REP NELE
http://forum.sa-mp.com/member.php?u=297267
new MinutosP[MAX_PLAYERS], SegundosP[MAX_PLAYERS], Text: Textdraw0[MAX_PLAYERS];//variavel minutos e segundos do payday.
PHP код:
public OnPlayerConnect(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
SetTimerEx("RelogioUP", 1000, true, "i", i);
Textdraw0[i] = TextDrawCreate(499.000000, 123.000000, "");
TextDrawBackgroundColor(Textdraw0[i], 255);
TextDrawFont(Textdraw0[i], 1);
TextDrawLetterSize(Textdraw0[i], 0.450000, 0.899999);
TextDrawColor(Textdraw0[i], -16776961);
TextDrawSetOutline(Textdraw0[i], 0);
TextDrawSetProportional(Textdraw0[i], 0);
TextDrawSetShadow(Textdraw0[i], 1);
TextDrawSetSelectable(Textdraw0[i], 0);
}
MinutosP[playerid] = DOF2_GetInt(Conta, "Minutos Payday");//Carregar Minutos
SegundosP[playerid] = DOF2_GetInt(Conta, "Segundos Payday");//Carregar Segundos
return 1;
}
public OnplayerDisconnect(playerid, reason)
{
DOF2_SetInt(Conta, "Minutos Payday", MinutosP[playerid]);//Salvar Minutos
DOF2_SetInt(Conta, "Segundos Payday", SegundosP[playerid]);//Salvar Segundos
return 1;
}
forward RelogioUP(playerid);//Em algum lugar da sua GM.
public RelogioUP(playerid)//Em algum lugar da sua GM.
{
if(MinutosP[playerid] == 0 && SegundosP[playerid] == 0)
{
MinutosP[playerid] = 59;
SegundosP[playerid] = 59;
PayDay();
}
if(SegundosP[playerid] == -1)
{
if(MinutosP[playerid] == 0)
MinutosP[playerid] = 59;
SegundosP[playerid] = 59;
MinutosP[playerid]--;
}
new string[128];
format(string, sizeof(string), "Payday:~w~%02dm e %02ds", MinutosP[playerid], SegundosP[playerid]);
TextDrawSetString(Textdraw0[playerid],string);
TextDrawShowForPlayer(playerid, Textdraw0[playerid]);
SegundosP[playerid] --;
return 1;
}
DelK_+ REP NELE
http://forum.sa-mp.com/member.php?u=297267