Originally Posted by JoNhKaKa
Galera eu queria que pudessem me ajudar a concertar o sistema de banimento, que faz com que o player banido nгo consiga entrar no servidor.
Comandos de banimento:
pawn Код:
if(strcmp(cmd,"/banirnick",true) == 0) { tmp = strtok(cmdtext,idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_LARANJA2, "Digite: /banirnick [nome-do-jogador] [motivo]"); return 1; } for(new a=0; a < strlen(tmp); a++) { if((tmp[a] < 40 && tmp[a] != 36) || (tmp[a] > 41 && tmp[a] != 46 && tmp[a] < 48) || (tmp[a] > 57 && tmp[a] != 61 && tmp[a] < 64) || (tmp[a] > 91 && tmp[a] < 93) || (tmp[a] > 95 && tmp[a] < 97) || tmp[a] > 122) { SendClientMessage(playerid,COLOR_VERMELHO,"O nome que vocк deseja colocar possui carбcter(es) invбlido(s)!"); return 1; } } new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) result = "Nгo usou motivo"; if(strlen(result)>30) { SendClientMessage(playerid,COLOR_VERMELHO,"Vocк sу pode usar 30 carбcteres para o motivo!"); return 1; } if(!dini_Isset(BanFile,tmp)) { format(string, sizeof(string), "O %s %s(id:%d) baniu o nick %s por tempo ilimitado! Motivo: %s", admincargo[Stats[playerid][LEVELADMIN]],PlayerName(playerid),playerid,tmp,result); SendClientMessageToAll(COLOR_VERMELHO2,string); new year, month,day; getdate(year, month, day); new hora, minuto, segundo; gettime(hora,minuto,segundo); format(string, sizeof(string), "%s | \"%s\" | %s (%02d/%02d/%d) (%02d:%02d:%02d)", tmp,PlayerName(playerid), result, day ,month,year, hora,minuto,segundo); BanLog(); BanNomeEspecial(PlayerName(playerid),tmp,result); } else SendClientMessage(playerid,COLOR_VERMELHO,"Este nick jб estб banido!"); return 1; }
pawn Код:
if(strcmp(cmd,"/banir",true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_LARANJA2, "Digite: /banir [id-do-jogador] [motivo]"); return 1; } giveplayerid = strval(tmp); if(playerid != giveplayerid) { if(IsPlayerConnected(giveplayerid)) { if(Stats[giveplayerid][VIP]==0) { if(!IsPlayerAdmin(giveplayerid) && Stats[giveplayerid][LEVELADMIN] < 2) { for(new i = 0; i < TOTALPLAYERS; i ++) { if(IsPlayerAdmin(i) || Stats[i][LEVELADMIN] > 0) { if(i != playerid) { format(string, sizeof(string), "%s(id:%d) baniu %s(id:%d) permanente com o comando /banir.", PlayerName(playerid), playerid, PlayerName(giveplayerid), giveplayerid); SendClientMessage(i,COLOR_AZULFRACO,string); } } } new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) result = "Nгo usou motivo"; if(strlen(result)>30) { SendClientMessage(playerid,COLOR_VERMELHO,"Vocк sу pode usar 30 carбcteres para o motivo!"); return 1; } new year, month,day; getdate(year, month, day); new hora, minuto, segundo; gettime(hora,minuto,segundo); format(string, sizeof(string), "%s IP: %s | \"%s\" | %s (%02d/%02d/%d) (%02d:%02d:%02d)", PlayerName(giveplayerid), PlayerIp(giveplayerid),PlayerName(playerid), result, day ,month,year, hora,minuto,segundo); BanLog(); format(string, sizeof(string), "O %s %s(id:%d) baniu %s(id:%d) por tempo ilimitado! Motivo: %s", admincargo[Stats[playerid][LEVELADMIN]],PlayerName(playerid),playerid,PlayerName(giveplayerid), giveplayerid,result); SendClientMessageToAll(COLOR_VERMELHO2,string); BanPlayerEspecial(PlayerName(playerid),giveplayerid,result); } else SendClientMessage(playerid,COLOR_VERMELHO,"Vocк nгo pode banir um Administrador!"); } else SendClientMessage(playerid,COLOR_VERMELHO,"Vocк nгo pode banir um VIP!"); } else SendClientMessage(playerid,COLOR_VERMELHO,"Este jogador nгo estб conectado!"); } else SendClientMessage(playerid,COLOR_VERMELHO,"Vocк nгo pode usar este comando para si mesmo!"); return 1; }
pawn Код:
if(strcmp(cmd,"/banirt",true) == 0) { tmp = strtok(cmdtext, idx); new tmpp[256]; new tban = strval(tmpp); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_LARANJA2, "Digite: /banirt [id-do-jogador] [tempo] [motivo]"); return 1; } giveplayerid = strval(tmp); tmpp = strtok(cmdtext, idx); if(!strlen(tmpp)) { SendClientMessage(playerid, COLOR_LARANJA2, "Digite: /banirt [id-do-jogador] [tempo] [motivo]"); return 1; } tban = strval(tmpp); if(tban > 48 || tban < 1) { SendClientMessage(playerid,COLOR_VERMELHO,"Tempo invбlido! O tempo pode variar de 1 а 48 horas!"); return 1; } if(playerid != giveplayerid) { if(IsPlayerConnected(giveplayerid)) { if(Stats[giveplayerid][VIP]==0) { if(!IsPlayerAdmin(giveplayerid) && Stats[giveplayerid][LEVELADMIN]<TEMPORARIO) { for(new i = 0; i < TOTALPLAYERS; i ++) { if(IsPlayerAdmin(i) || Stats[i][LEVELADMIN] > 0) { if(i != playerid) { format(string, sizeof(string), "%s(id:%d) baniu %s(id:%d) com o comando /banirt.", PlayerName(playerid), playerid, PlayerName(giveplayerid), giveplayerid); SendClientMessage(i,COLOR_AZULFRACO,string); } } } new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) result = "Nгo usou motivo"; if(strlen(result)>30) { SendClientMessage(playerid,COLOR_VERMELHO,"Vocк sу pode usar 30 carбcteres para o motivo!"); return 1; } new year, month,day; getdate(year, month, day); new hora, minuto, segundo; gettime(hora,minuto,segundo); format(string, sizeof(string), "%s(id:%d) foi banido pelo %s %s(id:%d) durante %d horas! Motivo de: %s.", PlayerName(giveplayerid), giveplayerid, admincargo[Stats[playerid][LEVELADMIN]],PlayerName(playerid),playerid,tban,result); SendClientMessageToAll(COLOR_VERMELHO2, string); format(string, sizeof(string), "%s IP: %s | \"%s\" | %s (%02d/%02d/%d) (%02d:%02d:%02d)", PlayerName(giveplayerid), PlayerIp(giveplayerid),PlayerName(playerid), result, day ,month,year, hora,minuto,segundo); BanLog(); BanPlayerEspecial(PlayerName(playerid),giveplayerid,result,tban); } else { SendClientMessage(playerid,COLOR_VERMELHO,"Vocк nгo pode banir um Admin!"); SendClientMessage(playerid,COLOR_VERMELHO,"Como essa tentativa nгo й permitida pelo servidor, vocк foi kickado de forma justa!"); format(string, sizeof(string),"%s(id:%d) tentou BANIR-LHE e foi automaticamente combatido pelo servidor sendo kickado!",PlayerName(playerid),playerid); SendClientMessage(giveplayerid,COLOR_LARANJA2,string); Kick(playerid); } } else { SendClientMessage(playerid,COLOR_VERMELHO,"Vocк nгo pode banir um VIP!"); SendClientMessage(playerid,COLOR_VERMELHO,"Como essa tentativa nгo й permitida pelo servidor, vocк foi kickado de forma justa!"); format(string, sizeof(string),"%s(id:%d) tentou BANIR-LHE e foi automaticamente combatido pelo servidor sendo kickado!",PlayerName(playerid),playerid); SendClientMessage(giveplayerid,COLOR_LARANJA2,string); Kick(playerid); } } else SendClientMessage(playerid, COLOR_VERMELHO,"Este jogador nгo estб conectado!"); } else SendClientMessage(playerid,COLOR_VERMELHO,"Vocк nгo pode usar este comando para si mesmo!"); return 1; }
Aqui era para ser o sistema de banimento '-'
pawn Код:
new string1[256]; if(dini_Int("Administracao/Info_Banidos.ini", PlayerName(playerid))) { format(glob15010, 256, "%dStats", dini_Int("Administracao/Info_Banidos.ini", PlayerName(playerid))); format(string1, 256, "%dHora", dini_Int("Administracao/Info_Banidos.ini", PlayerName(playerid))); if(dini_Int("Administracao/Timer_Banidos.ini", string1)) { format(glob15010, 256, "Ban por mais %d hora(s). %s", dini_Int("Administracao/Timer_Banidos.ini", string1), dini_Int("Administracao/Timer_Banidos.ini", string1)); } else { format(glob15010, 256, "Ban permanente. %s", dini_Int("Administracao/Info_Banidos.ini", glob15010)); } SendClientMessage(playerid, 0xAFAFAFAA, glob15010); Kick(playerid); return 1; } if(dini_Int("Administracao/Info_Banidos.ini", PlayerName(playerid))) { format(glob15010, 256, "%dStats", dini_Int("Administracao/Info_Banidos.ini", PlayerName(playerid))); format(string1, 256, "%dHora", dini_Int("Administracao/Info_Banidos.ini", PlayerName(playerid))); if(dini_Int("Administracao/Timer_Banidos.ini", string1)) { format(glob15010, 256, "Ban por mais %d hora(s). %s", dini_Int("Administracao/Timer_Banidos.ini", string1), dini_Int("Administracao/Timer_Banidos.ini", string1)); } else { format(glob15010, 256, "Ban permanente. %s", dini_Int("Administracao/Info_Banidos.ini", glob15010)); } SendClientMessage(playerid, 0xAFAFAFAA, glob15010); Kick(playerid); return 1;
Por favor alguйm poderia me ajudar, eu nгo sou muito bom em PWN, estou aprendendo, jб pesquisei, mas nгo consegui arrumar, por favor, na moral.
|