AR/getBanIP: Difference between revisions
Jump to navigation
Jump to search
(Created page with "__NOTOC__ {{Server function}} This function will return the IP of the specified ban. ==Syntax== <syntaxhighlight lang="lua"> string getBanIP ( ban theBan ) </syntaxhighlight> ===Required Arguments...") |
No edit summary |
||
(3 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 IP if everything was successful, ''false'' if invalid arguments are specified if there was no IP specified for the [[ban]]. | Returns a ''string'' of the IP if everything was successful, ''false'' if invalid arguments are specified if there was no IP specified for the [[ban]]. | ||
== | ==مثال== | ||
This example will show the user who banned a player the IP adress of that banned player. | This example will show the user who banned a player the IP adress of that banned player. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function banPlayerCommand ( thisPlayer, commandName, bannedName, reason ) | function banPlayerCommand ( thisPlayer, commandName, bannedName, reason ) | ||
if ( hasObjectPermissionTo ( thisPlayer, "function.banPlayer" ) ) then -- | if ( hasObjectPermissionTo ( thisPlayer, "function.banPlayer" ) ) then -- اذا الشخص كاتب الكلمة لديه التصريحات الكافية للتبنيد | ||
local bannedPlayer = getPlayerFromNick ( bannedName ) -- | local bannedPlayer = getPlayerFromNick ( bannedName ) -- احضار اسم المتبند | ||
if getElementType ( bannedPlayer ) == "player" then -- | if getElementType ( bannedPlayer ) == "player" then -- اذا كان الشخص المتبند لاعب | ||
local theBan = banPlayer ( bannedPlayer, thisPlayer, reason ) -- | local theBan = banPlayer ( bannedPlayer, thisPlayer, reason ) -- يبند الاعب | ||
outputChatBox ( "ban: " .. bannedName .. " successfully banned", thisPlayer ) -- | outputChatBox ( "ban: " .. bannedName .. " successfully banned", thisPlayer )-- يرسل للشخص المبند ان الشخص المتبند تم تبنيده بنجاح في الشات | ||
outputChatBox ( "At IP Adress: " ..getBanIP ( theBan ), thisPlayer ) -- | outputChatBox ( "At IP Adress: " ..getBanIP ( theBan ), thisPlayer ) -- يرسل اي بي اللاعب المتبند للشخص الذي بنده في الشات | ||
end | end | ||
else | else | ||
outputChatBox ( "ban: You don't have enough permissions", thisPlayer ) -- | outputChatBox ( "ban: You don't have enough permissions", thisPlayer ) -- اذا كان الشخص المبند لا يحمل التصريحات الكافية , يرسل بالشات بانه ليس لديه التصريحات الكافية للتبنيد | ||
end | end | ||
end | end | ||
addCommandHandler ( "ban", banPlayerCommand ) | addCommandHandler("ban", banPlayerCommand) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== | ==أنظر ايضاً== | ||
{{ | {{AR/Admin_functions}} | ||
[[ru:getBanIP]] | [[ru:getBanIP]] |
Latest revision as of 00:24, 11 December 2012
هذه الوظيفة تبحث عن الاي بي الخاص بالشخص المتبند في الباند المحدد
Syntax
string getBanIP ( ban theBan )
Required Arguments
- theBan: الباند الذي تريد احضار ايبي الشخص المتبند منه
Returns
Returns a string of the IP if everything was successful, false if invalid arguments are specified if there was no IP specified for the ban.
مثال
This example will show the user who banned a player the IP adress of that banned player.
function banPlayerCommand ( thisPlayer, commandName, bannedName, reason ) if ( hasObjectPermissionTo ( thisPlayer, "function.banPlayer" ) ) then -- اذا الشخص كاتب الكلمة لديه التصريحات الكافية للتبنيد local bannedPlayer = getPlayerFromNick ( bannedName ) -- احضار اسم المتبند if getElementType ( bannedPlayer ) == "player" then -- اذا كان الشخص المتبند لاعب local theBan = banPlayer ( bannedPlayer, thisPlayer, reason ) -- يبند الاعب outputChatBox ( "ban: " .. bannedName .. " successfully banned", thisPlayer )-- يرسل للشخص المبند ان الشخص المتبند تم تبنيده بنجاح في الشات outputChatBox ( "At IP Adress: " ..getBanIP ( theBan ), thisPlayer ) -- يرسل اي بي اللاعب المتبند للشخص الذي بنده في الشات end else outputChatBox ( "ban: You don't have enough permissions", thisPlayer ) -- اذا كان الشخص المبند لا يحمل التصريحات الكافية , يرسل بالشات بانه ليس لديه التصريحات الكافية للتبنيد end end addCommandHandler("ban", banPlayerCommand)