[Solved] Help with this commands! -
FullCircle - 19.06.2014
Код:
CMD:kick(playerid, params[])
{
new string[128], ID, razon;
if(IsPlayerConnected(playerid))
{
if(Informacion[playerid][Admin] < 2) return SendClientMessage(playerid,COLOR_GRIS,"No Autorizado.");
{
if(!sscanf(params, "ds", ID, razon))
{
format(string,sizeof(string),"El usuario %s fue expulsado por el administrador %s. Razуn: %s", NombreJ(ID), NombreJ(playerid), razon);
BroadCast(COLOR_AMARILLOADMIN, string);
Kick(ID);
printf("[ADMIN] %s kickeу a %s. Razуn: %s.", NombreJ(playerid), NombreJ(ID), razon);
Logs("Seguridad", string);
}
else return SendClientMessage(playerid, COLOR_GRIS, "/kick <id> <Razуn>");
}
}
return 1;
}
Код:
CMD:ban(playerid, params[])
{
new string[128], ID, razon, PlayerIP[15];
if(IsPlayerConnected(playerid))
{
if(Informacion[playerid][Admin] < 3) return SendClientMessage(playerid,COLOR_GRIS,"No Autorizado.");
{
if(!sscanf(params, "ds", ID, razon))
{
Informacion[playerid][ban] = 1;
format(string,sizeof(string),"El usuario %s fue baneado por el administrador %s. Razуn: %s", NombreJ(ID), NombreJ(playerid), razon);
BroadCast(COLOR_AMARILLOADMIN, string);
Kick(ID);
printf("[ADMIN] %s baneу a %s. Razуn: %s.", NombreJ(playerid), NombreJ(ID), razon);
Logs("Seguridad", string);
new File:BanIp = fopen("BanIp.txt", io_read);
if(BanIp)
{
GetPlayerIp(ID, PlayerIP, sizeof(PlayerIP));
fwrite(BanIp, PlayerIP);
fclose(BanIp);
}
}
else return SendClientMessage(playerid, COLOR_GRIS, "/ban <id> <Razуn>");
}
}
return 1;
}
No bans, and no kicks...
And in the Console and logs show this:
Thanks, sorry for my bad english
Re: Help with this commands! -
Scrillex - 20.06.2014
ahh my bad didnt saw that... You have kick playerid...
Respuesta: Re: Help with this commands! -
FullCircle - 20.06.2014
Its a Joke?
Respuesta: Help with this commands! -
FullCircle - 20.06.2014
I Fixed It:
Код:
CMD:kick(playerid, params[])
{
new string[128], ID, razon[128];
if(IsPlayerConnected(playerid))
{
if(Informacion[playerid][Admin] < 2) return SendClientMessage(playerid,COLOR_GRIS,"No Autorizado.");
{
if(!sscanf(params, "ds[128]", ID, razon))
{
KickEx(ID);
format(string,sizeof(string),"El usuario %s fue expulsado por el administrador %s. Razуn: %s", NombreJ(ID), NombreJ(playerid), razon);
BroadCast(COLOR_AMARILLOADMIN, string);
printf("[ADMIN] %s kickeу a %s. Razуn: %s.", NombreJ(playerid), NombreJ(ID), razon);
Logs("Seguridad", string);
}
else return SendClientMessage(playerid, COLOR_GRIS, "/kick <id> <Razуn>");
}
}
return 1;
}
CMD:ban(playerid, params[])
{
new string[128], ID, razon[128], PlayerIP[16], IP[16];
if(IsPlayerConnected(playerid))
{
if(Informacion[playerid][Admin] < 3) return SendClientMessage(playerid,COLOR_GRIS,"No Autorizado.");
{
if(!sscanf(params, "ds[128]", ID, razon))
{
Informacion[ID][ban] = 2;
format(string,sizeof(string),"El usuario %s fue baneado por el administrador %s. Razуn: %s", NombreJ(ID), NombreJ(playerid), razon);
BroadCast(COLOR_AMARILLOADMIN, string);
KickEx(ID);
printf("[ADMIN] %s baneу a %s. Razуn: %s.", NombreJ(playerid), NombreJ(ID), razon);
Logs("Seguridad", string);
new File:BansRead = fopen("BanIp.txt", io_read);
if(BansRead)
{
fread(BansRead, IP);
if(strcmp(IP, PlayerIP, false) == 0)
{
new File:Bans = fopen("BanIp.txt", io_append);
if(Bans)
{
GetPlayerIp(ID, PlayerIP, sizeof(PlayerIP));
format(string,sizeof(string),"%s\r\n", PlayerIP);
fwrite(Bans, string);
fclose(Bans);
}
}
}
}
else return SendClientMessage(playerid, COLOR_GRIS, "/ban <id> <Razуn>");
}
}
return 1;
}