AR/getBanIP: 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 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}}
This function will return the IP of the specified [[ban]].
هذه الوظيفة تبحث عن الاي بي الخاص بالشخص المتبند في الباند المحدد


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


===Required Arguments===  
===Required Arguments===  
*'''theBan:''' The [[ban]] in which you want to return the IP of.
*'''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]].


==Example==
==مثال==
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 the command user has the rights
     if ( hasObjectPermissionTo ( thisPlayer, "function.banPlayer" ) ) then -- اذا الشخص كاتب الكلمة لديه التصريحات الكافية للتبنيد
         local bannedPlayer = getPlayerFromNick ( bannedName ) -- Get the ID from the player who gets banned
         local bannedPlayer = getPlayerFromNick ( bannedName ) -- احضار اسم المتبند
         if getElementType ( bannedPlayer ) == "player" then -- If it's a player
         if getElementType ( bannedPlayer ) == "player" then -- اذا كان الشخص المتبند لاعب
             local theBan = banPlayer ( bannedPlayer, thisPlayer, reason ) -- Ban the player
             local theBan = banPlayer ( bannedPlayer, thisPlayer, reason ) -- يبند الاعب
             outputChatBox ( "ban: " .. bannedName .. " successfully banned", thisPlayer ) -- Send the banner a succes message
             outputChatBox ( "ban: " .. bannedName .. " successfully banned", thisPlayer )-- يرسل للشخص المبند ان الشخص المتبند تم تبنيده بنجاح في الشات
             outputChatBox ( "At IP Adress: " ..getBanIP ( theBan ), thisPlayer ) -- And send him the IP adress of the banned player
             outputChatBox ( "At IP Adress: " ..getBanIP ( theBan ), thisPlayer ) -- يرسل اي بي اللاعب المتبند للشخص الذي بنده في الشات
         end
         end
     else
     else
         outputChatBox ( "ban: You don't have enough permissions", thisPlayer ) -- If the command user doesn't have the permissions
         outputChatBox ( "ban: You don't have enough permissions", thisPlayer ) -- اذا كان الشخص المبند لا يحمل التصريحات الكافية , يرسل بالشات بانه ليس لديه التصريحات الكافية للتبنيد
     end
     end
end
end
addCommandHandler ( "ban", banPlayerCommand )
addCommandHandler("ban", banPlayerCommand)
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==أنظر ايضاً==
{{Admin functions}}
{{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)

أنظر ايضاً