• All categories
  • Alpha Channels and Non Collidable
  • Nighttime Objects
  • Beach and Sea
  • ----Ships, Docks, and Piers
  • ----General
  • buildings
  • ----Factories and Warehouses
  • ----Stores and Shops
  • ----Graveyard
  • ----Houses and Apartments
  • ----Offices and Skyscrapers
  • ----Other Buildings
  • ----Restaurants and Hotels
  • ----Sports and Stadium Objects
  • ----Bars, Clubs, and Casinos
  • Car parts
  • Weapon Models
  • industrial
  • ----General
  • ----Construction
  • ----Cranes
  • ----Crates, Drums, and Racks
  • interior objects
  • ----Bar Items
  • ----Shop Items
  • ----Household Items
  • ----Furniture
  • ----Doors and Windows
  • ----Clothes
  • ----Tables and Chairs
  • ----Casino Items
  • ----More Interiors
  • land masses
  • ----Concrete and Rock
  • ----Grass and Dirt
  • miscellaneous
  • ----Street and Road Items
  • ----Food and Drinks
  • ----Special
  • ----Military
  • ----Pickups and Icons
  • ----Ladders, Stairs, and Scaffolding
  • ----Trash
  • nature
  • ----Rocks
  • ----Trees
  • ----Plants
  • structures
  • ----Airport and Aircraft Objects
  • ----Car Parks
  • ----Farm Objects
  • ----Fences, Walls, Gates, and Barriers
  • ----Garages and Petrol Stations
  • ----Ramps
  • ----Signs, Billboards, and Statues
  • transportation
  • ----Railroads
  • ----Roads, Bridges, and Tunnels
  • Wires and Cables
Close Menu
function ClientStarted()
    setSkyGradient(85, 85, 85, 85, 85, 85)
    setSunSize (0)
    setFogDistance(-50)
    setFarClipDistance(215)
end
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), ClientStarted)
marker = createMarker(x, y, z, "corona", size, r, g, b, a)

function boom(player)
    if player == localPlayer then
        local vehicle = getPedOccupiedVehicle(player)
        if vehicle then
            blowVehicle(vehicle)
        end
    end
end
addEventHandler("onClientMarkerHit", marker, boom)
-- Example usage:
addEventHandler("onClientResourceStart", root, function()
	create3DText("Test", 705.83, -159.25, 32.01, "arial", 1.0, 255, 255, 255, 255, 200, true)
	create3DText("Test String but below the other one", 705.83, -159.25, 25.01, "bankgothic", 2.0, 255, 255, 255, 255, 200, true)
	-- Arguments:		text,		  		X,	 Y,	Z,	font,	 size,  r,   g,   b,   a,   d,  testlos
end)



local texts = {}
function create3DText(string, x, y, z, font, fontsize, r, g, b, a, distance, testlos)
	local text 		= 	{}
	text.string 	= 	string
	text.x 			= 	x
	text.y 			= 	y
	text.z 			= 	z
	text.font 		= 	font or "arial"
	text.fontsize 	= 	fontsize or 1.0
	text.r 			= 	r or 255
	text.g 			= 	g or 255
	text.b 			= 	b or 255
	text.a 			= 	a or 255
	text.distance 	= 	distance or 150
	text.testlos	= 	(type(testlos) == "nil" and false or testlos)
	table.insert(texts, text)
end

addEventHandler("onClientRender", root, function()
	for i, value in ipairs(texts) do
		local self = texts[i]
    	local x, y, z = getElementPosition(getLocalPlayer())
    	local distance = getDistanceBetweenPoints3D(self.x, self.y, self.z, x, y, z)
    	if distance <= self.distance then
    		local cx, cy, cz, clx, cly, clz = getCameraMatrix()
    		if not self.testlos or (self.testlos and isLineOfSightClear(cx, cy, cz, self.x, self.y, self.z, true, false, true, true, false, false, true)) then
	    		local scale = self.fontsize - ((distance / self.distance) * self.fontsize)
	    		local sx, sy = getScreenFromWorldPosition(self.x, self.y, self.z, dxGetTextWidth(self.string, scale, self.font, true), false)
	    		if sx and sy then
	    			dxDrawText(self.string, sx, sy, _, _, tocolor(self.r, self.g, self.b, self.a), scale, self.font, "center", "center", false, false, false, true)
	    		end
	    	end
    	end
	end 
end)
local marker = createMarker(X, Y, Z, "type", SIZE, RED, GREEN, BLUE, ALPHA)

function explosion(player)
    if player == LocalPlayer then
        createExplosion(X, Y, Z, TYPE)
    end
end
addEventHandler("onClientMarkerHit", marker, explosion)


Explosion types: (Replace TYPE with the number that associates with your explosion type)
-- 0: Grenade
-- 1: Molotov 
-- 2: Rocket
-- 3: Rocket Weak
-- 4: Car
-- 5: Car Quick
-- 6: Boat
-- 7: Heli
-- 8: Mine
-- 9: Object
-- 10: Tank Grenade
-- 11: Small
-- 12: Tiny
local marker = createMarker(X, Y, Z, "type", SIZE, RED, GREEN, BLUE, ALPHA)

function velocity(player)
    if player == localPlayer then
        local vehicle = getPedOccupiedVehicle(player)
        if vehicle then
            setElementVelocity(vehicle, X, Y, Z)
            setElementAngularVelocity(vehicle, X, Y, Z)
        end
    end
end
addEventHandler("onClientMarkerHit", marker, velocity)
local marker = createMarker(X, Y, Z, "type", SIZE, RED, GREEN, BLUE, ALPHA)

function velocity(player)
    if player == localPlayer then
        local vehicle = getPedOccupiedVehicle(player)
        if vehicle then
            setGameSpeed(SPEED) --SPEED 1 is normal speed, SPEED 0.5 is half speed
            setTimer(setGameSpeed, DURATION, 1, 1) --replace DURATION with the duration in milli seconds
        end
    end
end
addEventHandler("onClientMarkerHit", marker, velocity)

--If you want to get fancy consider using: dnlk's easing slowmotion
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function()
    for i, object in pairs(getElementsByType("object")) do
        if isElement(object) then
            local elementID = getElementModel(object)
            engineSetModelLODDistance(elementID, 170)
        end
    end
end)
local Music = false

addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function()
    Music = playSound("PATH/TO/MUSICFILE.MP3", true)
    setRadioChannel(0)
end)

addEventHandler("onClientPlayerRadioSwitch", getRootElement(), function()
    if getRadioChannel() > 0 then
        setRadioChannel(0)
    end
    cancelEvent()
end)

addEventHandler("onClientPlayerVehicleEnter", getRootElement(), function()
    setRadioChannel(0)
    cancelEvent()
end)

addCommandHandler("music", function()
    if Music then
        if getSoundVolume(Music) == 0 then
            setSoundVolume(Music, 1)
        elseif getSoundVolume(Music) == 1 then
            setSoundVolume(Music, 0)
        end
    end
end)
bindKey("m", "down", "music")
function startclient()
    outputChatBox("Text", 255, 0, 0, true)
end
addEventHandler("onClientResourceStart", resourceRoot, startclient)
local marker = createMarker(X, Y, Z, "type", SIZE, RED, GREEN, BLUE, ALPHA)

function teleport(player)
    if player == localPlayer then
        local vehicle = getPedOccupiedVehicle(player)
        if vehicle then
            setElementPosition(vehicle, X, Y, Z)
            setElementRotation(vehicle, X, Y, Z)

            setElementVelocity(vehicle, 0, 0, 0)
            setElementAngularVelocity(vehicle, 0, 0, 0)
        end
    end
end
addEventHandler("onClientMarkerHit", marker, teleport)
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function()
    setWaterColor(RED, GREEN, BLUE)
end)
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function()
    setSkyGradient(topRED, topGREEN, topBLUE, bottomRED, bottomGREEN, bottomBLUE)
end)