AR/getBanAdmin: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{Server function}} This function will return the responsible admin (nickname of the admin) of the specified ban. ==Syntax== <syntaxhighlight lang="lua"> string getBanAdmin ( b...")
 
No edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
{{Server function}}
{{Server function}}
This function will return the responsible admin (nickname of the admin) of the specified [[ban]].
هذه الوظيفة تحضر اسم الشخص الذي بند , في الباند المحدد


==Syntax==  
==Syntax==  
Line 9: Line 9:


===Required Arguments===  
===Required Arguments===  
*'''theBan:''' The [[ban]] you want to return the admin of.
*'''theBan:''' الباند الذي تريد ان تعرف اسم الادمن المبند منه
 
===Returns===
===Returns===
Returns a ''string'' of the admin if everything was successful, ''false'' if invalid arguments are specified if there was no admin specified for the [[ban]].
Returns a ''string'' of the admin if everything was successful, ''false'' if invalid arguments are specified if there was no admin specified for the [[ban]].


==Example==
==مثال==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function outputBan(ban)
function outputBan(ban)
local banned = getBanNick(ban) -- Get the name of the player who was banned
local banned = getBanNick(ban) -- احضار اسم المتبند
local banner = getBanAdmin(ban) -- Get the name of the admin who banned the player
local banner = getBanAdmin(ban) -- احضار اسم الادمن اللذي بند
local reason = getBanReason(ban) -- Get the reason the player was banned
local reason = getBanReason(ban) -- احضار سبب الباند
outputChatBox("-----BAN-----",getRootElement(),255,0,0)
outputChatBox("-----BAN-----",getRootElement(),255,0,0)
if (banned) then
if (banned) then
outputChatBox("Player banned: "..banned,getRootElement(),255,0,0) -- Output the player name who was banned
outputChatBox("Player banned: "..banned,getRootElement(),255,0,0) -- يضع بالشات اسم الشخص المتبند
end
end
if (banner) then
if (banner) then
outputChatBox("Banner: "..banner,getRootElement(),255,0,0) -- Output the admin name who performed the ban
outputChatBox("Banner: "..banner,getRootElement(),255,0,0) -- يضع بالشات اسم الشخص الذي بند
end
end
if (reason) then
if (reason) then
outputChatBox("Reason: "..reason,getRootElement(),255,0,0) -- outputt the reason the player was banned
outputChatBox("Reason: "..reason,getRootElement(),255,0,0) -- يضع بالشات سبب الباند
end
end
end
end
addEventHandler("onBan",getRootElement(),outputBan) -- When a player is banned trigger the outputBan function
addEventHandler("onBan",getRootElement(),outputBan)
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==أنظر ايضاً==
{{Admin functions}}
{{AR/Admin_functions}}
[[ru:getBanAdmin]]
[[ru:getBanAdmin]]

Latest revision as of 00:29, 11 December 2012

هذه الوظيفة تحضر اسم الشخص الذي بند , في الباند المحدد

Syntax

string getBanAdmin ( ban theBan )

Required Arguments

  • theBan: الباند الذي تريد ان تعرف اسم الادمن المبند منه

Returns

Returns a string of the admin if everything was successful, false if invalid arguments are specified if there was no admin specified for the ban.

مثال

function outputBan(ban)
	local banned = getBanNick(ban) -- احضار اسم المتبند
	local banner = getBanAdmin(ban) -- احضار اسم الادمن اللذي بند
	local reason = getBanReason(ban) -- احضار سبب الباند
	outputChatBox("-----BAN-----",getRootElement(),255,0,0)
	if (banned) then
		outputChatBox("Player banned: "..banned,getRootElement(),255,0,0) -- يضع بالشات اسم الشخص المتبند
	end
	if (banner) then
		outputChatBox("Banner: "..banner,getRootElement(),255,0,0) -- يضع بالشات اسم الشخص الذي بند
	end
	if (reason) then
		outputChatBox("Reason: "..reason,getRootElement(),255,0,0) -- يضع بالشات سبب الباند
	end
end
addEventHandler("onBan",getRootElement(),outputBan)

أنظر ايضاً