SA-MP Forums Archive
BanTemp para dias - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: BanTemp para dias (/showthread.php?tid=640133)



BanTemp para dias - Pedro1812 - 28.08.2017

Olб! eu tenho um bantemp porem ele sу da banimento por horas,alguйm poderia me ajudar a converter para dias?
Grato!!!!!!!!!!

cmd:
PHP код:
dcmd_tempban(playerid,params[]) {
if(
PlayerInfo[playerid][Level] < 1)  return SendClientMessage(playerid,red,"| ERRO | Comando Inexistente. ");
new 
tmp[256], tmp2[256], tmp3[256], Indextmp strtok(params,Index), tmp2 strtok(params,Index), tmp3 strtok(params,Index);
if(!
strlen(params)) return SendClientMessage(playeridred"| ERRO | Digite: /tempban [ID] [Horas] [Motivo]");
new 
string[128];
new 
player,horas;
player strval(tmp);
horas strval(tmp2);
if(
PlayerInfo[player][LoggedIn] != 1) return SendClientMessage(playeridred"| ERRO | Jogador(a) nгo Logado!");
if(!
IsPlayerConnected(player)) return SendClientMessage(playeridred"| ERRO | Jogador(a) nгo Conectado(a)!");
if(
horas 360) return SendClientMessage(playeridred"| ERRO | Mбximo de horas: 360");
if(
horas <= 0) return SendClientMessage(playeridred"| ERRO | Mнnimo de horas: 1");
if(!
strlen(params[4])) return SendClientMessage(playeridred"| ERRO | Coloque um Motivo!");
CMDMessageToAdmins(playerid,"TEMPBAN");
new 
year,month,day,hour,minuite,secondgetdate(yearmonthday); gettime(hour,minuite,second);
new 
playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME];
GetPlayerName(playerplayernamesizeof(playername)); GetPlayerName(playeridadminnamesizeof(adminname));
new 
string2[100],string3[100];
format(string,sizeof(string),"| BvD-Admin | O(A) Administrador(a) %s baniu o(a) jogador(a) %s Por %i Hora(s) Pelo ( Motivo: %s )",adminname,playername,horas,params[strlen(tmp)+strlen(tmp2)+1],day,month,year,hour,minuite);
format(string3,sizeof(string3),"| BAN | Vocк foi banido temporariamente Pelo ( Motivo: %s )",params[4]);
format(string2,sizeof(string2),"| BAN | Sua conta serб desbanida automaticamente em %i hora(s)",horas);
SendClientMessageToAll(red,string);
SaveToFile("BanLog",string);
dUserSetINT(PlayerName2(player)).("tmpb",1);
dUserSetINT(PlayerName2(player)).("tmpbs",HourTimeStamp);
dUserSetINT(PlayerName2(player)).("tmpbh",horas);
SendClientMessage(player,COLOR_WHITE"| BAN | Vocк acaba de ser banido temporariamente do Servidor!");
SendClientMessage(player,COLOR_WHITEstring3);
SendClientMessage(player,COLOR_WHITEstring2);
SendClientMessage(player,COLOR_WHITE"| BAN | Caso tenha achado errado a atitude do admin,crie revisгo em nosso Fуrum.");
SendClientMessage(player,COLOR_WHITE"| BAN | Fуrum: www.ServerBvD.Forumeiros.com");
Kick(player);
return 
1;




Re: BanTemp para dias - Kamper - 28.08.2017

Multiplica as horas por 24 uй.


Re: BanTemp para dias - C4rtm4n - 28.08.2017

Quote:
By Kamper
Multiplica as horas por 24 uй

Faзa o que o kamper falou ou veja esse FS

https://sampforum.blast.hk/showthread.php?tid=603987


Re: BanTemp para dias - Pedro1812 - 29.08.2017

Quote:
Originally Posted by C4rtm4n
Посмотреть сообщение
Faзa o que o kamper falou ou veja esse FS

https://sampforum.blast.hk/showthread.php?tid=603987
como multiplico as horas?


Re: BanTemp para dias - RodrigoMSR - 29.08.2017

PHP код:
horas strval(tmp2) * 24



Re: BanTemp para dias - Pedro1812 - 29.08.2017

Quote:
Originally Posted by RodrigoMSR
Посмотреть сообщение
PHP код:
horas strval(tmp2) * 24
eu fiz isso.

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], Indextmp strtok(params,Index), tmp2 strtok(params,Index), tmp3 strtok(params,Index); 
if(!
strlen(params)) return SendClientMessage(playeridred"USO: /tempban [playerid] [dias] [motivo]"); 
new 
string[128]; 
new 
player,dias
player strval(tmp); 
dias strval(tmp2); 
if(
PlayerInfo[player][LoggedIn] != 1) return SendClientMessage(playeridred"| ERRO |: Jogador nгo esta logado"); 
if(!
IsPlayerConnected(player)) return SendClientMessage(playeridred"| ERRO |: Jogador nгo conectado"); 
if(
player == playerid) return SendClientMessage(playeridred"| ERRO |: Й seu ID, sua anta!"); 
if(
PlayerInfo[player][Level] >= 5) return SendClientMessage(playeridred"| ERRO |: Jogador й ADMIN! Porra!"); 
if(
dias 96) return SendClientMessage(playeridred"| ERRO |: Mбximo de Dias: 96"); 
if(
dias <= 0) return SendClientMessage(playeridred"| ERRO |: Mнnimo de dias: 1"); 
if(!
strlen(params[4])) return SendClientMessage(playeridred"| ERRO |: Vocк deve especificar um motivo"); 
CMDMessageToAdmins(playerid,"TEMPBAN"); 
new 
year,month,day,hour,minuite,secondgetdate(yearmonthday); gettime(hour,minuite,second); 
new 
playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME]; 
GetPlayerName(playerplayernamesizeof(playername)); GetPlayerName(playeridadminnamesizeof(adminname)); 
new 
string2[100],string3[100]; 
format(string,sizeof(string),"| BvD-Admin | O(A) Administrador(a) %s baniu o(a) jogador(a) %s Por %i Dia(s) Pelo ( Motivo: %s )",adminname,playername,dias,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 (%d Dias)",dias); 
SendClientMessageToAll(grey,string); 
SaveToFile("BanLog",string); 
dUserSetINT(PlayerName2(player)).("tmpb",1); 
dUserSetINT(PlayerName2(player)).("tmpbs",HourTimeStamp); 
dUserSetINT(PlayerName2(player)).("tmpbh",dias*24); 
SendClientMessage(playerred""); 
SendClientMessage(playeryellowstring3); 
SendClientMessage(playergreenstring2); 
SendClientMessage(playerred""); 
Kick(player); 
return 
1

Porem quando testei o mesmo nгo deu desban dps de 1 dia


Re: BanTemp para dias - RodrigoMSR - 29.08.2017

Entгo o problema estб no sistema, ou vocк contou errado, diga a hora e dia que vocк se auto baniu.


Re: BanTemp para dias - Pedro1812 - 29.08.2017

Quote:
Originally Posted by RodrigoMSR
Посмотреть сообщение
Entгo o problema estб no sistema, ou vocк contou errado, diga a hora e dia que vocк se auto baniu.
eu olhei no log a hora do ban,foi dia 27 as 15:03 e no dia 28 as 16:05 a conta estava banida ainda.


Re: BanTemp para dias - C4rtm4n - 29.08.2017

Amigo Re-faзa o Seu sistema em ZCMD ou YCMD й melhor.


Re: BanTemp para dias - RodrigoMSR - 29.08.2017

Manda o cуdigo que checa se o jogador estб temp-banido e faz o desbanimento.