09.04.2017, 18:51
olб!! gostaria de transformar meu comando tempban em dias pois ele estб em horas! alguйm poderia ajudar?
PHP код:
dcmd_tempban(playerid,params[]) {
if(PlayerInfo[playerid][Level] < 1) return SendClientMessage(playerid,red,"| ERRO | O comando digitado nгo Existe!");
new tmp[256], tmp2[256], tmp3[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index), tmp3 = strtok(params,Index);
if(!strlen(params)) return SendClientMessage(playerid, red, "USO: /tempban [playerid] [horas] [motivo]");
new string[128];
new player,horas;
player = strval(tmp);
horas = strval(tmp2);
if(PlayerInfo[player][LoggedIn] != 1) return SendClientMessage(playerid, red, "| ERRO |: Jogador nгo esta logado");
if(!IsPlayerConnected(player)) return SendClientMessage(playerid, red, "| ERRO |: Jogador nгo conectado");
if(player == playerid) return SendClientMessage(playerid, red, "| ERRO |: Й seu ID, sua anta!");
if(PlayerInfo[player][Level] >= 5) return SendClientMessage(playerid, red, "| ERRO |: Jogador й ADMIN! Porra!");
if(horas > 96) return SendClientMessage(playerid, red, "| ERRO |: Mбximo de horas: 96");
if(horas <= 0) return SendClientMessage(playerid, red, "| ERRO |: Mнnimo de horas: 1");
if(!strlen(params[4])) return SendClientMessage(playerid, red, "| ERRO |: Vocк deve especificar um motivo");
CMDMessageToAdmins(playerid,"TEMPBAN");
new year,month,day,hour,minuite,second; getdate(year, month, day); gettime(hour,minuite,second);
new playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME];
GetPlayerName(player, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname));
new string2[100],string3[100];
format(string,sizeof(string),"{FF0000}|BAN TEMP| O(a) Administrador(a) %s Baniu o(a) Jogador(a) %s (Motivo:%s)",adminname,playername,params[strlen(tmp)+strlen(tmp2)+1],day,month,year,hour,minuite);
format(string3,sizeof(string3),"{FFFFFF}|BAN|Vocк foi Banido(a) Temporariamente Pelo ( Motivo: %s)",params[4]);
format(string2,sizeof(string2),"{FFFFFF}|BAN|Sua conta serб Desbanida Automaticamente em (%i Horas)",horas);
SendClientMessageToAll(grey,string);
SaveToFile("BanLog",string);
dUserSetINT(PlayerName2(player)).("tmpb",1);
dUserSetINT(PlayerName2(player)).("tmpbs",HourTimeStamp);
dUserSetINT(PlayerName2(player)).("tmpbh",horas);
SendClientMessage(player, red, "");
SendClientMessage(player, yellow, string3);
SendClientMessage(player, green, string2);
SendClientMessage(player, red, "");
Kick(player);
return 1;
}