AR/getBanIP: Difference between revisions
Jump to navigation
Jump to search
(→Syntax) |
|||
Line 14: | Line 14: | ||
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 |
Revision as of 17:56, 21 October 2012
This function will return the IP of the specified ban.
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 )