[YARDIM] F1 Panele Temel Eşyalar Ekleme

0 Üye ve 1 Ziyaretçi konuyu incelemekte.

Çevrimdışı cembeyss

  • Yeni Üye
  • *
    • İleti: 12
: 25 Mayıs 2018, 10:18:33
Arkadaşlar ben askeri server yetkilisiyim onun içiin f1 panelime temele eşyalar koymam gerekiyor ama bir yapamadım f1 panel dosyası içinde temelesya.xml var fr_client de de var ama server ye attığım zaman gözükmüyor nasıl ayarlayacam.
« Son Düzenleme: 25 Mayıs 2018, 20:41:41 Gönderen: Narkoz »
 


MTASATURK

[YARDIM] F1 Panele Temel Eşyalar Ekleme
« : 25 Mayıs 2018, 10:18:33 »

Çevrimdışı By.Secret

  • Kendi Halinde Bir Coder :)
  • Acemi Üye
  • *
    • İleti: 137
  • C#
Yanıtla #1 : 25 Mayıs 2018, 13:31:41
butonun işlevini yükledin galiba butonun kendisinide eklemelisin fr_client.lua yı atarsan yardımcı olabilirim
 


Çevrimdışı MarkeloF

  • Admin
  • *
    • İleti: 901
  • Maybe later.
Yanıtla #2 : 25 Mayıs 2018, 13:45:56
Konu düzenlendi ve 'Teknik Destek' adlı bölüme taşındı.
 


Çevrimdışı cembeyss

  • Yeni Üye
  • *
    • İleti: 12
Yanıtla #3 : 25 Mayıs 2018, 18:22:54
Linki görebilmek için Kayıt olun yada Giriş yapın.   fr_client
Kod: lua
-----------------------
-----Oyuncu Paneli-----
-----------------------
CONTROL_MARGIN_RIGHT = 5
LINE_MARGIN = 3
LINE_HEIGHT = 22

g_Root = getRootElement()
g_ResRoot = getResourceRootElement(getThisResource())
g_Me = getLocalPlayer()
server = createServerCallInterface()
guiSetInputMode("no_binds_when_editing")
-----------------
-----ZIPLAMA-----
-----------------
function setPosCommand(cmd, x, y, z, r)
if getElementData(g_Me, ByCash.gorevdata_) then return false end
local x, y, z, r = string.gsub(x or "", ",", " "), string.gsub(y or "", ",", " "), string.gsub(z or "", ",", " "), string.gsub(r or "", ",", " ")
if (x and y == "" and not tonumber(x)) then
x, y, z, r = unpack(split(x, " "))
end
local px, py, pz = getElementPosition(localPlayer)
local pr = getPedRotation(localPlayer)
local message = ""
message = message .. (tonumber(x) and "" or "X ")
message = message .. (tonumber(y) and "" or "Y ")
message = message .. (tonumber(z) and "" or "Z ")
setPlayerPosition(tonumber(x) or px, tonumber(y) or py, tonumber(z) or pz)
if (isPedInVehicle(localPlayer)) then
local vehicle = getPedOccupiedVehicle(localPlayer)
if (vehicle and isElement(vehicle) and getVehicleController(vehicle) == localPlayer) then
setElementRotation(vehicle, 0, 0, tonumber(r) or pr)
end
else
setPedRotation(localPlayer, tonumber(r) or pr)
end
end
addCommandHandler(ByCash.Zipla_, setPosCommand)
-----------------
-------------------------
-----Araçları Yok Et-----
-------------------------
function respawnExplodedVehicle()
setTimer(respawnVehicle, 5000, 1, source)
end
addEventHandler("onVehicleExplode", getRootElement(), respawnExplodedVehicle)
------------------------
-----Sınırsız Nitro-----
------------------------
g_Me = getLocalPlayer();
g_Root = getRootElement( );
g_ResRoot = getResourceRootElement( );

addEventHandler( "onClientResourceStart", g_ResRoot,
function( )
bindKey( "vehicle_fire", "both", toggleNOS );
bindKey( "vehicle_secondary_fire", "both", toggleNOS );
end
)

function toggleNOS( key, state )
local veh = getPedOccupiedVehicle( g_Me );
if veh and not isEditingPosition then
if state == "up" then
removeVehicleUpgrade( veh, 1010 );
setControlState( "vehicle_fire", false );
else
addVehicleUpgrade( veh, 1010 );
end
end
end
----------------------
-----Ekranı Gizle-----
----------------------
function ekrangizle()
showChat(false)
guiCheckBoxSetSelected(getControl(wndMain, "Ekranı Göster"), false)
triggerServerEvent("EkranGizle", getLocalPlayer(), thePlayer)
setPlayerHudComponentVisible("all", false)
end

function ekrangoster()
showChat(true)
guiCheckBoxSetSelected(getControl(wndMain, "Ekranı Gizle"), false)
triggerServerEvent("EkranGoster", getLocalPlayer(), thePlayer)
setPlayerHudComponentVisible("all", true)
end
----------------
-----Cam Aç-----
----------------
function openVehicleWindow(cmd, number)
if (isPedInVehicle(localPlayer)) then
local vehicle = getPedOccupiedVehicle(localPlayer)
if number and tonumber(number) then
if tonumber(number) > 0 and tonumber(number) < 7 then
setVehicleWindowOpen(vehicle, tonumber(number), not isVehicleWindowOpen(vehicle, tonumber(number)))
end
end
end
end
addCommandHandler(ByCash.CamAc_,openVehicleWindow)
-----------------------
-----Yürüyüş Stili-----
-----------------------
function showWalkingID(leaf)
if leaf.id then
setControlNumber(wndWalking, "walkingid", leaf.id)
end
end

function WalkingInit()
setControlNumber(wndWalking, "walkingid", getPedWalkingStyle(g_Me) )
end

function applyWalking( WalkingID )
local WalkingID = getControlNumber(wndWalking, "walkingid")
if WalkingID then
 
server.setWalking(WalkingID)
fadeCamera(true)
end
end

wndWalking = {
"wnd",
width = 250,
x = -20,
y = 0.3,
controls = {
{
"lst",
id="walkinglist",
width=230,
height=290,
columns={
{text="Stiller", attr="name"}
},
rows={xml="y_stilleri.xml", attrs={"id", "name"}},
onitemclick=showWalkingID,
onitemdoubleclick=applyWalking
},
{"txt", id="walkingid", text="", width=50},
{"btn", id="Kullan", onclick=applyWalking},
{"btn", id="Kapat", closeswindow=true}
},
oncreate = WalkingInit
}
---------------------
-----Dövüş Stili-----
---------------------
function showFGID(leaf)
if leaf.id then
setControlNumber(wndFG, "fightingID", leaf.id)
end
end

function FGInit()
setControlNumber(wndFG, "fightingID", tonumber( getElementData(g_Me,"XEnergy.Fighting")) )
end

function applyFG( FGID )
 local FGID = getControlNumber(wndFG, "fightingID")
 if FGID then
 
 server.setFighting(FGID)
fadeCamera(true)
end
end

wndFG = {
"wnd",
width = 250,
x = -20,
y = 0.3,
controls = {
{
"lst",
id="fightinglist",
width=230,
height=290,
columns={
{text="Stiller", attr="name"}
},
rows={xml="d_stilleri.xml", attrs={"id", "name"}},
onitemclick=showFGID,
onitemdoubleclick=applyFG
},
{"txt", id="fightingID", text="", width=50},
{"btn", id="Kullan", onclick=applyFG},
{"btn", id="Kapat", closeswindow=true}
},
oncreate = FGInit
}
-------------------
-----Karakterler---
-------------------
function skinInit()
setControlNumber(wndSkin, "skinid", getElementModel(g_Me))
end

function showSkinID(leaf)
if leaf.id then
setControlNumber(wndSkin, "skinid", leaf.id)
end
end

function applySkin()
local skinID = getControlNumber(wndSkin, "skinid")
if skinID then
if skinID == 299 then
errMsg("Bu karakteri kullanmak için Vip panelini açmalısınız.")
return
end
server.setMySkin(skinID)
end
end

wndSkin = {
"wnd",
width = 250,
x = -20,
y = 0.3,
controls = {
{
"lst",
id="skinlist",
width=230,
height=290,
columns={
{text="Karakterler", attr="name"}
},
rows={xml="skins.xml", attrs={"id", "name"}},
onitemclick=showSkinID,
onitemdoubleclick=applySkin
},
{"txt", id="skinid", text="", width=50},
{"btn", id="Kullan", onclick=applySkin},
{"btn", id="Kapat", closeswindow=true}
},
oncreate = skinInit
}

function skinver(cmd, skin)
skin = skin and tonumber(skin)
if skin then
server.setMySkin(skin)
fadeCamera(true)
closeWindow(wndSpawnMap)
closeWindow(wndSetPos)
end
end
addCommandHandler(ByCash.Karakter_, skinver)
----------------------
-----Temel Esyalar-----
----------------------
function applyAnimation(leaf)
if type(leaf) ~= "table" then
leaf = getSelectedGridListLeaf(wndAnim, "animlist")
if not leaf then
return
end
end
server.setPedAnimation(g_Me, leaf.parent.name, leaf.name, true, true)
end

wndtemel = {
"wnd",
width = 250,
x = -20,
y = 0.3,
controls = {
{
"lst",
id="temel esya",
width=230,
height=290,
columns={
{text="Temel Esyalar", attr="name"}
},
rows={xml="temelesya.xml", attrs={"name"}},
expandlastlevel=false,
onitemdoubleclick=applyAnimation
},
{"btn", id="Al", onclick=giveWeapon},
{"btn", id="Kapat", closeswindow=true}
}
}
--------------------
-----Kıyafetler-----
--------------------
function clothesInit()
if getElementModel(g_Me) ~= 0 then
errMsg("Carl Johnson karakterini kullanmadan kıyafetler bölümüne erişemezsiniz.")
closeWindow(wndClothes)
return
end
if not g_Clothes then
triggerServerEvent("onClothesInit", g_Me)
end
end

addEvent("onClientClothesInit", true)
addEventHandler("onClientClothesInit", g_Root,
function(clothes)
g_Clothes = clothes.allClothes
for i,typeGroup in ipairs(g_Clothes) do
for j,cloth in ipairs(typeGroup.children) do
if not cloth.name then
cloth.name = cloth.model .. " - " .. cloth.texture
end
cloth.wearing =
clothes.playerClothes[typeGroup.type] and
clothes.playerClothes[typeGroup.type].texture == cloth.texture and
clothes.playerClothes[typeGroup.type].model == cloth.model
or false
end
table.sort(typeGroup.children, function(a, b) return a.name < b.name end)
end
bindGridListToTable(wndClothes, "clothes", g_Clothes, false)
end
)

function clothListClick(cloth)
setControlText(wndClothes, "addremove", cloth.wearing and "Çıkart" or "Giyin")
end

function applyClothes(cloth)
if not cloth then
cloth = getSelectedGridListLeaf(wndClothes, "clothes")
if not cloth then
return
end
end
if cloth.wearing then
cloth.wearing = false
setControlText(wndClothes, "addremove", "Giyin")
server.removePlayerClothes(g_Me, cloth.parent.type)
else
local prevClothIndex = table.find(cloth.siblings, "wearing", true)
if prevClothIndex then
cloth.siblings[prevClothIndex].wearing = false
end
cloth.wearing = true
setControlText(wndClothes, "addremove", "Çıkart")
server.addPedClothes(g_Me, cloth.texture, cloth.model, cloth.parent.type)
end
end

wndClothes = {
"wnd",
x = -20,
y = 0.3,
width = 350,
controls = {
{
"lst",
id="clothes",
width=330,
height=390,
columns={
{text="Kıyafetler", attr="name", width=0.6},
{text="Durum", attr="wearing", enablemodify=true, width=0.3}
},
rows={
{name="Kıyafetler yükleniyor..."}
},
onitemclick=clothListClick,
onitemdoubleclick=applyClothes
},
{"br"},
{"btn", text="Giyin", id="addremove", width=60, onclick=applyClothes},
{"btn", id="Kapat", closeswindow=true}
},
oncreate = clothesInit
}
----------------
-----Harita-----
----------------
do
local screenWidth, screenHeight = guiGetScreenSize()
g_MapSide = (screenHeight * 0.85)
end

function setPosInit()
local x, y, z = getElementPosition(g_Me)
setControlNumbers(wndSetPos, { x = x, y = y, z = z })

addEventHandler("onClientRender", g_Root, updatePlayerBlips)
end

function fillInPosition(relX, relY, btn)
if (btn == "right") then
closeWindow (wndSetPos)
return
end

local x = relX*6000 - 3000
local y = 3000 - relY*6000
local hit, hitX, hitY, hitZ
hit, hitX, hitY, hitZ = processLineOfSight(x, y, 3000, x, y, -3000)
setControlNumbers(wndSetPos, { x = x, y = y, z = hitZ or 0 })
end

function setPosClick()
setPlayerPosition(getControlNumbers(wndSetPos, {"x", "y", "z"}))
closeWindow(wndSetPos)
end

function setPlayerPosition(x, y, z)
local elem = getPedOccupiedVehicle(g_Me)
local distanceToGround
local isVehicle
if elem then
if getPlayerOccupiedSeat(g_Me) ~= 0 then
errMsg("Aracın konumunu sadece şöför ayarlıyabilir.")
return
end
distanceToGround = getElementDistanceFromCentreOfMassToBaseOfModel(elem) + 3
isVehicle = true
else
elem = g_Me
distanceToGround = 0.4
isVehicle = false
end
local hit, hitX, hitY, hitZ = processLineOfSight(x, y, 3000, x, y, -3000)
if not hit then
if isVehicle then
server.fadeVehiclePassengersCamera(false)
else
fadeCamera(false)
end
setTimer(setCameraMatrix, 1000, 1, x, y, z)
local grav = getGravity()
setGravity(0.001)
if g_TeleportTimer then killTimer(g_TeleportTimer) end
g_TeleportTimer = setTimer(
function()
local hit, groundX, groundY, groundZ = processLineOfSight(x, y, 3000, x, y, -3000)
if hit then
local waterZ = getWaterLevel(x, y, 100)
z = (waterZ and math.max(groundZ, waterZ) or groundZ) + distanceToGround
if isPedDead(g_Me) then
server.spawnMe(x, y, z)
else
setElementPosition(elem, x, y, z)
end
setCameraPlayerMode()
setGravity(grav)
if isVehicle then
server.fadeVehiclePassengersCamera(true)
else
fadeCamera(true)
end
killTimer(g_TeleportTimer)
g_TeleportTimer = nil
end
end,
500,
0
)
else
if isPedDead(g_Me) then
server.spawnMe(x, y, z + distanceToGround)
else
setElementPosition(elem, x, y, z + distanceToGround)
if isVehicle then
setTimer(setElementVelocity, 100, 1, elem, 0, 0, 0)
setTimer(setVehicleTurnVelocity, 100, 1, elem, 0, 0, 0)
end
end
end
end

function updatePlayerBlips()
if not g_PlayerData then
return
end
local wnd = isWindowOpen(wndSpawnMap) and wndSpawnMap or wndSetPos
local mapControl = getControl(wnd, "map")
for elem,player in pairs(g_PlayerData) do
if not player.gui.mapBlip then
player.gui.mapBlip = guiCreateStaticImage(0, 0, 9, 9, elem == g_Me and "localPlayerblip.png" or "playerblip.png", false, mapControl)
player.gui.mapLabelShadow = guiCreateLabel(0, 0, 100, 14, player.name, false, mapControl)
local labelWidth = guiLabelGetTextExtent(player.gui.mapLabelShadow)
guiSetSize(player.gui.mapLabelShadow, labelWidth, 14, false)
guiSetFont(player.gui.mapLabelShadow, "default-bold-small")
guiLabelSetColor(player.gui.mapLabelShadow, 255, 255, 255)
player.gui.mapLabel = guiCreateLabel(0, 0, labelWidth, 14, player.name, false, mapControl)
guiSetFont(player.gui.mapLabel, "default-bold-small")
guiLabelSetColor(player.gui.mapLabel, 0, 0, 0)
for i,name in ipairs({"mapBlip", "mapLabelShadow"}) do
addEventHandler("onClientGUIDoubleClick", player.gui[name],
function()
server.warpMe(elem)
closeWindow(wnd)
end,
false
)
end
end
local x, y = getElementPosition(elem)
x = math.floor((x + 3000) * g_MapSide / 6000) - 4
y = math.floor((3000 - y) * g_MapSide / 6000) - 4
guiSetPosition(player.gui.mapBlip, x, y, false)
guiSetPosition(player.gui.mapLabelShadow, x + 14, y - 4, false)
guiSetPosition(player.gui.mapLabel, x + 13, y - 5, false)
end
end

addEventHandler("onClientPlayerChangeNick", g_Root,
function(oldNick, newNick)
if (not g_PlayerData) then return end
local player = g_PlayerData[source]
player.name = newNick
if player.gui.mapLabel then
guiSetText(player.gui.mapLabelShadow, newNick)
guiSetText(player.gui.mapLabel, newNick)
local labelWidth = guiLabelGetTextExtent(player.gui.mapLabelShadow)
guiSetSize(player.gui.mapLabelShadow, labelWidth, 14, false)
guiSetSize(player.gui.mapLabel, labelWidth, 14, false)
end
end
)

function closePositionWindow()
removeEventHandler("onClientRender", g_Root, updatePlayerBlips)
end

wndSetPos = {
"wnd",
width = g_MapSide + 15,
controls = {
{"img", id="map", src="map.png", width=g_MapSide, height=g_MapSide, onclick=fillInPosition, ondoubleclick=setPosClick},
{"txt", id="x", text="", width=60},
{"txt", id="y", text="", width=60},
{"txt", id="z", text="", width=60},
{"btn", id="Git", onclick=setPosClick},
{"btn", id="Kapat", closeswindow=true},
{"lbl", text="Işınlanmak istediğiniz bölgeyi seçiniz."}
},
oncreate = setPosInit,
onclose = closePositionWindow
}

function warpMapInit()
addEventHandler("onClientRender", g_Root, updatePlayerBlips)
end

function spawnMapDoubleClick(relX, relY)
setPlayerPosition(relX*6000 - 3000, 3000 - relY*6000, 0)
closeWindow(wndSpawnMap)
end

function closeSpawnMap()
showCursor(false)
removeEventHandler("onClientRender", g_Root, updatePlayerBlips)
for elem,data in pairs(g_PlayerData) do
for i,name in ipairs({"mapBlip", "mapLabelShadow", "mapLabel"}) do
if data.gui[name] then
destroyElement(data.gui[name])
data.gui[name] = nil
end
end
end
end

wndSpawnMap = {
"wnd",
width = g_MapSide + 15,
controls = {
{"img", id="map", src="map.png", width=g_MapSide, height=g_MapSide, ondoubleclick=spawnMapDoubleClick},
{"lbl", text="Işınlanmak istediğiniz bölgeyi seçin.", width=g_MapSide-60, align="center"},
{"btn", id="Kapat", closeswindow=true}
},
oncreate = warpMapInit,
onclose = closeSpawnMap
}
-----------------
-----Araçlar-----
-----------------
function createSelectedVehicle(leaf)
if not leaf then
leaf = getSelectedGridListLeaf(wndCreateVehicle, "vehicles")
if not leaf then
return
end
end
server.giveMeVehicles(leaf.id)
end

wndCreateVehicle = {
"wnd",
width = 300,
controls = {
{
"lst",
id="vehicles",
width=280,
height=340,
columns={
{text="Araçlar", attr="name"}
},
rows={xml="vehicles.xml", attrs={"id", "name"}},
onitemdoubleclick=createSelectedVehicle
},
{"btn", id="Oluştur", onclick=createSelectedVehicle},
{"btn", id="Kapat", closeswindow=true}
}
}
----------------
-----Yenile-----
----------------
function repairVehicle()
local vehicle = getPedOccupiedVehicle(g_Me)
if vehicle then
server.fixVehicle(vehicle)
end
end
----------------
-----Döndür-----
----------------
function flipVehicle()
local vehicle = getPedOccupiedVehicle(g_Me)
if vehicle then
local rZ = getElementRotation(vehicle)
server["set" .. "VehicleRotation"](vehicle, 0, 0, (rZ + 180) or rZ)
end
end
------------------
-----Modifiye-----
------------------
function upgradesInit()
local vehicle = getPedOccupiedVehicle(g_Me)
if not vehicle then
errMsg("Aracınıza binmeden modifiye kısmına erişemezsiniz.")
closeWindow(wndUpgrades)
return
end
local installedUpgrades = getVehicleUpgrades(vehicle)
local compatibleUpgrades = {}
local slotName, group
for i,upgrade in ipairs(getVehicleCompatibleUpgrades(vehicle)) do
slotName = getVehicleUpgradeSlotName(upgrade)
group = table.find(compatibleUpgrades, "name", slotName)
if not group then
group = { "group", name = slotName, children = {} }
table.insert(compatibleUpgrades, group)
else
group = compatibleUpgrades[group]
end
table.insert(group.children, { id = upgrade, installed = table.find(installedUpgrades, upgrade) ~= false })
end
table.sort(compatibleUpgrades, function(a, b) return a.name < b.name end)
bindGridListToTable(wndUpgrades, "upgradelist", compatibleUpgrades, true)
end

function selectUpgrade(leaf)
setControlText(wndUpgrades, "addremove", leaf.installed and "Kaldır" or "Kullan")
end

function addRemoveUpgrade(selUpgrade)
local vehicle = getPedOccupiedVehicle(g_Me)
if not vehicle then
return
end

if not selUpgrade then
selUpgrade = getSelectedGridListLeaf(wndUpgrades, "upgradelist")
if not selUpgrade then
return
end
end

if selUpgrade.installed then

selUpgrade.installed = false
setControlText(wndUpgrades, "addremove", "Kullan")
server.removeVehicleUpgrade(vehicle, selUpgrade.id)
else

local prevUpgradeIndex = table.find(selUpgrade.siblings, "installed", true)
if prevUpgradeIndex then
selUpgrade.siblings[prevUpgradeIndex].installed = false
end
selUpgrade.installed = true
setControlText(wndUpgrades, "addremove", "Kaldır")
server.addVehicleUpgrade(vehicle, selUpgrade.id)
end
end

wndUpgrades = {
"wnd",
width = 300,
x = -20,
y = 0.3,
controls = {
{
"lst",
id="upgradelist",
width=280,
height=340,
columns={
{text="Modifiyeler", attr="id", width=0.6},
{text="Durum", attr="installed", width=0.3, enablemodify=true}
},
onitemclick=selectUpgrade,
onitemdoubleclick=addRemoveUpgrade
},
{"btn", id="addremove", text="Kullan", width=60, onclick=addRemoveUpgrade},
{"btn", id="Kapat", closeswindow=true}
},
oncreate = upgradesInit
}
----------------
-----Farlar-----
----------------
function forceLightsOn()
local vehicle = getPedOccupiedVehicle(g_Me)
if not vehicle then
guiCheckBoxSetSelected(getControl(wndMain, "lightsoff"), false)
return
end
server.setVehicleOverrideLights(vehicle, 2)
guiCheckBoxSetSelected(getControl(wndMain, "lightsoff"), false)
end

function forceLightsOff()
local vehicle = getPedOccupiedVehicle(g_Me)
if not vehicle then
guiCheckBoxSetSelected(getControl(wndMain, "lightson"), false)
return
end
server.setVehicleOverrideLights(vehicle, 1)
guiCheckBoxSetSelected(getControl(wndMain, "lightson"), false)
end
--------------
-----Renk-----
--------------
function openColorPicker()
editingVehicle = getPedOccupiedVehicle(localPlayer)
if (editingVehicle) then
colorPicker.openSelect(colors)
end
end

function closedColorPicker()
local r1, g1, b1, r2, g2, b2 = getVehicleColor(editingVehicle, true)
server.setVehicleColor(editingVehicle, r1, g1, b1, r2, g2, b2)
local r, g, b = getVehicleHeadLightColor(editingVehicle)
server.setVehicleHeadLightColor(editingVehicle, r, g, b)
editingVehicle = nil
end

function updateColor()
if (not colorPicker.isSelectOpen) then return end
local r, g, b = colorPicker.updateTempColors()
if (editingVehicle and isElement(editingVehicle)) then
local r1, g1, b1, r2, g2, b2 = getVehicleColor(editingVehicle, true)
if (guiCheckBoxGetSelected(checkColor1)) then
r1, g1, b1 = r, g, b
end
if (guiCheckBoxGetSelected(checkColor2)) then
r2, g2, b2 = r, g, b
end
if (guiCheckBoxGetSelected(checkColor3)) then
setVehicleHeadLightColor(editingVehicle, r, g, b)
end
setVehicleColor(editingVehicle, r1, g1, b1, r2, g2, b2)
end
end
addEventHandler("onClientRender", root, updateColor)
-------------------
-----Ana Panel-----
-------------------
function updateGUI(updateVehicle)

local x, y, z = getElementPosition(g_Me)
setControlNumbers(wndMain, {xpos=math.ceil(x), ypos=math.ceil(y), zpos=math.ceil(z)})

if updateVehicle then

local vehicle = getPedOccupiedVehicle(g_Me)
if vehicle and isElement(vehicle) then
setControlText(wndMain, "curvehicle", getVehicleName(vehicle))
else
setControlText(wndMain, "curvehicle", "On foot")
end
end
end

function mainWndShow()
setElementData(getControl(wndMain ,"Ölüm"), "tooltip-text", "İntihar edebilirsin.", false)
setElementData(getControl(wndMain, "Animasyonlar"), "tooltip-text", "Animasyon kullanabilirsin.", false)
setElementData(getControl(wndMain, "Karakterler"), "tooltip-text", "Karakterini değiştirebilirsin.", false)
setElementData(getControl(wndMain, "Kıyafetler"), "tooltip-text", "CJ'in kıyafetlerini değiştirebilirsin.", false)
setElementData(getControl(wndMain, "Yürüyüş Stilleri"), "tooltip-text", "Yürüyüş stilini değiştirebilirsin.", false)
setElementData(getControl(wndMain, "Dövüş Stilleri"), "tooltip-text", "Dövüş stilini değiştirebilirsin.", false)
setElementData(getControl(wndMain, "createvehicle"), "tooltip-text", "Araç oluşturabilirsin.", false)
setElementData(getControl(wndMain, "Renk"), "tooltip-text", "Aracının rengini değiştirebilirsin.", false)
setElementData(getControl(wndMain, "Araç Kontrol"), "tooltip-text", "Aracının ayarlarıyla oynayabilirsin.", false)
setElementData(getControl(wndMain, "Modifiye"), "tooltip-text", "Aracını modifiye edebilirsin.", false)
setElementData(getControl(wndMain, "lightson"), "tooltip-text", "Aracının farlarını açabilirsin.", false)
setElementData(getControl(wndMain, "lightsoff"), "tooltip-text", "Aracının farlarını kapatabilirsin.", false)
if not getPedOccupiedVehicle(g_Me) then
end
updateTimer = updateTimer or setTimer(updateGUI, 2000, 0)
updateGUI(true)
end

function mainWndClose()
killTimer(updateTimer)
updateTimer = nil
colorPicker.closeSelect()
end

function onEnterVehicle(vehicle)
setControlText(wndMain, "curvehicle", getVehicleName(vehicle))
guiCheckBoxSetSelected(getControl(wndMain, "lightson"), getVehicleOverrideLights(vehicle) == 2)
guiCheckBoxSetSelected(getControl(wndMain, "lightsoff"), getVehicleOverrideLights(vehicle) == 1)
end

function onExitVehicle(vehicle)
setControlText(wndMain, "curvehicle", "On foot")
closeWindow(wndUpgrades)
closeWindow(wndColor)
end

function killlocalPlayer()
server.killPed(g_Me)
end

function alphaCommand(command, alpha)
alpha = alpha and tonumber(alpha)
if alpha then
server.setElementAlpha(g_Me, alpha)
end
end
-----------------------
-----Görev Sistemi-----
-----------------------
function GorevPaneli()
GorevSistemiAc()
end
-----------------------
-----Kumar Sistemi-----
-----------------------
function KumarPaneli()
KumarSistemiAc()
end
--------------------------
-----CashTube Sistemi-----
--------------------------
function CashTubePaneli()
CashTubeSistemiAc()
end
------------------------------
-----Araç Kontrol Sistemi-----
------------------------------
function AracKontrolPaneli()
AracKontrolSistemiAc()
end
---------------
-----Panel-----
---------------
wndMain = {
"wnd",
x = 10,
y = 190,
width = 300,
controls = {
{"btn", text= ByCash.paneladi_, id="paneladi", x=-11, y=0, width=310},
{"br"},
{"btn", id="Ölüm", onclick=killlocalPlayer, x=20, y=55, width=125.25},
{"btn", id="Animasyonlar", window=wndAnim, x=150, y=55, width=125.25},
{"btn", id="Karakterler", window=wndSkin, x=20, y=80, width=125.25},
{"btn", id="Kıyafetler", window=wndClothes, x=150, y=80, width=125.25},
{"btn", id="Yürüyüş Stilleri" , window=wndWalking, x=20, y=105, width=125.25},
{"btn", id="Dövüş Stilleri" , window=wndFG, x=150, y=105, width=125.25},
{"btn", id="Şans Oyunu", onclick = KumarPaneli, x=20, y=130, width=255},

{"btn", id="createvehicle", window=wndCreateVehicle, text="Araçlar", x=20, width=125.25},
{"btn", id="Görevler", onclick = GorevPaneli, x=150, width=125.25},
{"btn", id="Araç Kontrol", onclick = AracKontrolPaneli, x=20, width=255},
{"btn", id="Yenile", onclick=repairVehicle, x=20},
{"btn", id="Döndür", onclick=flipVehicle, x=80},
{"btn", id="Renk", onclick=openColorPicker, x=156, width=50},
{"btn", id="Modifiye", window=wndUpgrades, x=209, width=65},
{"btn", id="Youtube", onclick = CashTubePaneli, x=20, width=255},
{"br"},
{'lbl', text='Kordinat:', x=22},
{'lbl', id='xpos', text='x', width=45},
{'lbl', id='ypos', text='y', width=45},
{'lbl', id='zpos', text='z', width=45},
{"br"},
{"chk", id="Ekranı Gizle", onclick=ekrangizle, x=20},
{"chk", id="Ekranı Göster", onclick=ekrangoster, x=120},
{"chk", id="lightson", text="Farları Aç", onclick=forceLightsOn, x=20},
{"chk", id="lightsoff", text="Farları Kapat", onclick=forceLightsOff, x=120},
},
oncreate = mainWndShow,
onclose = mainWndClose
}
----------------------
-----Fonksiyonlar-----
----------------------
function errMsg(msg)
outputChatBox(msg, 0, 150, 255)
end

addEventHandler("onClientResourceStart", g_ResRoot,
function()
fadeCamera(true)
setTimer(getPlayers, 1000, 1)

bindKey("f1", "down", toggleFRWindow)
createWindow(wndMain)
hideAllWindows()

triggerServerEvent("onLoadedAtClient", g_ResRoot, g_Me)
end
)

function showMap()
createWindow(wndSetPos)
showCursor(true)
end

function toggleFRWindow()
if getElementData(g_Me, ByCash.gorevdata_) then return false end
guiSetVisible(gorevde_panel, false)
if isWindowOpen(wndMain) then
showCursor(false)
hideAllWindows()
colorPicker.closeSelect()
else
guiSetVisible(gorevde_panel, false)
showCursor(true)
showAllWindows()
createWindow(wndMain)
end
end

function getPlayers()
g_PlayerData = {}
table.each(getElementsByType("player"), joinHandler)
end

function joinHandler(player)
if (not g_PlayerData) then return end
g_PlayerData[player or source] = { name = getPlayerName(player or source), gui = {} }
end
addEventHandler("onClientPlayerJoin", g_Root, joinHandler)

addEventHandler("onClientPlayerQuit", g_Root,
function()
if (not g_PlayerData) then return end
table.each(g_PlayerData[source].gui, destroyElement)
g_PlayerData[source] = nil
end
)

addEventHandler("onClientPlayerWasted", g_Me,
function()
onExitVehicle(g_Me)
end
)

addEventHandler("onClientPlayerVehicleEnter", g_Me, onEnterVehicle)
addEventHandler("onClientPlayerVehicleExit", g_Me, onExitVehicle)

addEventHandler("onClientResourceStop", g_ResRoot,
function()
showCursor(false)
setPedAnimation(g_Me, false)
end
)
« Son Düzenleme: 25 Mayıs 2018, 19:02:52 Gönderen: ByCash »
 


Çevrimdışı By.Secret

  • Kendi Halinde Bir Coder :)
  • Acemi Üye
  • *
    • İleti: 137
  • C#
Yanıtla #4 : 25 Mayıs 2018, 18:27:09
Kod: lua
---------------
-----Panel-----
---------------
wndMain = {
"wnd",
x = 10,
y = 190,
width = 300,
controls = {
{"btn", text= ByCash.paneladi_, id="paneladi", x=-11, y=0, width=310},
{"br"},
{"btn", id="Ölüm", onclick=killlocalPlayer, x=20, y=55, width=125.25},
{"btn", id="Animasyonlar", window=wndAnim, x=150, y=55, width=125.25},
{"btn", id="Karakterler", window=wndSkin, x=20, y=80, width=125.25},
{"btn", id="Kıyafetler", window=wndClothes, x=150, y=80, width=125.25},
{"btn", id="Yürüyüş Stilleri" , window=wndWalking, x=20, y=105, width=125.25},
{"btn", id="Dövüş Stilleri" , window=wndFG, x=150, y=105, width=125.25},
{"btn", id="Şans Oyunu", onclick = KumarPaneli, x=20, y=130, width=255},

{"btn", id="createvehicle", window=wndCreateVehicle, text="Araçlar", x=20, width=125.25},
{"btn", id="Görevler", onclick = GorevPaneli, x=150, width=125.25},
{"btn", id="Araç Kontrol", onclick = AracKontrolPaneli, x=20, width=255},
{"btn", id="Yenile", onclick=repairVehicle, x=20},
{"btn", id="Döndür", onclick=flipVehicle, x=80},
{"btn", id="Renk", onclick=openColorPicker, x=156, width=50},
{"btn", id="Modifiye", window=wndUpgrades, x=209, width=65},
{"btn", id="Youtube", onclick = CashTubePaneli, x=20, width=255},
{"br"},
{'lbl', text='Kordinat:', x=22},
{'lbl', id='xpos', text='x', width=45},
{'lbl', id='ypos', text='y', width=45},
{'lbl', id='zpos', text='z', width=45},
{"br"},
{"chk", id="Ekranı Gizle", onclick=ekrangizle, x=20},
{"chk", id="Ekranı Göster", onclick=ekrangoster, x=120},
{"chk", id="lightson", text="Farları Aç", onclick=forceLightsOn, x=20},
{"chk", id="lightsoff", text="Farları Kapat", onclick=forceLightsOff, x=120},
},
oncreate = mainWndShow,
onclose = mainWndClose
}

dedigim gibi butonu eklememişsin altta verdigim  btn kodunu üsteki bölümden bir yere eklerse  olucaktır olmassa işlevi yanlış vermişsindir scripti atıp ekleyebilriim

 {"btn", id="Temel Eşyalar", window=wndTemel, x=20, y=80, width=125.25},
« Son Düzenleme: 25 Mayıs 2018, 19:02:19 Gönderen: ByCash »
 


Çevrimdışı cembeyss

  • Yeni Üye
  • *
    • İleti: 12
Yanıtla #5 : 25 Mayıs 2018, 18:44:45
Linki görebilmek için Kayıt olun yada Giriş yapın. Ya kusura bakmada ben yapamadım ben sana f1 panelin linkini atsaam sen yaparmısın ?

Linki görebilmek için Kayıt olun yada Giriş yapın.
« Son Düzenleme: 25 Mayıs 2018, 18:49:56 Gönderen: cembeyss »
 


MTASATURK

Ynt: [YARDIM]F1 Panele 'Temel Eşyalar' Ekleme
« Yanıtla #5 : 25 Mayıs 2018, 18:44:45 »

Çevrimdışı DogukanUCAN

  • Acemi Üye
  • *
    • İleti: 177
  • Lowide Freeroam
Yanıtla #6 : 25 Mayıs 2018, 19:41:34
Linki görebilmek için Kayıt olun yada Giriş yapın. tıklayarak indirebilirsin.
 


Çevrimdışı cembeyss

  • Yeni Üye
  • *
    • İleti: 12
Yanıtla #7 : 26 Mayıs 2018, 06:47:24
çok saolun admin konu kilitlenebilir
 


Çevrimdışı MarkeloF

  • Admin
  • *
    • İleti: 901
  • Maybe later.
Yanıtla #8 : 26 Mayıs 2018, 07:28:41
Konu sahibinin isteği üzerine konu kilitlendi.