ES/banPlayer

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Esta función banea a un jugador por su IP, serial o nombre.

Sintaxis

ban banPlayer ( player jugadorABanear, [ bool IP = true, bool nombre = false, bool serial = false, 
player responsable = nil, string razón = nil, int segundos = 0 ] )

Argumentos Requeridos

  • jugadorABanear: El jugador al que se quiere banear de un servidor.

Argumentos Opcionales

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.

  • IP: Un valor lógico que representa si se banea la IP del jugador.
  • Username: Un valor lógico que representa si se banea el nombre del jugador.
  • Serial: Un valor lógico que representa si se banea la serial del jugador.
Note: Para banear por nombre o por serial, verifyserials tiene que estar habilitado en el archivo de configuración del servidor (mtaserver.conf).
  • responsable: El jugador responsable del baneo. Puede ser un jugador o el elemento raíz (getRootElement)
  • razón: La razón por la cual el jugador fue baneado.
  • segundos: El tiempo(en segundos) que va a estar baneado el jugador. Si se usa 0 entonces es una cantidad indefinida de tiempo.

Devuelve

Devuelve un elemento ban si el jugador fue banneado satisfactoriamente, de lo contrario devuelve false.

Ejemplos

Este ejemplo permite a un jugador banear a cualquiera si tiene los permisos en el ACL.

--Add the "ban" command handler
-- Example with the player
function banPlayerCommand ( theClient, commandName, bannedName, reason )

	-- Give the player a nice error if he doesn't have rights
	if ( hasObjectPermissionTo ( theClient, "function.banPlayer" ) ) then
		--Get player element from the name
		local bannedPlayer = getPlayerFromNick ( bannedName )

		--Ban the player
		banPlayer ( bannedPlayer, theClient, reason )
		outputChatBox ( "ban: " .. bannedName .. " successfully banned", theClient )

	else
		outputChatBox ( "ban: You don't have enough permissions", theClient )
	end

end
addCommandHandler ( "ban", banPlayerCommand )

-- Example function with the root element. Here you would pass a player element to the function.
function banCheater(theCheater)
	banPlayer(theCheater, getRootElement(), "You are banned because of cheating.")
end

See Also

BEFORE VERSION 1.0 :