Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --CLIENT SIDE--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- addEvent("showTimer", true)
- function displayTimer1()
- setTimer(displayTimer, 10000, 1)
- end
- addEventHandler("showTimer", getRootElement(), displayTimer1)
- function displayTimer()
- local zTrigger = setTimer(function() triggerServerEvent("isPlayerThere", getLocalPlayer()) end, 10000, 1)
- if ( isTimer ( timer ) ) then
- local timeLeft = ( getTimerDetails ( timer ) / 1000 )
- dxDrawText("To leave this area!",557.0,318.0,872.0,368.0,tocolor(255,0,0,255),2.0,"default","left","top",false,false,false)
- dxDrawText("10",630.0,277.0,690.0,324.0,tocolor(255,0,0,255),3.0,"default","left","top",false,false,false)
- dxDrawText("You have: ".. tostring ( timeLeft ),546.0,224.0,725.0,271.0,tocolor(255,0,0,255),4.0,"default","left","top",false,false,false)
- end
- end
- --SERVER SIDE--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- --setElementData (createRadarArea(2418.4255371094, -1735,121.6306152344,100,0,150,0,153),"zombieProof",true)
- --addEventHandler("onColShapeHit", createColRectangle (2418.4255371094, -1735,121.6306152344,100), function(h)if not isElement(h) then return end if getElementData(h,"zombie") then killPed(h) end end)
- --Here are your codes ^^^^^
- --Here are mine--
- --The Zone
- staffZone = createColCuboid(2418.4255371094, -1735,121.6306152344, 82, 178.25, 30)
- staffRadar = createRadarArea(2418.4255371094, -1735,121.6306152344,100,0,150,0,153)
- function enterStaffZone(hitElement)
- if getElementType ( hitElement ) == "player" then
- if ( hasObjectPermissionTo ( playerSource, "function.slap", true ) ) then
- outputChatBox ( "You entered a Staff Zone.", hitElement, 0, 255, 0, true )
- else
- outputChatBox ( "You are not allowed here.", hitElement, 255, 0, 0, true )
- triggerClientEvent(hitElement, "showTimer", hitElement)
- end
- end
- end
- addEventHandler ( "onColShapeHit", staffZone, enterStaffZone)
- function warpThePlayer(hitElement)
- local x,y = getElementPosition(theplayer)
- local isInRadarArea( staffRadar, x, y)
- if getElementType ( hitElement ) == "player" and (inArea) then
- setElementPosition ( hitElement, 2341.2072753906, -1658.8668212891, 13.379216194153 )
- else
- outputChatBox ( "You Left The Area Successfully.", thePlayer, 0, 255, 0, true )
- end
- end
- addEvent("isPlayerThere", true)
- addEventHandler("isPlayerThere", getRootElement(), warpThePlayer)
Add Comment
Please, Sign In to add comment