Jump to content

restrict player world..


Guest Bardokas

Recommended Posts

Posted

Function would player didn't let left zone, like SetPlayerWorldBounds in SA:MP

And remove hardcoded /login command, because some people didn't want to use MTA account system.

Posted

Here is a way to make players bound to an area. X and Y should start at the south west corner. I am not sure how to do nots but that SHOULD work. Not sure.

:mrgreen:

local AdminCamp = createColRectangle ( x, y, width, depth ) 
  
function shapeAHit ( player ) 
local detection = isElementWithinColShape ( player, AdminCamp ) 
    if ( not detection ) then 
        local playern = getClientName ( player ) 
        if ( playern ) then 
            outputChatBox ( "#FF0000Stay in the area "..playern.."!", player, 255, 255, 255, true ) 
        end 
    end 
end 
addEventHandler ( "onColShapeHit", AdminCamp, shapeAHit ) 

Posted

you can als make use of the maplimits resource that the mta server pack contains.

Just use this syntax in your map file and define the points of the shape the player should stay in:

<maplimit> 
    <point x="-2606.7839355469" y="809.72906494141" /> 
    <point x="-2605.8474121094" y="1005.7124023438" /> 
    <point x="-2750.7673339844" y="1004.4500732422" /> 
    <point x="-2750.86328125" y="812.63458251953" /> <!-- these example points are taken from the i69-de map --!> 
 
</maplimit> 

Make sure that in the meta.xml of the gamemode the map is running on the maplimits resource is inclueded using this line:

  
<include resource="maplimits" /> 
  

Posted

Yeah sorry MTA isnt ever going to have stupid high-level commands that aren't flexible, and its frustrating when people ask for them. All these functions are possible in script.

I would reccomend Mr.Hankey's post as a solution to your problem.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...