--[[Adminhouse by MuLTi!--]]
local Admincol = createColSphere(1478.501953125, -73.841705322266, 21.207813262939, 20) -- Admin Area, the Base
local Secped1 = createPed(164, 1489.4133300781, -76.182342529297, 19.58528137207, 270)local Secped2 = createPed(163, 1489.5179443359, -71.713813781738, 19.925691604614, 270)local Secped3 = createPed(165, 1465.2216796875, -78.546424865723, 19.405673980713, 90)local Ped1 = createPed(60, 1474.6246337891, -75.697418212891, 24.35800743103, 327)setElementFrozen(Ped1, true)setElementFrozen(Secped1, true)setElementFrozen(Secped2, true)setElementFrozen(Secped3, true)
function regenerate() setPedAnimation(Secped1, "cop_ambient", "Coplook_loop",-1,true,false,false) setPedAnimation(Secped2, "cop_ambient", "Coplook_loop",-1,true,false,false) setPedAnimation(Secped3, "cop_ambient", "Coplook_loop",-1,true,false,false) giveWeapon(Secped1, 28, 5000, true) giveWeapon(Secped2, 28, 5000, true) giveWeapon(Secped3, 28, 5000, true) giveWeapon(Ped1, 7, 1, true)end
setTimer(regenerate, 1000, 1)
local liftpad1 = createObject(2886, 1484.4000244141, -76.699996948242, 21, 0, 0, 269.99450683594) -- untenlocal liftpad2 = createObject(2886, 1482.4000244141, -78.5, 24, 0, 0, 180) -- untenlocal doorpad = createObject(2886, 1484.3000488281, -75, 21.60000038147, 0, 0, 270)-- Tuerschalterlocal klingel = createObject(2886, 1485, -73, 21.299999237061, 0, 0, 90) -- klingen
local door = createObject(1569, 1484.5999755859, -73.199996948242, 20.200000762939, 0, 0, 270) -- Rotation: 180local lift1 = createObject(970, 1481.4000244141, -77.5, 20.200000762939, 90, 0, 0)local lift2 = createObject(970, 1481.4000244141, -77.90000152587, 20.200000762939, 90, 0, 0) --23.5 MOVElocal lift1s = createObject(970, 1480.6999511719, -76.800003051758, 23.89999961853, 0, 0, 0) --oben --1.5local lift2s = createObject(970, 1481.4000244141, -76.800003051758, 20.700000762939, 0, 0, 0) --unten --1.5moveObject(lift2s, 2000, 1481.4000244141, -76.800003051758, 19.700000762939)moveObject(lift1s, 2000, 1480.6999511719, -76.800003051758, 23.90000)local liftVar = 0local doorVar = 0
local oMarker1 = createMarker(1476, -65, 24.1, "arrow", 0.7, 255, 255, 255, 255) --obenlocal oMarker2 = createMarker(1482, -70, 20.29, "cylinder", 1.0, 255, 255, 255, 255) --unten
local Skinmarker = createMarker(1473.3731689453, -69.806953430176, 21.207813262939, "arrow", 1.0, 100, 100, 255, 255) -- umkleide
addEventHandler("onMarkerHit", oMarker1,function(hitElement) if(isPedInVehicle(hitElement)) then return end if not(isAdmin(hitElement)) then return end setElementPosition(hitElement, 1482, -72, 21.39)end)
addEventHandler("onMarkerHit", Skinmarker,function(hitElement) if(isPedInVehicle(hitElement)) then return end if not(isAdmin(hitElement)) then return end setElementModel(hitElement, 217)end)
addEventHandler("onMarkerHit", oMarker2,function(hitElement) if(isPedInVehicle(hitElement)) then return end if not(isAdmin(hitElement)) then return end setElementPosition(hitElement, 1476, -66, 24.5)end)
local M4 = createObject(356, 1479, -69.599998474121, 25.39999961853, 0, 0, 0)local Pistol = createObject(346, 1480, -69.599998474121, 25.299999237061, 0, 0, 0)local Launcher = createObject(359, 1481.5999755859, -69.599998474121, 24.39999961853, 0, 0, 0)local Schrank = createObject(2163, 1481.1999, -69.30000, 23.399999, 0, 0, 0)local Schrank2 = createObject(2164, 1479.3000488281, -69.30000, 23.399999, 0, 0, 0)local Desktop = createObject(11631, 1483.5999, -70.5, 21.39999, 0, 0, 270)local Kamin = createObject(1463, 1472.4000, -73.90000, 20.29999, 0, 0, 0)local Safe = createObject(1829, 1474.9000, -77.69999, 20.7000, 0, 0, 140)local hifi = createObject(1809, 1474.6999511719, -78, 21.200000762939, 0, 0, 150)local Regal = createObject(1742, 1474.4000, -69.6999, 20.2000, 0, 0, 30)local Grill = createObject(1481, 1470.3000, -67.8000, 20.8999, 0, 0, 0)
local randomBook = { "Hello, im a book!","You can click on almost anything here!","You can't ask me something.","Thats awesome!","Huh","Try clicking on the Safe!","You can click on almost anything here!","There's somebody at the door.","I'm your helper!","Use the lift, to get on the second floor.","The doorbell is amazing!","Made by MuLTi!","Chill out!",}local grillvar = 0
function objClicked( theButton, theState, thePlayer ) if theState == "down" and theButton == "left" then if(isAdmin(thePlayer) == false) then return end if source == liftpad1 or source == liftpad2 then if(liftVar == 0) then moveObject(lift1, 2000, 1481.4000244141, -77.5, 23.3) moveObject(lift2, 2000, 1481.4000244141, -77.90000152587, 23.3) moveObject(lift1s, 2000, 1480.6999511719, -76.800003051758, 22.80000) moveObject(lift2s, 2000, 1481.4000244141, -76.800003051758, 20.700000762939) liftVar = 1 else moveObject(lift1, 2000, 1481.4000244141, -77.5, 20.2000) moveObject(lift2, 2000, 1481.4000244141, -77.90000152587, 20.2000) moveObject(lift2s, 2000, 1481.4000244141, -76.800003051758, 19.700000762939) moveObject(lift1s, 2000, 1480.6999511719, -76.800003051758, 23.90000) liftVar = 0 end elseif source == doorpad then if(doorVar == 0) then setElementRotation(door, 0, 0, 180) doorVar = 1 else doorVar = 0 setElementRotation(door, 0, 0, 270) end elseif source == klingel then triggerClientEvent("onKlingelDrueck", getRootElement(), 1479, -73, 22) elseif source == hifi then triggerClientEvent("onHifiDrueck", thePlayer) elseif source == Schrank then takeWeapon(thePlayer, 35) giveWeapon(thePlayer, 35, 5) elseif source == Schrank2 then takeWeapon(thePlayer, 31) takeWeapon(thePlayer, 22) giveWeapon ( thePlayer, 31, 250, true) giveWeapon ( thePlayer, 22, 70, true) elseif source == Kamin then setPedOnFire (thePlayer, true ) setTimer(setPedOnFire, 1000, 1, thePlayer, false) elseif source == Desktop then takeAllWeapons(thePlayer) elseif source == Safe then givePlayerMoney(thePlayer, 5000) elseif source == Regal then local randomfunc = math.random(1, #randomBook) local text = randomBook[randomfunc] outputChatBox(text, thePlayer, 0, 200, 100, false) elseif source == Grill then setElementHealth(thePlayer, 1000) outputChatBox("Mhhmmm!", thePlayer, 0, 250, 100, false) if(grillvar == 1) then return end grillvar = 1 local Grillob = createObject(2415, 1470.4000244141, -68.099998474121, 17.799999237061, 0, 0, 0) end endend
addEventHandler( "onElementClicked", getRootElement(), objClicked )
addEventHandler( "onColShapeHit", root,function(hitElement) if getElementType ( hitElement ) == "player" then if(source == Admincol) then if not(isAdmin(hitElement)) then outputChatBox("You are not allowed to go here. Sorry.", hitElement, 255, 0, 0, false) setElementHealth(hitElement, 0) end end endend)
addEventHandler("onPlayerSpawn", root,function() if not(isAdmin(source)) then return end setElementFrozen(source, true) setElementPosition(source, 1479, -73, 22) setTimer(setElementFrozen, 1000, 1, source, false)end)
function isAdmin(thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then return true; else return false; endend
Alles anzeigen