28.11.2013, 17:04
(
Последний раз редактировалось DanDRT; 03.12.2013 в 21:48.
)
[I]
Ps: vou procurar adicionar mais funзхes ao decorrer do tempo.
Funзхes
Cуdigo:
ou PasteBin.
Crйditos
pawn Код:
Now(), TimeStamp() ou iGetTimeStamp();
IsNumeric(string[]) - Verifica se й numerico ou nгo e retorna true ou false;
GetIP(playerid) - Pega o IP do Jogador;
GetPlayerNameEx(playerid) - Pega o Nick do Jogador.
pawn Код:
/*
* --- iUtils ---
* Por DanDRT(Danilo Galvгo)
* Agradecimentos: Willian.
* [iPs]TeaM - ipsbr.net
* CODE.ME
*/
#define Now iGetTimeStamp
#define TimeStamp iGetTimeStamp
stock IsNumeric(const string[])
{
for (new i = (string[0] == 0x2D && string[1] ? 1 : 0),j = strlen(string); i < j; i++)
{
if (string[i] > 0x39 || string[i] < 0x30) return false;
}
return true;
}
stock iGetTimeStamp()
{
new time[6], february, finaltime;
gettime(time[0], time[1], time[2]);
getdate(time[3], time[4], time[5]);
february = (!((time[3] % 4) ^ 2) ? 29 : 28);
if(!(february ^ 28))
finaltime = 86400;
finaltime += 27053635+(time[2] + (time[1] * 60) + (time[0] * 3600))+(((31*7)+(30*4)+february)+(time[5] * 86400) + (31536000 * (time[3]-1970)));
return finaltime;
}
stock GetIP(playerid)
{
new Ip[16];
GetPlayerIp(playerid, Ip, sizeof(Ip));
return Ip;
}
stock GetPlayerNameEx(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
return name;
}
[/i][/i]
ou PasteBin.
Crйditos
pawn Код:
/*
* --- iUtils ---
* Por DanDRT(Danilo Galvгo)
* Agradecimentos: Willian.
* [iPs]TeaM - ipsbr.net
*/
Ps: vou procurar adicionar mais funзхes ao decorrer do tempo.