تفضل
local Object = createObject ( 5422, 1467.5, -1663.9000244141, 33.299999237061, 0, 0, 0 )
local Marker = createMarker ( 1467.6999511719, -1664, 31.299999237061, "cylinder", 5, 0, 0, 0, 0 )
function OpenObject ( player )
if ( isElementWithinMarker ( player, Marker ) ) then
if getTeamName( getPlayerTeam(player) ) == "Police" then
moveObject ( Object, 1500, 1467.5, -1663.9000244141, 37.299999237061 )
else
moveObject ( Object, 1500, 1467.5, -1663.9000244141, 37.299999237061 )
end
end
end
addEventHandler ( "onResourceStart", resourceRoot,
function ( )
for _, v in ipairs ( getElementsByType ( "player" ) ) do
bindKey ( v, "tab", "down", OpenObject )
end
end )
addEventHandler ( "onPlayerJoin", root,
function ( )
bindKey ( source, "tab", "down", OpenObject )
end )