Ayuda con йste comando
#1

їQuй tendrнa mal йste comando?

Код:
COMMAND:warn(playerid,params[])
{
    if(PlayerInfo[playerid][AdminLevel] >= LEVEL_warn)
	{
 		new player, reason[128];
		if(sscanf(params, "rs[128]", player, reason))
		{
			SendClientMessage(playerid,RED,"usa /warn id razon");
		    return 1;
		}

		if(PlayerInfo[player][AdminLevel] == MAX_ADMIN_LEVEL)
		{
			SendClientMessage(playerid,RED,"no puedes sancionar a este admin");
			return 1;
		}
	 	if(IsPlayerConnected(player) && player != INVALID_PLAYER_ID && player != playerid)
	 	{
	 	    new string[128];
			PlayerInfo[player][Warnings]++;
			if(PlayerInfo[player][Warnings] == MAX_WARNINGS)
			{
				format(string, sizeof(string), "\"%s\" ha sido kickeado. Razуn: %s (Advertencia: %d/%d)", GetName(player), reason, PlayerInfo[player][Warnings], MAX_WARNINGS);
				SendClientMessageToAll(GREY, string);
				PlayerInfo[player][KickCount]++;
   		        #if PRINT_BYKICK == true
		        printf("[KICK]: %s has been kicked", GetName(player));
    			#endif
				Kick(player);
			}
			else
			{
				format(string, sizeof(string), "\"%s\" ha sido advertido. Razуn: %s (Advertencia: %d/%d)", GetName(player), reason, PlayerInfo[player][Warnings], MAX_WARNINGS);
				SendClientMessageToAll(YELLOW, string);
			}
		}
		else
		{
			SendClientMessage(playerid, RED, "El jugador no estб conectado o no vбlido o eres tu mismo");
		}
	}
	else
	{
		SendClientMessage(playerid, RED, NO_PERM);
	}
	return 1;
}
al colocar el id de un jugador que NO estй conectado y la razуn sale un mensaje que dice "Unknown command." en vez de salir el mensaje de
Код:
SendClientMessage(playerid, RED, "El jugador no estб conectado o no vбlido o eres tu mismo");
їQuй estoy haciendo mal?
Reply
#2

up! Ayuda por favor.
Reply
#3

Intenta hacн

pawn Код:
COMMAND:warn(playerid,params[])
{
    if(PlayerInfo[playerid][AdminLevel] >= LEVEL_warn)
    {
        new player, reason[128];
        if(sscanf(params, "rs[128]", player, reason))
        {
            SendClientMessage(playerid,RED,"usa /warn id razon");
            return 1;
        }

        if(PlayerInfo[player][AdminLevel] == MAX_ADMIN_LEVEL)
        {
            SendClientMessage(playerid,RED,"no puedes sancionar a este admin");
            return 1;
        }
        if(IsPlayerConnected(player) && player != INVALID_PLAYER_ID)
        {
            new string[128];
            PlayerInfo[player][Warnings]++;
            if(PlayerInfo[player][Warnings] == MAX_WARNINGS)
            {
                format(string, sizeof(string), "\"%s\" ha sido kickeado. Razуn: %s (Advertencia: %d/%d)", GetName(player), reason, PlayerInfo[player][Warnings], MAX_WARNINGS);
                SendClientMessageToAll(GREY, string);
                PlayerInfo[player][KickCount]++;
                #if PRINT_BYKICK == true
                printf("[KICK]: %s has been kicked", GetName(player));
                #endif
                Kick(player);
            }
            else
            {
                format(string, sizeof(string), "\"%s\" ha sido advertido. Razуn: %s (Advertencia: %d/%d)", GetName(player), reason, PlayerInfo[player][Warnings], MAX_WARNINGS);
                SendClientMessageToAll(YELLOW, string);
            }
        }
        else
        {
            SendClientMessage(playerid, RED, "El jugador no estб conectado o no vбlido o eres tu mismo");
        }
    }
    else
    {
        SendClientMessage(playerid, RED, NO_PERM);
    }
    return 1;
}
Reply
#4

Me sale exactamente igual amigo, sуlo que ahora si me puedo dar warning a mi mismo... no se por que sale SERVER: Unknown command.
Reply
#5

Y Haci?

pawn Код:
COMMAND:warn(playerid,params[])
{
    if(PlayerInfo[playerid][AdminLevel] >= LEVEL_warn)
    {
        new player, reason[128];
        if(sscanf(params, "rs[128]", player, reason))
        {
            SendClientMessage(playerid,RED,"usa /warn id razon");
            return 1;
        }

        if(PlayerInfo[player][AdminLevel] == MAX_ADMIN_LEVEL)
        {
            SendClientMessage(playerid,RED,"no puedes sancionar a este admin");
            return 1;
        }
                if(player != INVALID_PLAYER_ID )
               {
SendClientMessage(playerid,RED,"Jugador No Valido");
return 1;
               }
        if(IsPlayerConnected(player) && player != playerid)
        {
            new string[128];
            PlayerInfo[player][Warnings]++;
            if(PlayerInfo[player][Warnings] == MAX_WARNINGS)
            {
                format(string, sizeof(string), "\"%s\" ha sido kickeado. Razуn: %s (Advertencia: %d/%d)", GetName(player), reason, PlayerInfo[player][Warnings], MAX_WARNINGS);
                SendClientMessageToAll(GREY, string);
                PlayerInfo[player][KickCount]++;
                #if PRINT_BYKICK == true
                printf("[KICK]: %s has been kicked", GetName(player));
                #endif
                Kick(player);
            }
            else
            {
                format(string, sizeof(string), "\"%s\" ha sido advertido. Razуn: %s (Advertencia: %d/%d)", GetName(player), reason, PlayerInfo[player][Warnings], MAX_WARNINGS);
                SendClientMessageToAll(YELLOW, string);
            }
        }
        else
        {
            SendClientMessage(playerid, RED, "El jugador no estб conectado o no vбlido o eres tu mismo");
        }
    }
    else
    {
        SendClientMessage(playerid, RED, NO_PERM);
    }
    return 1;
}
Reply
#6

Tuve que hacer el comando de otra forma, tratй de mil maneras pero siempre al colocar un id que no estuviera conectado reconocнa el comando como no existente el samp por defecto (SERVER: Unknown command.") y no supe por que... :S de todas formas gracias
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)