-
Posts
439 -
Joined
-
Last visited
-
Days Won
4
Everything posted by Turbe$Z
-
This is the code: function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end else return false end end function payScript(player,cmd,other,amount) local name = getPlayerFromPartialName(other) local atg local rpm = getPlayerMoney(player) local err = {} local penz = getElementData(player,"char:money") or 0 if name == false then err[#err+1] = "#FFffFFA név nem található!" end if tonumber(amount) < 0 then err[#err+1] = "#FFffFFNegatív szám nem lehet!" end atg = tonumber(amount) if (penz-atg) < 0 then err[#err+1] = "#FFffFFNincs elég pénzed!" end if(player == name) then err[#err+1] = "# nem tudsz." end if #err == 0 then setElementData(player,"char:money",penz-atg) setElementData(name,"char:money",atg+penz) else for i=1,#err do end end end addCommandHandler( "pay", payScript ) the other and the local player's money changes to the same... how to fix this??
-
Thank you! And how can i increase the rectangle height with the text, like the width with dxGetTextWidth?
-
I want to render a rectangle to the cursor, but the rectangle too far from the cursor.. How to fix this in my code? code: local sx_, sy_ = 1920, 1080 local sx__, sy__ = guiGetScreenSize() local xm, ym = sx__/sx_, sy__/sy_ function render() local screenx, screeny = getCursorPosition() dxDrawRectangle((sx_-687) * xm * screenx, (sy_/2+70) * ym * screeny, 170 * xm, 25 * ym,tocolor(255,181,64,80)) end addEventHandler("onClientRender",root,render) the problem:
-
But when i try convert a simple video without music, then does not working too..
-
No errors / warnings in debugscript 3... then what wrong in this script? Client: requestBrowserDomains({"www.convertmp3.io"}) local browser = createBrowser( 1, 1, false ) local currentSound = {} addEvent( 'Play' , true ) addEventHandler( 'Play' , root , function( link ) local vehicle = getPedOccupiedVehicle ( source ) local x, y, z = getElementPosition(vehicle) currentSound[source] = playSound3D( link, x, y, z ) attachElements(currentSound[source],vehicle) setSoundMaxDistance(currentSound[source],30) setSoundVolume(currentSound[source],50) end ) function fetch(_,url) if url and url ~= "" then fetchRemote("http://www.convertmp3.io/fetch/?format=JSON&video="..url, callback) end end addCommandHandler("p",fetch) function callback(data, error) if (error ~= 0) then return outputChatBox(error) end if (data == "ERROR") then return outputChatBox("data error") end local data = fromJSON("["..data.."]") if (data) then outputChatBox("Title: "..data.title) outputChatBox("Length: "..data.length) outputChatBox("Link: "..data.link) loadBrowserURL( browser, data.link ) end end addEventHandler( "onClientBrowserNavigate", browser, function( link ) if not link:find("www.convertmp3.io") then triggerServerEvent( 'play' , localPlayer , link ) -- trigger the event when the script actially gets the playable link! end end ) server: addEvent( 'play' , true ) addEventHandler( 'play' , root , function( link ) triggerClientEvent( root , 'Play' , client , link ) end )
-
local table = { {"1", "2", "3", "4"}, } function asdasdsdasdd() table.insert(table,"5","6","7","8") end What wrong? No errors and warnings in debugscript 3...
-
When i playing MTA:SA, the FPS decrease random with 5-10 FPS and freeze the game a little bit for 1-2 seconds. And this again after 5-10 mins.. my pc more than enough for MTA:SA.. here is my specs: i5-9600K 2x8GB 3200MHz RAM GTX 1070 I tried change the settings in nvidia control panel, in mta settings but didn't help.. I playing MTA in windowed mode without border, if that matters Anyone can help? Sorry for my bad english..
-
Amit te kliens oldalnak írtál, az a szerver oldal, amit pedig szerver oldalnak, az a kliens oldal. Tehát felcserélted őket.
-
the 'i' value is = "1 2" Maybe this is the problem.. how to convert this only to 2?
-
This is the code: local normalScoreGorget = 0 local maxMegjelenit = 1 -------------------- for i, row in pairs(scoreboard_rows) do if (i > normalScoreGorget and elem < maxMegjelenit) then elem = elem + 1 if getElementType(row) == "player" then ---DX things here........ elseif getElementType(row) == "team" then ---DX things here........ end end end end bindKey("mouse_wheel_down", "down", function() if normalScoreGorget < #scoreboard_rows - maxMegjelenit then normalScoreGorget = normalScoreGorget + 1 end end ) bindKey("mouse_wheel_up", "down", function() if normalScoreGorget > 0 then normalScoreGorget = normalScoreGorget - 1 end end ) This is the bug: how can i fix this?.. :s
-
how to loop this table in dx?
-
I created a scoreboard script, and the playerlist working fine, but i dont know how to insert teams, and team players after the playerlist, like in the default scoreboard script.. :s Anyone can help me?
-
function DestructionDerby:handleFinishActivePlayer(player) local timePassed = self:getTimePassed() local rank = self:getPlayerRank(player) if rank >= 2 then triggerClientEvent("winnerMessage",resourceRoot,"Winner!!!", getPlayerNametagText(player)) triggerEvent("plusz1", player) end finishActivePlayer(player) if rank and rank > 1 then triggerEvent( "onPlayerFinishDD",player,tonumber( rank ) ) end local activePlayers = getActivePlayers() triggerEvent("onPlayerDeadInRace",getRootElement(),rank,player) if #activePlayers == 1 then if (not isMapDM()) then if getResourceState( getResourceFromName( "podium" )) ~= "running" then triggerClientEvent("winnerMessage",resourceRoot,"Winner!!!", getPlayerNametagText(activePlayers[1])) else triggerClientEvent("winnerMessage",resourceRoot,"","") setElementHealth(activePlayers[1],0) end end if getElementModel(getPedOccupiedVehicle(activePlayers[1])) == 425 then setElementHealth(activePlayers[1],0) end triggerEvent( "onPlayerWinDD",activePlayers[1] ) end end i putted in this function, but does not working at all.. :s
-
Client: function winnerMessenger ( text, playerName) win.text = text win.name = playerName removeEventHandler("onClientRender",root,winMsg) addEventHandler("onClientRender",root,winMsg) triggerServerEvent("plusz1", localPlayer, getLocalPlayer) end addEvent("winnerMessage",true) addEventHandler("winnerMessage",getRootElement(),winnerMessenger) Server: function asdasd() if getPlayerRank( source ) ~= 1 then return end local gyozelmek = getElementData(source,"Győzelmek") or 0 setElementData(source, "Győzelmek", gyozelmek + 1 ) givePlayerMoney(source,2) outputChatBox("#FFffFFAmiért megnyerted a kört, kaptál #00FFFF'2' coint!",source,r,g,b,true) end addEvent("plusz1", true) addEventHandler("plusz1", root, asdasd) And when the win msg appear, the setelementdata add 1 win point, and money for everybody.. How to fix this? I want add win point and money only to the winner, not everybody...