AR/getBanReason: Difference between revisions
Jump to navigation
Jump to search
(Created page with "__NOTOC__ {{Server function}} This function will return the ban reason of the specified ban. ==Syntax== <syntaxhighlight lang="lua"> string getBanReason ( ban theBan ) </syntaxhighlight> ===Requir...") |
No edit summary |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server function}} | {{Server function}} | ||
هذه الوظيفة ستُحضر سبب الباند المحدد | |||
==Syntax== | ==Syntax== | ||
Line 9: | Line 9: | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''theBan:''' | *'''theBan:''' الباند اللذي تريد احضارب سببه | ||
===Returns=== | ===Returns=== | ||
Returns a ''string'' of the reason if everything was successful, ''false'' if invalid arguments are specified if there was no reason specified for the [[ban]]. | Returns a ''string'' of the reason if everything was successful, ''false'' if invalid arguments are specified if there was no reason specified for the [[ban]]. | ||
== | ==مثال== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function outputBan(ban) | function outputBan(ban) | ||
local banned = getBanNick(ban) -- | local banned = getBanNick(ban) -- احضار اسم الشخص المتبند | ||
local banner = getBanAdmin(ban) -- | local banner = getBanAdmin(ban) -- احضار اسم الادمن الي بنده | ||
local reason = getBanReason(ban) -- | 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) -- | outputChatBox("Player banned: "..banned,getRootElement(),255,0,0) -- يضع بالشات اسم المتبند | ||
end | end | ||
if (banner) then | if (banner) then | ||
outputChatBox("Banner: "..banner,getRootElement(),255,0,0) -- | outputChatBox("Banner: "..banner,getRootElement(),255,0,0) -- يضع بالشات اسم الادمن اللذي بنده | ||
end | end | ||
if (reason) then | if (reason) then | ||
outputChatBox("Reason: "..reason,getRootElement(),255,0,0) -- | outputChatBox("Reason: "..reason,getRootElement(),255,0,0) -- يضع بالشات سبب الباند | ||
end | end | ||
end | end | ||
addEventHandler("onBan",getRootElement(),outputBan) -- | addEventHandler("onBan",getRootElement(),outputBan) --وقت بداء الوظيفه و هي عندما يتبند شخص | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== | ==أنظر ايضاً== | ||
{{ | {{AR/Admin_functions}} | ||
[[ru:getBanReason]] | [[ru:getBanReason]] |
Latest revision as of 00:13, 11 December 2012
هذه الوظيفة ستُحضر سبب الباند المحدد
Syntax
string getBanReason ( ban theBan )
Required Arguments
- theBan: الباند اللذي تريد احضارب سببه
Returns
Returns a string of the reason if everything was successful, false if invalid arguments are specified if there was no reason 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) --وقت بداء الوظيفه و هي عندما يتبند شخص