marker = createMarker ( x, y, z, "cylinder", 2, 255, 0, 255, 255 )
addEventHandler ( "onMarkerHit", marker,
function ( player )
if getElementType ( player ) == "player" then
if getElementData( player ,'Group') == 'ARMY' then
setElementHealth ( player, 100 )
setPedArmor ( player, 100 )
setPedSkin ( player, 115 )
else
outputChatBox ( "* You most be ARMY Group ", player, 0, 0, 255, true )
end
end
end
, false )
local Object = createObject ( ID, x, y, z, rx, ry, rz )
local Marker = createMarker (x, y, z, "cylinder", size, 0, 0, 0, 80 )
function OpenObject ( player )
if isElementWithinMarker ( player, Marker ) then
if getElementData( player ,'Group') == 'ARMY' then
if not Open then
moveObject ( Object, 1500, moveX, moveY, moveZ )
else
moveObject ( Object, 1500, x, y, z )
end
Open = not Open
else
outputChatBox ( "* You aren't in [ ARMY ] team !", player, 200, 0, 0, true )
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
)