09.10.2012, 23:40
Bom jб criei os sistema de ban talz stock e tudo mas porйm falta criar o comando /ban e / desban alguйm pode me ajudar.
OBS: Reputaзгo para quem me ajuda e tem que ser zcmd.
pawn Код:
#define LOCALBANNICK "/Nicks banidos/%s.cfg"
#define LOCALBANIP "/IPs banidos/%s.cfg"
new DSName[MAX_PLAYER_NAME];
new Don[150];
stock BanId(playerid,motivo[])
{
GetPlayerName(playerid,DSName,sizeof(DSName));
format(Don,sizeof(Don),"-Aviso- O jogador %s foi banido [Motivo: %s]",DSName, motivo);
SendClientMessageToAll(-1,Don);
Kick(playerid);
}
stock BanNick(playerid,motivo[])
{
GetPlayerName(playerid,DSName,sizeof(DSName));
format(Don,sizeof(Don),LOCALBANNICK,DSName);
DOF2_CreateFile(Don);
DOF2_SetInt(Don, "Motivo", motivo);
format(Don,sizeof(Don),"-Aviso- O jogador %s foi banido [Motivo: %s]",DSName, motivo);
SendClientMessageToAll(-1,Don);
Kick(playerid);
}
stock BanIP(playerid,motivo[])
{
GetPlayerIp(playerid,IP,sizeof(IP));
format(Don,sizeof(Don),LOCALBANIP,IP);
DOF2_CreateFile(Don);
DOF2_SetInt(Don, "Motivo", motivo);
format(Don,sizeof(Don),"-Aviso- O IP %i foi banido [Motivo: %s]",IP, motivo);
SendClientMessageToAll(-1,Don);
Kick(playerid);
}
stock BanNickOff(Nick,motivo[])
{
format(Don,sizeof(Don),LOCALBANNICK,Nick);
DOF2_CreateFile(Don);
DOF2_SetInt(Don, "Motivo", motivo);
format(Don,sizeof(Don),"-Aviso- O Nick %s foi banido-off [Motivo: %s]",Nick, motivo);
SendClientMessageToAll(-1,Don);
Kick(playerid);
}
stock BanIPOFF(IP,motivo[])
{
format(Don,sizeof(Don),LOCALBANIP,IP);
DOF2_CreateFile(Don);
DOF2_SetInt(Don, "Motivo", motivo);
format(Don,sizeof(Don),"-Aviso- O IP %i foi banido-off [Motivo: %s]",IP, motivo);
SendClientMessageToAll(-1,Don);
}
stock UnBanNick(Nome)
{
format(Don,sizeof(Don),LOCALBANNICK,Nome);
if(!DOF2_FileExists(Don))return SendClientMessage(playerid, -1,"[ERRO] Conta nao banida.");
DOF2_RemoveFile(Don);
format(Don,sizeof(Don),"-Aviso- O nick %s acaba de ser desbanido.",Nome);
SendClientMessageToAll(-1,Don);
}
stock UnBanIP(IP)
{
format(Don,sizeof(Don),LOCALBANIP,IP);
if(!DOF2_FileExists(Don))return SendClientMessage(playerid, -1,"[ERRO] Conta nao banida.");
DOF2_RemoveFile(Don);
format(Don,sizeof(Don),"-Aviso- O ip %i acaba de ser desbanido.",IP);
SendClientMessageToAll(-1,Don);
}
stock CheckBan(playerid)
{
new Don2[150];
GetPlayerIp(playerid,IP,sizeof(IP));
format(Don,sizeof(Don),LOCALBANIP,IP);
if(!DOF2_FileExists(Don))
{
SendClientMessage(playerid,-1,"-Aviso- Voce esta banido");
Kick(playerid);
}
GetPlayerName(playerid,DSName,sizeof(DSName));
format(Don2,sizeof(Don2),LOCALBANNICK,DSName);
if(!DOF2_FileExists(Don2))
{
SendClientMessage(playerid,-1,"-Aviso- Voce esta banido");
Kick(playerid);
}
}