14.10.2012, 16:51
Bom Galera eu vou entra no meu sv, ai entra um xiter que eu dou /banir nele ai ele volta, gostaria de um uma soluзгo para ele ficar banido para sempre.
if(strcmp(cmd, "/ban", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /ban [id] [motivo]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 4)
{
if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1342 && PlayerInfo[playerid][pAdmin] != 1341)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)");
return 1;
}
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[giveplayerid][pAdmin] >= 1340)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo pode banir um Admin Dono !");
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
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))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /ban [id] [motivo]");
return 1;
}
getdate(year, month, day);
if(admtrampando[playerid] == 1 && admhide[playerid] == 1)
{
format(string, sizeof(string), "AdmCmd: %s foi banido por Chuck(Modo Cia), Motivo: %s (%d-%d-%d)", giveplayer,(result),day,month,year);
//BanLog(string);
format(string, sizeof(string), "AdmCmd: %s foi banido por Chuck, Motivo: %s", giveplayer,(result));
SendClientMessageToAll(COLOR_LIGHTRED, string);
}
else
{
format(string, sizeof(string), "AdmCmd: %s foi banido por %s, Motivo: %s (%d-%d-%d)", giveplayer, sendername, (result),day,month,year);
BanLog(string);
format(string, sizeof(string), "AdmCmd: %s foi banido por %s, Motivo: %s", giveplayer, sendername, (result));
SendClientMessageToAll(COLOR_LIGHTRED, string);
}
SendClientMessage(giveplayerid, COLOR_WHITE, "{B5B5B5}|_B_M_|__ Instruзхes para revisгo de Ban __|_B_M_|");
SendClientMessage(giveplayerid, COLOR_YELLOW2, "Tire uma SS da tela apertando F8 imediatamente apуs ser banido");
SendClientMessage(giveplayerid, COLOR_YELLOW2, "E acesse o nosso forum: www.brasilmultiplayer.forumeiros.com");
SendClientMessage(giveplayerid, COLOR_LIGHTRED, "Atenзгo: Vocк sу serб desbanido caso for inocente");
//Ban(giveplayerid);
SBan(giveplayerid, result, sendername);
return 1;
}
}//not connected
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Esse nгo й um jogador ativo.");
}
}
return 1;
}
if(strcmp(cmd, "/ban", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /ban [id] [motivo]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 4)
{
if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1342 && PlayerInfo[playerid][pAdmin] != 1341)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)");
return 1;
}
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[giveplayerid][pAdmin] >= 1340)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo pode banir um Admin Dono !");
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
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))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /ban [id] [motivo]");
return 1;
}
getdate(year, month, day);
if(admtrampando[playerid] == 1 && admhide[playerid] == 1)
{
format(string, sizeof(string), "AdmCmd: %s foi banido por Chuck(Modo Cia), Motivo: %s (%d-%d-%d)", giveplayer,(result),day,month,year);
//BanLog(string);
format(string, sizeof(string), "AdmCmd: %s foi banido por Chuck, Motivo: %s", giveplayer,(result));
SendClientMessageToAll(COLOR_LIGHTRED, string);
}
else
{
format(string, sizeof(string), "AdmCmd: %s foi banido por %s, Motivo: %s (%d-%d-%d)", giveplayer, sendername, (result),day,month,year);
BanLog(string);
format(string, sizeof(string), "AdmCmd: %s foi banido por %s, Motivo: %s", giveplayer, sendername, (result));
SendClientMessageToAll(COLOR_LIGHTRED, string);
}
SendClientMessage(giveplayerid, COLOR_WHITE, "{B5B5B5}|_B_M_|__ Instruзхes para revisгo de Ban __|_B_M_|");
SendClientMessage(giveplayerid, COLOR_YELLOW2, "Tire uma SS da tela apertando F8 imediatamente apуs ser banido");
SendClientMessage(giveplayerid, COLOR_YELLOW2, "E acesse o nosso forum: www.brasilmultiplayer.forumeiros.com");
SendClientMessage(giveplayerid, COLOR_LIGHTRED, "Atenзгo: Vocк sу serб desbanido caso for inocente");
Ban(giveplayerid);
//SBan(giveplayerid, result, sendername);
return 1;
}
}//not connected
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Esse nгo й um jogador ativo.");
}
}
return 1;
}
public SBan(playerid, string[], string2[])
{
new arquivo[64], tmp[20], tmp2[20], stri[64], ip[16];
GetPlayerIp(playerid, ip, sizeof ip);
format(arquivo, sizeof(arquivo), "Banidos/%s.ini",PlayerName(playerid));
getdate(Ano, Mes, Dia);
format(tmp, 20, "%d/%d/%d", Dia, Mes, Ano);
gettime(Hora, Minuto, Segundo);
format(tmp2, 20, "%d:%d:%d", Hora, Minuto, Segundo);
format(gstring, 128, "[%d/%d/%d] [%d:%d:%d] %s IP:%s foi banido pelo admin %s, motivo: %s", v[2], v[1], v[0], v[3], v[4], v[5], PlayerName(playerid),
ip, string2, string);
SBanLog(gstring);
if(dini_Exists(arquivo))
{
Kick(playerid);
}
else
{
dini_Create(arquivo);
dini_Set(arquivo,"Motivo",string);
dini_Set(arquivo,"Admin",string2);
dini_Set(arquivo,"Data",tmp);
dini_Set(arquivo,"Hora",tmp2);
format(stri, sizeof(stri), "IPsBanidos/%s.ini",ip);
dini_Create(stri);
dini_Set(stri,"Motivo",string);
dini_Set(stri,"Admin",string2);
dini_Set(stri,"Data",tmp);
dini_Set(stri,"Hora",tmp2);
dini_Set(stri,"Nick",PlayerName(playerid));
Kick(playerid);
}
return 1;
}