-
Posts
186 -
Joined
-
Last visited
-
Days Won
4
Everything posted by AngelAlpha
-
replace local Inv1 = convert(getElementData(localPlayer, "Inventário:Slots") or 0) or "0" local Inv2 = convert(getElementData(localPlayer, "Inventário:Max") or 0) or "0" local Inv3 = convert(getElementData(objbau, "Bau:Slots") or 0) or 0 local Inv4 = convert(getElementData(objbau, "Bau:Max") or 0) or 0 ---------------------------------------------------------------------------------------- function convert ( number ) return tonumber(string.format("%.1f", format(number)) end
-
the error is not in the syntax, but in the fact that there is no number
-
full code pls.
-
in the one-resource add to meta <export function="firstFunction" type="server"/> <!-- if function on server side --> <export function="firstFunction" type="client"/> <!-- if function on client side --> <export function="firstFunction" type="shared"/> <!-- if function can used on server and client side --> and in two-resource use exports["one-resource"]:firstFunction( [args] ) -- or exports.one-resource:firstFunction( [args] )
-
local sx, sy = guiGetScreenSize() local relx,rely = sx/1920,sy/1080; local DutyPanel = false local MenuPoints = {00.35 ,00.20} color1 = tocolor(30, 40, 50, 255) addEventHandler("onClientRender", root, function() if (DutyPanel) then if not (getElementData(localPlayer, "Duty")) then dxDrawRectangle(sx*(MenuPoints[1]), sy*(MenuPoints[2]), sx*.3, sy*.5, tocolor(50, 60, 70, 230))-- Panel dxDrawRectangle(sx*(MenuPoints[1]), sy*(MenuPoints[2]), sx*.3, sy*0.08, tocolor(20, 30, 40, 255))-- Panel fejléc dxDrawRectangle(sx*.4, sy*.4 , sx*.2, sy*0.080, color1) dxDrawText("Duty Felvételi Panel", sx*.800, sy*.4 , sx*.2, sy*0.080, tocolor(200, 200, 200, 255), relx*4, rely*4, "default-bold", "center", "center", false, false, false) dxDrawText("Duty Felvétel", sx*.800, sy*0.80 , sx*.2, sy*0.080, tocolor(200, 200, 200, 255), relx*4, rely*4, "default-bold", "center", "center", false, false, false) else dxDrawRectangle(sx*(MenuPoints[1]), sy*(MenuPoints[2]), sx*.3, sy*.5, tocolor(50, 60, 70, 230))-- Panel dxDrawRectangle(sx*(MenuPoints[1]), sy*(MenuPoints[2]), sx*.3, sy*0.08, tocolor(20, 30, 40, 255))-- Panel fejléc dxDrawRectangle(sx*.4, sy*.4 , sx*.2, sy*0.080, color1) dxDrawText("Duty Felvételi Panel", sx*.800, sy*.4 , sx*.2, sy*0.080, tocolor(200, 200, 200, 255), relx*4, rely*4, "default-bold", "center", "center", false, false, false) dxDrawText("Duty leadása", sx*.800, sy*0.80 , sx*.2, sy*0.080, tocolor(200, 200, 200, 255), relx*4, rely*4, "default-bold", "center", "center", false, false, false) end ---------- if isMouseInPosition(sx*.4, sy*.4 , sx*.2, sy*0.080) then color1 = tocolor(80, 90, 100, 255) else color1 = tocolor(30, 40, 50, 255) end end end) addEventHandler("onClientClick", root, function(button, state) if (DutyPanel) then if ( button == "left" and state == "down" ) then if isMouseInPosition(sx*.4, sy*.4 , sx*.2, sy*0.080) then triggerServerEvent("Dutyon", root) DutyPanel = false end end end end) function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing( ) ) then return false end local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy ) return ( ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) ) end addEvent("OpenDutyPanel", true) addEventHandler("OpenDutyPanel", root, function() if not (DutyPanel) then DutyPanel = true else outputChatBox("#961f17[RENDSZER]: #ffffffMár menűbe vagy!", 0, 0, 0, true) end end) function ShowCursor() if not isCursorShowing() then showCursor(true) else showCursor(false) end end bindKey("m", "Down", ShowCursor) try this code
-
How i can add 2 gamemods inside one single server
AngelAlpha replied to Ahmedos's topic in Scripting
check it [lobby] | Multi Theft Auto | Community -
addEventHandler ("onPlayerLogin", root, function(_, acc) setAccountData(acc, "lastlogin:timestamp", getRealTime().timestamp) end) addEventHandler ("onResourceStart", resourceRoot, function() for i, v in ipairs (getAccounts()) do if not getAccountData (v, "lastlogin:timestamp") then setAccountData(acc, "lastlogin:timestamp", getRealTime().timestamp) end end end) ------------------------- addEventHandler ("onPlayerLogin", root, function(_, acc) local timestamp = getAccountData(acc, "lastlogin:timestamp") local time = getRealTime(timestamp) local day = time.monthday local month = time.month + 1 local year = time.year + 1900 local id = getElementData(source, "your ID data") or "N/A" outputDebugString ("person ID "..id.." logs in "..day.." "..month..", "..year) end)
-
local models = { 411, 478, 240 -- add as many models here as you want, and the code will work without any other changes } local displayVehicle, index -- declaring variables as local ahead of time allows to get the speed benefits of `local` while having variables accessible thoughout the current script file (not accessible in other scripts of the same resource though) local function updateDisplayVehicle() if (isElement(displayVehicle)) then -- to prevent generating errors when the vehicle doesn't exist destroyElement(displayVehicle) -- delete the existing vehicle if it exists end local vehModel = models[index] -- get the vehicle model corresponding to the current index displayVehicle = createVehicle(vehModel, 2154.45996, -1153.21362, 23.87550) -- spawns a vehicle with the correct vehicle model end updateDisplayVehicle() local function tryChangeIndex(newIndex) if not models[newIndex] then if newIndex < 1 then newIndex = #models else newIndex = 1 end end index = newIndex updateDisplayVehicle() end local function nextVehicle() tryChangeIndex(index + 1) end bindKey("arrow_r", "down", nextVehicle) local function previousVehicle() tryChangeIndex(index - 1) end bindKey("arrow_l", "down", previousVehicle)
-
my code will only work with vehicles that have been created in this resource show pls all your code
-
client.lua addEventHandler("onClientVehicleExit", resourceRoot, function(player, seat) if (player == localPlayer) then local vehicle = getPedOccupiedVehicle(localPlayer) if (vehicle) then if (vehicle == getElementData(localPlayer, "Jobveh")) then if (seat == 0) then outputChatBox("#1db8b5[Munka]#549c6bSikeressen leadtad a munka járművedet", 0, 0, 0, true) end end end end end ) meta.xml <meta> <script src="client.lua" type="client"/> </meta>
-
нет, проблема была в условиях, пересмотри свою версию и мою
-
default resource "killmessages"
-
Я точно не уверен, но вроде так function kek() showCursor(true) dgs:dgsSetVisible(window,true) dgs:dgsSetVisible(imgposition1,true) dgs:dgsSetVisible(imgposition2,true) end function kek1() dgs:dgsSetVisible(window,false) dgs:dgsSetVisible(imgposition1,false) dgs:dgsSetVisible(imgposition2,false) end bindKey('1','down',kek) addEventHandler('onDgsMouseClick',root,function(btn,state) ----------------Армия ------------------- if state == "down" and btn == "left" and source == btnArmy then kek1() triggerEvent("PedCreate",localPlayer) showCursor(true) dgs:dgsSetVisible(but1,true) dgs:dgsSetVisible(but2,true) dgs:dgsSetVisible(but3,true) si = 1 if not si == 1 then si = 1 end skinid1 = 179 setCameraMatrix(247.96488952637,1861.4558105469,14.794466018677,248.35562133789,1764.9252929688,-11.315200805664) elseif state == "down" and btn == "left" and source == but1 then si = si - 1 if si == 0 then si = 5 end elseif state == "down" and btn == "left" and source == but2 then dgs:dgsSetVisible(but1,false) dgs:dgsSetVisible(but2,false) dgs:dgsSetVisible(but3,false) setElementData(localPlayer,"skinid1",skinid1) triggerServerEvent("spawnPlayerArmy",localPlayer) setCameraTarget( localPlayer ) showCursor(false) triggerEvent("PedDel",localPlayer) elseif state == "down" and btn == "left" and source == but3 then si = si + 1 if si == 6 then si = 1 end if si == 1 then skinid1 = 179 setCameraMatrix(247.96488952637,1861.4558105469,14.794466018677,248.35562133789,1764.9252929688,-11.315200805664) elseif si == 2 then skinid1 = 285 setCameraMatrix(246.00991821289,1861.4471435547,14.794466018677,246.40065002441,1764.9166259766,-11.315200805664) elseif si == 3 then skinid1 = 287 setCameraMatrix(243.98690795898,1861.4406738281,14.794466018677,244.37763977051,1764.91015625,-11.315200805664) elseif si == 4 then skinid1 = 73 setCameraMatrix(241.95097351074,1861.4321289063,14.794466018677,242.34170532227,1764.9016113281,-11.315200805664) elseif si == 5 then skinid1 = 191 setCameraMatrix(239.9241027832,1861.4228515625,14.794466018677,240.31483459473,1764.8923339844,-11.315200805664) end -------------Террористы ------------- elseif state == "down" and btn == "left" and source == btnTerr then kek1() showCursor(true) dgs:dgsSetVisible(but4,true) dgs:dgsSetVisible(but5,true) dgs:dgsSetVisible(but6,true) ti = 1 if not ti == 1 then ti = 1 end triggerEvent("PedCreateTerr",localPlayer) skinid1 = 28 setCameraMatrix(-274.44561767578,2588.4030761719,64.03636932373,-276.62969970703,2686.3229980469,43.863948822021) elseif state == "down" and btn == "left" and source == but4 then ti = ti - 1 if ti == 0 then ti = 5 end elseif state == "down" and btn == "left" and source == but5 then dgs:dgsSetVisible(but4,false) dgs:dgsSetVisible(but5,false) dgs:dgsSetVisible(but6,false) setElementData(localPlayer,"skinid1",skinid1) triggerServerEvent("spawnPlayerTerr",localPlayer) setCameraTarget( localPlayer ) showCursor(false) triggerEvent("PedDelTerr",localPlayer) elseif state == "down" and btn == "left" and source == but6 then ti = ti + 1 if ti == 6 then ti = 1 end if ti == 1 then skinid1 = 28 setCameraMatrix(-274.44561767578,2588.4030761719,64.03636932373,-276.62969970703,2686.3229980469,43.863948822021) elseif ti == 2 then skinid1 = 30 setCameraMatrix(-272.44989013672,2588.4465332031,64.03636932373,-274.63397216797,2686.3664550781,43.863948822021) elseif ti == 3 then skinid1 = 126 setCameraMatrix(-270.45120239258,2588.4909667969,64.03636932373,-272.63528442383,2686.4108886719,43.863948822021) elseif ti == 4 then skinid1 = 93 setCameraMatrix(-268.44940185547,2588.5341796875,64.03636932373,-270.63348388672,2686.4541015625,43.863948822021) elseif ti == 5 then skinid1 = 150 setCameraMatrix(-266.46176147461,2588.5773925781,64.03636932373,-268.64584350586,2686.4973144531,43.863948822021) elseif ti == 6 then ti = ti - 1 end end end) Просто если бы ты написал в чем именно проблема, было бы легче понять что не так
-
local marker = createMarker (...) addEventHandler ("onMarkerHit", marker, function(el, dim) if not dim then return end if getElementType(el) ~= "player" then return end local veh = getPedOccupiedVehicle (el) if veh then if getVehicleOccupant(veh) ~= el then return end setElementPosition (veh, x, y, z) else setElementPosition (el, x, y, z) end end)
-
event handlers not working after resource restart
AngelAlpha replied to itsHasaN's topic in Scripting
add 'addEvent' in resources when used your 'onPlayerFirstSpawn' -
function teamChatZm( message, messageType ) local thePlayer = getPlayerName( source ) if messageType == 2 then -- Teamsay local playerTeam = getPlayerTeam( source ) if ( playerTeam ) then local teamPlayers = getPlayersInTeam( playerTeam ) cancelEvent() outputChatBox( "*Message type: " .. messageType .. " from: " .. thePlayer ) outputChatBox( "Castiel has triggered a client side event.", teamPlayers, 0, 255, 0, true ) for i, v in ipairs (teamPlayers) do if v ~= source then triggerClientEvent (v, "runOurClientEvent", root ) end end end end end addEventHandler("onPlayerChat", root, teamChatZm) try this code
-
show your `RawData` in shader
-
your server must have [web] resources start all web resources and enter in panel from url http://ip:httpport/resourcebrowser/ preview
-
try col radius - 3-4
-
try this code if ( msg:gsub(" ", "") == "" ) then outputChatBox( "Invalid text input." ) return end
-
Ты же тут не меняешь ротацию, она у тебя постоянно 0
-
No. If vehicle 4-door DFF replace on 2-door vehicle, then only 2 players can seat
- 1 reply
-
- 1
-
elements.main_profile = dgsCreateScrollPane (0, 80*px, sx, sy - 80*px, false) ........... local gradient = dgsCreateGradient (tocolor(255, 107, 0), tocolor(255, 240, 0), 90 - 12) local gradient2 = dgsCreateGradient (Config.colors[1], Config.colors[1], 0) elements.tabPanel_profile = dgsCreateTabPanel (100*px, 650*px, 1140*px, 332*px, false, elements.main_profile, 60*px, _, tocolor(50, 50, 50, 0)) elements.tabPanel_profile_main = dgsCreateTab("Основная статистика", elements.tabPanel_profile) elements.tabPanel_profile_finance = dgsCreateTab("Имущество", elements.tabPanel_profile) elements.tabPanel_profile_job = dgsCreateTab("Занятость", elements.tabPanel_profile) dgsSetProperty(elements.tabPanel_profile,"tabImage",{gradient2,gradient2,gradient}) dgsSetProperty(elements.tabPanel_profile,"tabPadding",{15*px, false}) dgsSetProperty(elements.tabPanel_profile_main,"textColor",{tocolor(255, 255, 255), tocolor(150, 150, 150), tocolor(0, 0, 0)}) dgsSetProperty(elements.tabPanel_profile_finance,"textColor",{tocolor(255, 255, 255), tocolor(150, 150, 150), tocolor(0, 0, 0)}) dgsSetProperty(elements.tabPanel_profile_job,"textColor",{tocolor(255, 255, 255), tocolor(150, 150, 150), tocolor(0, 0, 0)}) @thisdp and i find a few mistakes mask.lua > 16 line if not(masks[texture2]) then error(dgsGenAsrt(texture2,"dgsCreateMask",2,"texture",_,_"unsupported type")) end > if not(masks[texture2]) then error(dgsGenAsrt(texture2,"dgsCreateMask",2,"texture",_,_,"unsupported type")) end mask.lua > line 69-81 function dgsMaskCenterTexturePosition(dgsMask,w,h) if not(dgsGetPluginType(mask) == "dgs-dxmask") then error(dgsGenAsrt(mask,"dgsMaskCenterTexturePosition",1,"dgs-dxmask")) end local ratio = w/h local scaleW,scaleH = (ratio>1 and ratio or 1),(1/ratio>1 and 1/ratio or 1) dgsMaskSetSetting(dgsMask,"offset",{scaleW/2-0.5,scaleH/2-0.5,1}) end function dgsMaskAdaptTextureSize(dgsMask,w,h) if not(dgsGetPluginType(mask) == "dgs-dxmask") then error(dgsGenAsrt(mask,"dgsMaskAdaptTextureSize",1,"dgs-dxmask")) end local ratio = w/h local scaleW,scaleH = (ratio>1 and ratio or 1),(1/ratio>1 and 1/ratio or 1) dgsMaskSetSetting(dgsMask,"scale",{scaleW,scaleH,1}) end >>> function dgsMaskCenterTexturePosition(mask,w,h) if not(dgsGetPluginType(mask) == "dgs-dxmask") then error(dgsGenAsrt(mask,"dgsMaskCenterTexturePosition",1,"dgs-dxmask")) end local ratio = w/h local scaleW,scaleH = (ratio>1 and ratio or 1),(1/ratio>1 and 1/ratio or 1) dgsMaskSetSetting(mask,"offset",{scaleW/2-0.5,scaleH/2-0.5,1}) end function dgsMaskAdaptTextureSize(mask,w,h) if not(dgsGetPluginType(mask) == "dgs-dxmask") then error(dgsGenAsrt(mask,"dgsMaskAdaptTextureSize",1,"dgs-dxmask")) end local ratio = w/h local scaleW,scaleH = (ratio>1 and ratio or 1),(1/ratio>1 and 1/ratio or 1) dgsMaskSetSetting(mask,"scale",{scaleW,scaleH,1}) end
-
@thisdp bug with tabPanel. When create tabpanel with attach to parent, Y pos tab wrong. Pos cursor when tab activated Pos cursor on tab Tab panel attached to scrollpane