Panel Açma/Kapama

Kod:
function showGUI ( )
    guiSetVisible ( GUIEditor_Window[1], not guiGetVisible ( GUIEditor_Window[1] ) )
    showCursor ( guiGetVisible ( GUIEditor_Window[1] ) )
end
bindKey ( "f5","down", showGUI )
Kod:
bindKey ( "f5","down", showGUI )
''f5'' yazan yere baska bir tus yazabilirsiniz ve o tusa basıp panel açılır.

Button oluşturarak pencereyi kapatma:

Kod:
if (source == GUIEditor_Button[1]) then
		guiSetVisible(GUIEditor_Window[1],false)
		showCursor(false)
	end
end
addEventHandler("onClientGUIClick",getRootElement(),KAPAT)
KAPAT Olan yerler benim kendi yaptıgım bir deneme panelinden orayı başka bir button ile deişin yani mesela siz bir button yaptınız adı Kapatmak olsun KAPAT olan yerlere Kapatmak yazarak button etkinleşir

Map'e müzik ekleme :

Kod:
function startMusic()
    setRadioChannel(0)
    song = playSound("music.mp3",true)
end

function makeRadioStayOff()
    setRadioChannel(0)
    cancelEvent()
end

function toggleSong()
    if not songOff then
	    setSoundVolume(song,0)
		songOff = true
		removeEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff)
	else
	    setSoundVolume(song,1)
		songOff = false
		setRadioChannel(0)
		addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff)
	end
end

addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),startMusic)
addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff)
addEventHandler("onClientPlayerVehicleEnter",getRootElement(),makeRadioStayOff)
addCommandHandler("musicmusic",toggleSong)
bindKey("m","down","musicmusic")
addEventHandler("onClientResourceStop",getResourceRootElement(getThisResource()),startMusic)
Kod:
bindKey("m","down","musicmusic")
''M'' yerine başka bir tuş koyabilirsiniz

Örnek:

Kod:
bindKey("l","down","musicmusic")
Metaya Eklenicek Kod:

Kod:
<file src="music.mp3" />
music yerine o dosyanın adı baska ise onu yazabilirsin

Bir Pet'i hareket ettirme


Kod:
function makePed()
   ped1 = createPed(56, 1, 1, 4)
   setPedRotation(ped1, 315)
   setPedAnimation( ped1, "ped", "WOMAN_walknorm")
end
addCommandHandler("makemyped", makePed)
Buradan başka animasyonlara bakabilirsiniz.


Üstünde Sekil Yapılabilecek arabalar için komut ile sekilli renk verebilme

Kod:
newvehicle = createVehicle ( 560, 100, 100, 40 )   --Örnek Sultan Aracı
setVehiclePaintjob ( newvehicle, 2 )              -- 1,2,3 ile deiştirebilirsiniz
paintjob = getVehiclePaintjob ( newvehicle )
if ( paintjob == 2 ) then
    outputChatBox ( "Sekil Renk Sistemi Aktif!" )
end
Komut: /paintjob

Ped Oluşturma

Kod:
function pedLoad ()

        createPed (örnek35, x, y, z ) 

end

addEventHandler ( "onResourceStart", getRootElement(), pedLoad )
Metaya Eklenicek

Kod:
<script src="luanınadı.lua" type="server" />
Denizin Rengini Değişme

Kod:
function startclient()
	setWaterColor(255, 0, 255) --
end
addEventHandler("onClientResourceStart", resourceRoot, startclient)
Örnek:

Kod:
function startclient()
	setWaterColor(255, 0, 0) -- şimdiki denizin rengi kırmızı 
end
addEventHandler("onClientResourceStart", resourceRoot, startclient)
Metaya Eklenicek

Kod:
<script src="client.lua" type="client" />
client adında bir lua oluşturun veya metadakinin adını deişin

Araba Modifiye

Kod:
local marker = createMarker(3823, -2024, 2.5, "corona", 5, 0, 255, 255, 255)

function fixx(player)
if getElementType(player)=="player" then
local vehicle=getPedOccupiedVehicle(player)
if source == marker then
addVehicleUpgrade(vehicle, 1164)
end
end
end
addEventHandler("onClientMarkerHit", getRootElement(), fixx)
Araba Patlatma



Kod:
marker = createMarker(3823, -2024, 2.5, "corona", 5, 255, 0, 255, 255)

function boom(player)
if getElementType(player)=="player" then
local vehicle=getPedOccupiedVehicle(player)
if source == marker then
blowVehicle(vehicle)
end
end
end
addEventHandler("onClientMarkerHit", getRootElement(), boom)
Ateş Ring



Kod:
function fire()
createObject(13641, 3825.7, -2026, 3)
setTimer(ogien, 2500, 0)
x,y,z = 3825.7, -2026, 3
end
addEventHandler("onClientResourceStart", getRootElement(), fire)

function ogien()
createFire(x 12, y, z 2.5, 2)
createFire(x 12, y, z 17, 2)
createFire(x 12, y 7.5, z 8.5, 2)
createFire(x 12, y-6.5, z 8.5, 2)
createFire(x 12, y-5.5, z 12.5, 2)
createFire(x 12, y-4, z 13.5, 2)
createFire(x 12, y-2, z 15.5, 2)
createFire(x 12, y 7.5, z 8.5, 2)
createFire(x 12, y 6.5, z 12.5, 2)
createFire(x 12, y 5, z 13.5, 2)
createFire(x 12, y 3, z 15.5, 2)
createFire(x 12, y 6.5, z 6.5, 2)
createFire(x 12, y 4.5, z 4.5, 2)
createFire(x 12, y 3.5, z 3.5, 2)
createFire(x 12, y 2.5, z 3.5, 2)
createFire(x 12, y-5.5, z 6.5, 2)
createFire(x 12, y-4, z 4.5, 2)
createFire(x 12, y-3.5, z 3.5, 2)
createFire(x 12, y-2.5, z 3.5, 2)
end
Arac Tamir



Kod:
marker = createMarker(3823, -2024, 2.5, "corona", 5, 255, 255, 0, 255)

function fixx(player)
if getElementType(player)=="player" then
local vehicle=getPedOccupiedVehicle(player)
if source == marker then
fixVehicle(vehicle)
end
end
end
addEventHandler("onClientMarkerHit", getRootElement(), fixx)
Chat Box

Kod:
function startclient()
outputChatBox("Yazacagınız Yazı", 255, 0, 0, true)
end
addEventHandler("onClientResourceStart", getRootElement(), startclient)
Hidrant Etkisi

Kod:
function hydrant()
hydrant1 = fxAddWaterHydrant(3840.5, -2031.5, 3, 40)
setTimer(hydrant, 1000, 1)
end
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), hydrant)

Kapalı Çarpışma(içinden geçme )

Kod:
function startClient()
shade = createObject(1225, 3840.5, -2031.5, 2, 0, 0, 0)
setElementCollisionsEnabled(shade, false)
end
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), startClient)


Oyuncu hızlandırma

Kod:
marker1 = createMarker(3840.5, -2031.5, 3, "corona", 3.5, 255, 0, 0, 255)

function MarkerHit(player)
if getElementType=="player" then
local vehicle = getPedOccupiedVehicle(player)
if source == marker1 then
setElementVelocity(vehicle, 0, 0, 1.5)
end
end
end
addEventHandler("onClientMarkerHit", getRootElement(), MarkerHit)
Gravity ayarlarını düşürme (yerçekimi)

Kod:
marker = createMarker(3640, 6210, 52, "corona", 25, 0, 0, 0, 200)

function gravity(player)
if getElementType(player)=="player" then
if source == marker then
vehicle = getPedOccupiedVehicle(player)
x,y,z = getElementPosition(player)
setVehicleGravityPoint(vehicle, x, y, z-1000, 1) -- You need to test it many times until you understand how it works.
end
end
end

function setVehicleGravityPoint(targetVehicle, pointX, pointY, pointZ, strength)
if isElement(targetVehicle) and getElementType(targetVehicle)=="vehicle" then
local vehicleX,vehicleY,vehicleZ = getElementPosition(targetVehicle)
local vectorX = vehicleX-pointX
local vectorY = vehicleY-pointY
local vectorZ = vehicleZ-pointZ
local length = (vectorX^2   vectorY^2   vectorZ^2)^0.5
local propX = vectorX^2 / length^2
local propY = vectorY^2 / length^2
local propZ = vectorZ^2 / length^2
local finalX = (strength^2 * propX)^0.5
local finalY = (strength^2 * propY)^0.5
local finalZ = (strength^2 * propZ)^0.5
if vectorX > 0 then finalX = finalX * -1 end
if vectorY > 0 then finalY = finalY * -1 end
if vectorZ > 0 then finalZ = finalZ * -1 end
return setVehicleGravity(targetVehicle, finalX, finalY, finalZ)
end
return false
end
addEventHandler("onClientMarkerHit", getRootElement(), gravity)


OnClientKey:

Kod:
function playerPressedKey(button, press)
    if (press) then 
        outputChatBox("You pressed the "..button.." key!")
    end
end
addEventHandler("onClientKey", root, playerPressedKey)

Alıntıdır.