-
Posts
439 -
Joined
-
Last visited
-
Days Won
4
Everything posted by Turbe$Z
-
local sX, sY = guiGetScreenSize() local mainW, mainH = 285, 125 local mainX, mainY = sX-mainW-10, sY-mainH-730 local lp = getLocalPlayer() local hudColors = { ["main"] = tocolor(0, 0, 0, 125), ["sub"] = tocolor(0, 0, 0, 75), ["health"] = tocolor(255, 0, 0, 75), ["armor"] = tocolor(255, 255, 255, 75), ["oxygen"] = tocolor(0, 186, 255, 75) } addEventHandler("onClientRender", getRootElement(), function() showPlayerHudComponent("all", false) showPlayerHudComponent("crosshair", true) dxDrawRectangle(mainX, mainY, mainW, mainH, hudColors["main"]) -- Életerő dxDrawRectangle(mainX+135, mainY+10, mainW-151, 20, hudColors["sub"]) dxDrawRectangle(mainX+137, mainY+12, getElementHealth(localPlayer)*(mainW-25)/400, 16, hudColors["health"]) dxDrawText(math.floor(getElementHealth(lp)).." élet", mainX+257, mainY+14.2, mainX+mainW-135, mainY+30, tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center") dxDrawText(math.floor(getElementHealth(lp)).." élet", mainX+257, mainY+10, mainX+mainW-135, mainY+30, tocolor(255, 255, 255, 255), 1, "default-bold", "center", "center") -- Páncél dxDrawRectangle(mainX+135, mainY+34, mainW-150, 20, hudColors["sub"]) dxDrawRectangle(mainX+137, mainY+36, getPedArmor(localPlayer)*(mainW-155)/100, 16, hudColors["armor"]) dxDrawText("Életpajzs", mainX+257, mainY+38.2, mainX+mainW-135, mainY+54, tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center") dxDrawText("Életpajzs", mainX+257, mainY+35, mainX+mainW-135, mainY+54, tocolor(255, 255, 255, 255), 1, "default-bold", "center", "center") -- Oxigén dxDrawRectangle(mainX+135, mainY+58, mainW-150, 20, hudColors["sub"]) dxDrawRectangle(mainX+137, mainY+60, getPedOxygenLevel(localPlayer)*(mainW-155)/1000, 16, hudColors["oxygen"]) dxDrawText("Oxigén", mainX+257, mainY+62.2, mainX+mainW-135, mainY+78, tocolor(0, 0, 0, 255), 1, "default-bold", "center", "center") dxDrawText("Oxigén", mainX+257, mainY+59, mainX+mainW-135, mainY+78, tocolor(255, 255, 255, 255), 1, "default-bold", "center", "center") -- Pénz local moneyLength = string.len(getPlayerMoney(localPlayer)) dxDrawText(string.sub("FullFunPlay ", moneyLength-25, 29) .. "#000000$" .. getPlayerMoney(localPlayer) .. "#000000", mainX+10, mainY+96.1, mainX+mainW-10, nil, tocolor(0, 0, 0, 255), 1.6, "default-bold", "right", nil, false, false, false, true) dxDrawText(string.sub("FullFunPlay ", moneyLength-25, 29) .. "#00baff$" .. getPlayerMoney(localPlayer) .. "#00baff", mainX+10, mainY+93, mainX+mainW-10, nil, tocolor(255, 255, 255, 255), 1.6, "default-bold", "right", nil, false, false, false, true) -- Fegyver local pWeapon = getPedWeapon(localPlayer) local clipAmmo = getPedAmmoInClip(localPlayer) local totalAmmo = getPedTotalAmmo(localPlayer) --dxDrawText("Lőszer: " .. clipAmmo .. " | " .. totalAmmo-clipAmmo, mainX+100, 109.5, nil, nil, tocolor(0, 0, 0, 255), 1.1, "default-bold") dxDrawText("Lőszer: " .. clipAmmo .. " | " .. totalAmmo-clipAmmo, mainX+35, 120, nil, nil, tocolor(255, 255, 255, 255), 1, "default-bold") dxDrawImage(mainX-80, 50, 200, 100, "img/" .. pWeapon.. ".png") end) how to fix this problem? /sorry for my bad english/ thx the help:D
-
Ohh thanks man :DDD
-
function stats(thePlayer) setPedStat ( thePlayer, 24, 1000 ) setElementHealth( thePlayer, 200 ) end addEventHandler("onPlayerJoin", root, stats) still not working :c
-
i added "root," but doesn't working
-
function stats(thePlayer) setPlayerStat ( player, 24, 1000 ) setElementHealth( thePlayer, 200 ) end addEventHandler("onPlayerJoin", stats) what wrong ??
-
i created a gui with memo, but when i type a word in memo and press (for example) 't' i type to chat instead of memo how to fix this bug? /sorry for my bad english/ and thanks the help:D
-
for example: --------------------------- -- asd --------------------------- local GUIEditor = { button = {}, window = {}, memo = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(518, 358, 435, 223, "Teszt ablak", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.memo[1] = guiCreateMemo(11, 29, 414, 155, "Teszt memo", false, GUIEditor.window[1]) guiMemoSetReadOnly(GUIEditor.memo[1], true) GUIEditor.button[1] = guiCreateButton(11, 189, 414, 24, "Teszt gomb", false, GUIEditor.window[1]) guiSetVisible(GUIEditor.window[1], false) end ) {'btn', id='GUIEditor.window[1]', text='Teszt', window=GUIEditor.window[1], width=244}, but this doesn't working
-
like as skin, weapon...etc. panel, just guieditor. How??
-
function Superman.Start() if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)),aclGetGroup("Admin")) then local self = Superman -- Register events addEventHandler("onClientResourceStop", getResourceRootElement(thisResource), Superman.Stop, false) addEventHandler("onPlayerJoin", rootElement, Superman.onJoin) addEventHandler("onPlayerQuit", rootElement, Superman.onQuit) addEventHandler("onClientRender", rootElement, Superman.processControls) addEventHandler("onClientRender", rootElement, Superman.processFlight) addEventHandler("onClientPlayerDamage", localPlayer, Superman.onDamage, false) addEventHandler("onClientElementDataChange", rootElement, Superman.onDataChange) addEventHandler("onClientElementStreamIn", rootElement, Superman.onStreamIn) addEventHandler("onClientElementStreamOut", rootElement, Superman.onStreamOut) -- Bind keys --bindKey("jump", "down", Superman.onJump) -- Register commands addCommandHandler("superman", Superman.cmdSuperman) -- Initializate attributes self.smokeGenerators = {} self.rotations = {} self.previousVelocity = {} end end addEventHandler("onClientResourceStart", getResourceRootElement(thisResource), Superman.Start, false) Error: attempt to call global 'getPlayerAccount' (a nil value) wtf..?
-
i added this lines to admin acl: <right name="general.webpanel_chat" access="true" /> <right name="general.webpanel_player" access="true" /> <right name="general.webpanel_ban" access="true" /> <right name="general.webpanel_settings" access="true" /> works fine, but...i added moderator acl but doesn't working the webpanel...wtf? Why?
-
fr_server.lua: function warpMe(targetPlayer) local interior = getElementInterior(targetPlayer) setElementInterior(source, interior) setCameraInterior(source, interior) if getElementData(targetPlayer, "IsWarpLocked") then outputChatBox("Ez a játékos nem engedte meg hogy rá warpoljanak", source, r, g, b, false) return end if isPedDead(source) then spawnMe() end local vehicle = getPedOccupiedVehicle(targetPlayer) if not vehicle then -- target player is not in a vehicle - just warp next to him local x, y, z = getElementPosition(targetPlayer) clientCall(source, 'setPlayerPosition', x + 2, y, z) else -- target player is in a vehicle - warp into it if there's space left if getPedOccupiedVehicle(source) then --removePlayerFromVehicle(source) outputChatBox('Get out of your vehicle first.', source) return end local numseats = getVehicleMaxPassengers(vehicle) for i=0,numseats do if not getVehicleOccupant(vehicle, i) then if isPedDead(source) then local x, y, z = getElementPosition(vehicle) spawnMe(x + 4, y, z + 1) end warpPedIntoVehicle(source, vehicle, i) return end end outputChatBox("No free seats left in " .. getPlayerName(targetPlayer) .. "'s vehicle.", source, 255, 0, 0) end end addCommandHandler("warpki", function(player) outputChatBox("Nem tudnak rád warpolni", source, r, g, b) setElementData(player, "IsWarpLocked", true) end) addCommandHandler("warpbe", function(player) outputChatBox("Mostmár rád tudnak warpolni", source, r, g, b) removeElementData(player, "IsWarpLocked") end) fr_client.lua: function toggleWarponoff() local state = guiCheckBoxGetSelected(getControl(wndMain, 'warpkibe')) guiCheckBoxSetSelected(getControl(wndMain, 'warpkibe'), not state) server.IsWarpLocked(state) end {'chk', id='warpkibe', text='Warp', onclick=toggleWarponoff},
-
what is the solution for this?
- 4 replies
-
- votescript
- script
- (and 4 more)
-
--client local szavon = false local ido = 30 local valasz = 0 GUIEditor_Window = {} GUIEditor_Label = {} function szAblak(ker,v1,v2) if not szavon then local v_1 = v1 local v_2 = v2 local szavon = true local sw,sh = guiGetScreenSize() GUIEditor_Window[1] = guiCreateWindow(sw/1.48,sh/1.4,sw/3.2,sh/3.6,"Szavazás",false) guiWindowSetMovable(GUIEditor_Window[1],false) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Label[1] = guiCreateLabel(0.0474,0.1242,0.9161,0.2919,ker,true,GUIEditor_Window[1]) guiLabelSetHorizontalAlign(GUIEditor_Label[1],"center",true) guiSetFont(GUIEditor_Label[1],"default-bold-small") GUIEditor_Label[2] = guiCreateLabel(0.0657,0.4783,0.8759,0.1553,"1.) "..v_1,true,GUIEditor_Window[1]) --guiLabelSetColor(GUIEditor_Label[2],255,200,200) --guiSetFont(GUIEditor_Label[2],"default-bold-small") GUIEditor_Label[3] = guiCreateLabel(0.0657,0.6335,0.8759,0.1491,"2.) "..v_2,true,GUIEditor_Window[1]) GUIEditor_Label[4] = guiCreateLabel(0.0474,0.8075,0.8,0.1,ido,true,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[4],150,150,255) guiSetFont(GUIEditor_Label[4],"clear-normal") bindKey ("1", "down", function() guiSetFont(GUIEditor_Label[3],"clear-normal") guiLabelSetColor(GUIEditor_Label[3],255,255,255) valasz = 1 guiLabelSetColor(GUIEditor_Label[2],255,200,200) guiSetFont(GUIEditor_Label[2],"default-bold-small") end) bindKey ("2", "down", function() guiSetFont(GUIEditor_Label[2],"default-normal") guiLabelSetColor(GUIEditor_Label[2],255,255,255) valasz = 2 guiLabelSetColor(GUIEditor_Label[3],255,200,200) guiSetFont(GUIEditor_Label[3],"default-bold-small") end) lejar = setTimer( function() ido = ido-1 guiSetText(GUIEditor_Label[4], ido ) if ido == 0 then szVeg() --killTimer(lejar) end end, 1000,30) end end function szVeg() if isTimer(lejar) then killTimer(lejar) end szavon = false guiSetText(GUIEditor_Label[4], "szavazatok számlálása..." ) guiSetFont(GUIEditor_Label[2],"default-normal") guiSetFont(GUIEditor_Label[3],"default-normal") guiLabelSetColor(GUIEditor_Label[3],255,255,255) guiLabelSetColor(GUIEditor_Label[2],255,255,255) --("valasz: "..valasz) triggerServerEvent("submit",getLocalPlayer(),valasz) unbindKey ("1", "down", function() guiSetFont(GUIEditor_Label[3],"clear-normal") guiLabelSetColor(GUIEditor_Label[3],255,255,255) valasz = 1 guiLabelSetColor(GUIEditor_Label[2],255,200,200) guiSetFont(GUIEditor_Label[2],"default-bold-small") end) unbindKey ("2", "down", function() guiSetFont(GUIEditor_Label[2],"default-normal") guiLabelSetColor(GUIEditor_Label[2],255,255,255) valasz = 2 guiLabelSetColor(GUIEditor_Label[3],255,200,200) guiSetFont(GUIEditor_Label[3],"default-bold-small") end) end addEvent("szvzas",true) addEventHandler("szvzas",getRootElement(), function(kerdes,val1,val2) szAblak(kerdes,val1,val2) end) addEvent("valaszok",true) addEventHandler("valaszok",getRootElement(), function(v1,v2) guiSetText(GUIEditor_Label[4], "_@/\"" ) guiSetText(GUIEditor_Label[2], guiGetText(GUIEditor_Label[2]) .. " - " .. v1 ) guiSetText(GUIEditor_Label[3], guiGetText(GUIEditor_Label[3]) .. " - " .. v2 ) if v1 > v2 then guiSetFont(GUIEditor_Label[2],"default-bold-small") elseif v1 < v2 then guiSetFont(GUIEditor_Label[3],"default-bold-small") end setTimer( function() destroyElement(GUIEditor_Window[1]) szavon = false ido = 30 valasz = 0 end, 5000, 1) end) --server function vote(p,s) if hasObjectPermissionTo(p,"function.kickPlayer") then triggerClientEvent("szvzas",getRootElement()) end end addCommandHandler("k",vote) function valaszok () triggerClientEvent(getRootElement(),"valaszok",getRootElement()) end Error: client.lua:20: attempt to concatenate local v_1 (a nil value) wtf?
- 4 replies
-
- votescript
- script
- (and 4 more)
-
fr_server.lua: function warpMe(targetPlayer) local interior = getElementInterior(targetPlayer) setElementInterior(source, interior) setCameraInterior(source, interior) if getElementData(targetPlayer, "IsWarpLocked") then outputChatBox("The player you want to warp to has locked warping.", source, 255, 0, 0, false) return end if isPedDead(source) then spawnMe() end local vehicle = getPedOccupiedVehicle(targetPlayer) if not vehicle then -- target player is not in a vehicle - just warp next to him local x, y, z = getElementPosition(targetPlayer) clientCall(source, 'setPlayerPosition', x + 2, y, z) else -- target player is in a vehicle - warp into it if there's space left if getPedOccupiedVehicle(source) then --removePlayerFromVehicle(source) outputChatBox('Get out of your vehicle first.', source) return end local numseats = getVehicleMaxPassengers(vehicle) for i=0,numseats do if not getVehicleOccupant(vehicle, i) then if isPedDead(source) then local x, y, z = getElementPosition(vehicle) spawnMe(x + 4, y, z + 1) end warpPedIntoVehicle(source, vehicle, i) return end end outputChatBox("No free seats left in " .. getPlayerName(targetPlayer) .. "'s vehicle.", source, 255, 0, 0) end end addCommandHandler("lockwarp", function(player) setElementData(player, "IsWarpLocked", true) end) addCommandHandler("unlockwarp", function(player) removeElementData(player, "IsWarpLocked") end) fr_client.lua: {'chk', id='IsWarpLocked', text='Warp', onclick=toggleWarp, width=60},
-
Nem nyitja meg a gombra kattintva az ablakot, de miért nem? az ablak: --------------------------- -- My window --------------------------- local GUIEditor = { window = {}, } wndMywindow = { 'wnd', GiftWindow = guiCreateWindow(322, 223, 783, 193, "ablak", false) guiWindowSetSizable(ablak, false) guiSetVisible (ablak, false) guiSetProperty(ablak, "CaptionColour", "FF00D655") } és a gomb: {'btn', id='ablak', window=wndMywindow, width=255},