AR/getBanIP

From Multi Theft Auto: Wiki
Revision as of 17:56, 21 October 2012 by MJNONFIK (talk | contribs) (→‎Example)
Jump to navigation Jump to search

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 )

See Also