Help with this commands!
#4

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;
}
Reply


Messages In This Thread
[Solved] Help with this commands! - by FullCircle - 19.06.2014, 23:08
Re: Help with this commands! - by Scrillex - 20.06.2014, 00:25
Respuesta: Re: Help with this commands! - by FullCircle - 20.06.2014, 00:40
Respuesta: Help with this commands! - by FullCircle - 20.06.2014, 18:48

Forum Jump:


Users browsing this thread: 1 Guest(s)