Originally Posted by DanDRT
PHP код:
new string3[37], cStr[300];
format(string3, sizeof string3, "Banidos/%s.ini", Nome(playerid));
if(fexist(string3))
{
if(DOF2_GetInt(string3, "Dias") < gettime())
{
DOF2_RemoveFile(string3);
SendClientMessage(playerid, -1, "[INFO]: Seu Banimento Temporario Acabou!");
}
else
{
format(cStr, sizeof cStr, "{FFFFFF}Admin que lhe baniu: {FF0000}%s\n{FFFFFF}Motivo: {FF0000}%s\n{FFFFFF}Dias: {FF0000}%d\n{FFFFFF}Restam: {FF0000}%d {FFFFFF}para ser desbanido.", DOF2_GetString(string3, "Admin"), DOF2_GetString(string3, "Motivo"), DOF2_GetInt(string3, "Dias"), Convert(DOF2_GetInt(string3, "Dias")-gettime()));
ShowPlayerDialog(playerid, 1437, DIALOG_STYLE_MSGBOX, "{FF0000}» {FFFFFF}VOCК ESTБ BANIDO DESTE SERVIDOR {FF0000}«", cStr, "Fechar","");
return true;
}
return true;
}
PHP код:
Convert(number)
{
new hours = 0, mins = 0, secs = 0, string[128];
hours = floatround(number / 3600);
mins = floatround((number / 60) - (hours * 60));
secs = floatround(number - ((hours * 3600) + (mins * 60)));
new days = 0;
if(hours >= 24)
{
days = floatround((hours/24), floatround_floor);
hours = hours % 24;
}
if(days > 0)
{
format(string, 100, "%ddias, %dh %dm e %ds", days, hours, mins, secs);
}
else if(hours > 0)
{
format(string, 100, "%dh %dm e %ds", hours, mins, secs);
}
else
{
format(string, 100, "%dm e %ds", mins, secs);
}
return string;
}
Mals;
|