Jump to content

JoZeFSvK

Members
  • Posts

    201
  • Joined

  • Last visited

Everything posted by JoZeFSvK

  1. In first script i have local x,y = guiGetScreenSize() and in second is local screenWidth,screenHeight = guiGetScreenSize() but this I do not have nerves for this parameters
  2. When i use 2 scripts then how ?
  3. I have problem with this others is not significantly. First scirpt i update local x,y = guiGetScreenSize() local showAnim1 = 0 local showAnim2 = 0 local alpha1 = 200 local alpha2 = 200 local size1 = 0.75 local size2 = 0.75 local yup1 = 0 local yup2 = 0 local p = 0 local c = 0 function destroyAnim1() showAnim1 = 0 size1 = 0.75 alpha1 = 200 yup1 = 0 end function destroyAnim2() showAnim2 = 0 size2 = 0.75 alpha2 = 200 yup2 = 0 end addEventHandler("onClientPreRender", getRootElement(), function() local pointsCL = 0 local cashCL = 0 local HPCL = 0 if (getElementData(getLocalPlayer(),"Points") ~= false) then pointsCL = getElementData(getLocalPlayer(),"Points") end if (getElementData(getLocalPlayer(),"Cash") ~= false) then cashCL = getElementData(getLocalPlayer(),"Cash") end if (getPedOccupiedVehicle(getLocalPlayer()) ~= false) then HPCL = math.round ( getElementHealth ( getPedOccupiedVehicle(getLocalPlayer()) ), 0) else HPCPL = 0 end if (p ~= pointsCL) then showAnim1 = 1 p = pointsCL end if (c ~= cashCL) then showAnim2 = 1 c = cashCL end ----------------------------------------------------------- dxDrawText(pointsCL, x-290, 95, x-60, y, tocolor(245,184,0,200), 0.75, "default-bold", "left", "top" ) ----------------------------------------------------------- ------------------------------------------------------------- -- dxDrawText(cashCL, x-740, 735, x-100, y, tocolor(102,135,255,200), 1.5, "default-bold", "left", "top" false, false, true, false, false) ------------------------------------------------------------- --x290,115,x-60,y 0.75 velkost pisma --doprava,dole,asinic, dxDrawText (cashCL, 158, screenHeight - 37, 188, screenHeight - 5, tocolor (255,255,255,255), 1, "default-bold", "right", "center") if (showAnim1 == 1) then dxDrawText(pointsCL, x-290, 95-yup1, x-60, y, tocolor(245,184,0,alpha1), size1, "bankgothic", "right", "top") size1 = size1 + 0.04 yup1 = yup1 + 0.75 if (alpha1 > 3) then alpha1 = alpha2 - 2 else destroyAnim1() end end if (showAnim2 == 1) then dxDrawText(cashCL, x-290, 115-yup2, x-60, y, tocolor(102,140,255,alpha2), size2, "bankgothic", "right", "top") size2 = size2 + 0.04 yup2 = yup2 - 0 if (alpha2 > 3) then alpha2 = alpha2 - 2 else destroyAnim2() end end end ) and this is second script no link to first script this script create only background local screenWidth,screenHeight = guiGetScreenSize() local owlsFont = dxCreateFont( "files/fonts/font.ttf", 24 ) local spriteFile = "files/images/img.png" function mainDrawing () local ping = getPlayerPing(getLocalPlayer()) local alivePlayers = getAlivePlayers() --Backgrounds dxDrawImageSection (screenWidth - 125, screenHeight - (screenHeight - 10), 128, 64, 1, 287, 128, 64, spriteFile) dxDrawImageSection (261, screenHeight - 37, 64, 32, 195, 37, 64, 32, spriteFile)--Cash bg -- HERE when i write to fasle i dont see image -- vyska,roztiahnutie,natiahnutie, hmmm,horedole, dxDrawImageSection (325, screenHeight - 37, 64, 32, 131, 37, 64, 32, spriteFile)--Points bg -- Text time dxDrawText (getServerTime()[2], screenWidth - 42, screenHeight - (screenHeight - 33), screenWidth - 12, screenHeight - (screenHeight - 67), tocolor (255,255,255,255), 1, "default-bold", "center", "center")--Time text end addEventHandler("onClientRender", getRootElement(), mainDrawing) -- dx draw function dxDrawColorText(str, ax, ay, bx, by, color, scale, font, alignX, alignY) bx, by, color, scale, font = bx or ax, by or ay, color or tocolor(255,255,255,255), scale or 1, font or "default" if alignX then if alignX == "center" then ax = ax + (bx - ax - dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font))/2 elseif alignX == "right" then ax = bx - dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font) end end if alignY then if alignY == "center" then ay = ay + (by - ay - dxGetFontHeight(scale, font))/2 elseif alignY == "bottom" then ay = by - dxGetFontHeight(scale, font) end end local alpha = string.format("%08X", color):sub(1,2) local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if cap == "" and col then color = tocolor(getColorFromString("#"..col..alpha)) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) ax = ax + w color = tocolor(getColorFromString("#"..col..alpha)) end last = e + 1 s, e, cap, col = str:find(pat, last) end if last <= #str then cap = str:sub(last) dxDrawText(cap, ax, ay, ax + dxGetTextWidth(cap, scale, font), by, color, scale, font) end end
  4. Ehm sorry but can you show me example ?
  5. Its long First local x,y = guiGetScreenSize() local showAnim1 = 0 local showAnim2 = 0 local alpha1 = 200 local alpha2 = 200 local size1 = 0.75 local size2 = 0.75 local yup1 = 0 local yup2 = 0 local p = 0 local c = 0 function destroyAnim1() showAnim1 = 0 size1 = 0.75 alpha1 = 200 yup1 = 0 end function destroyAnim2() showAnim2 = 0 size2 = 0.75 alpha2 = 200 yup2 = 0 end addEventHandler("onClientPreRender", getRootElement(), function() local pointsCL = 0 local cashCL = 0 local HPCL = 0 if (getElementData(getLocalPlayer(),"Points") ~= false) then pointsCL = getElementData(getLocalPlayer(),"Points") end if (getElementData(getLocalPlayer(),"Cash") ~= false) then cashCL = getElementData(getLocalPlayer(),"Cash") end if (getPedOccupiedVehicle(getLocalPlayer()) ~= false) then HPCL = math.round ( getElementHealth ( getPedOccupiedVehicle(getLocalPlayer()) ), 0) else HPCPL = 0 end if (p ~= pointsCL) then showAnim1 = 1 p = pointsCL end if (c ~= cashCL) then showAnim2 = 1 c = cashCL end dxDrawRectangle ( x-300, 50, 250, 40, tocolor(0, 0, 102, 200) ) dxDrawText("Let's Derby", x-300, 50, x-50, 90, tocolor(255, 255, 255, 200), "2", "arial", "center", "center") dxDrawRectangle ( x-300, 90, 250, 110, tocolor(0, 0, 0, 64) ) dxDrawLine(x-299, 90, x-299, 90+110, tocolor(0, 0, 102, 200), 2) dxDrawLine(x-51, 90, x-51, 90+110, tocolor(0, 0, 102, 200), 2) dxDrawText("POINTS", x-290, 95, x, y, tocolor(255,255,255,200), 0.75, "bankgothic", "left", "top") ----------------------------------------------------------- dxDrawText(pointsCL, x-290, 95, x-60, y, tocolor(245,184,0,200), 0.75, "default-bold", "left", "top") ----------------------------------------------------------- dxDrawText("CASH", x-290, 115, x, y, tocolor(255,255,255,200), 0.75, "bankgothic", "left", "top") ------------------------------------------------------------- dxDrawText(cashCL, x-740, 735, x-100, y, tocolor(102,135,255,200), 1.5, "default-bold", "left", "top") -- THIS I EDIT POSITION ------------------------------------------------------------- --x290,115,x-60,y 0.75 velkost pisma --doprava,dole,asinic, dxDrawLine(x-299, 145, x-51, 145, tocolor(0, 0, 102, 200), 2) dxDrawText("Health", x-290, 150, x, y, tocolor(255,255,255,200), 0.75, "bankgothic", "left", "top") local health = HPCL health = math.max(health - 250, 0)/750 local p = -510*(health^2) local r,g = math.max(math.min(p + 255*health + 255, 255), 0), math.max(math.min(p + 765*health, 255), 0) dxDrawRectangle (x-160, 157, 100, 10, tocolor(r,g,0,50) ) --Finally, the actual health dxDrawRectangle (x-160, 157, health*(100), 10, tocolor(r,g,0,150) ) dxDrawLine(x-299, 200, x-51, 200, tocolor(0, 0, 102, 200), 2) dxDrawText("Speed", x-290, 170, x, y, tocolor(255,255,255,200), 0.75, "bankgothic", "left", "top") if (showAnim1 == 1) then dxDrawText(pointsCL, x-290, 95-yup1, x-60, y, tocolor(245,184,0,alpha1), size1, "bankgothic", "right", "top") size1 = size1 + 0.04 yup1 = yup1 + 0.75 if (alpha1 > 3) then alpha1 = alpha2 - 2 else destroyAnim1() end end if (showAnim2 == 1) then dxDrawText(cashCL, x-290, 115-yup2, x-60, y, tocolor(102,140,255,alpha2), size2, "bankgothic", "right", "top") size2 = size2 + 0.04 yup2 = yup2 - 0 if (alpha2 > 3) then alpha2 = alpha2 - 2 else destroyAnim2() end end end ) and local screenWidth,screenHeight = guiGetScreenSize() local owlsFont = dxCreateFont( "files/fonts/font.ttf", 24 ) local spriteFile = "files/images/img.png" function mainDrawing () local ping = getPlayerPing(getLocalPlayer()) local alivePlayers = getAlivePlayers() --Backgrounds dxDrawImageSection (screenWidth - 125, screenHeight - (screenHeight - 10), 128, 64, 1, 287, 128, 64, spriteFile) dxDrawImageSection (261, screenHeight - 37, 64, 32, 195, 37, 64, 32, spriteFile)--Cash bg -- HERE -- vyska,roztiahnutie,natiahnutie, hmmm,horedole, dxDrawImageSection (325, screenHeight - 37, 64, 32, 131, 37, 64, 32, spriteFile)--Points bg -- Text time dxDrawText (getServerTime()[2], screenWidth - 42, screenHeight - (screenHeight - 33), screenWidth - 12, screenHeight - (screenHeight - 67), tocolor (255,255,255,255), 1, "default-bold", "center", "center")--Time text end addEventHandler("onClientRender", getRootElement(), mainDrawing) -- dx draw function dxDrawColorText(str, ax, ay, bx, by, color, scale, font, alignX, alignY) bx, by, color, scale, font = bx or ax, by or ay, color or tocolor(255,255,255,255), scale or 1, font or "default" if alignX then if alignX == "center" then ax = ax + (bx - ax - dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font))/2 elseif alignX == "right" then ax = bx - dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font) end end if alignY then if alignY == "center" then ay = ay + (by - ay - dxGetFontHeight(scale, font))/2 elseif alignY == "bottom" then ay = by - dxGetFontHeight(scale, font) end end local alpha = string.format("%08X", color):sub(1,2) local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if cap == "" and col then color = tocolor(getColorFromString("#"..col..alpha)) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) ax = ax + w color = tocolor(getColorFromString("#"..col..alpha)) end last = e + 1 s, e, cap, col = str:find(pat, last) end if last <= #str then cap = str:sub(last) dxDrawText(cap, ax, ay, ax + dxGetTextWidth(cap, scale, font), by, color, scale, font) end end
  6. Hey i have text and image but text is under image how i fix it ? Part of text dxDrawText(cashCL, x-750, 735, x-100, y, tocolor(102,135,255,200), 1.5, "default-bold", "left", "top") Part of image dxDrawImageSection (325, screenHeight - 37, 64, 32, 131, 37, 64, 32, imgFile) --bg Where will problem who know ?
  7. I want edit therefore, because taht player did not download again race floder from our server but he will have our race floder. understand me ? I rename but i see errors and race dont work and maps dont have gamemode ^^
  8. Hey guys i have problem i want rename race floder etc. "race.zip" to "raceDD.zip" but when i rename i see errors i think it word "raceDD" be write and elsewhere ? If it already someone try I would welcome help. Thank you
  9. Try ask owner script, then you send a uncomplited script.
  10. Who know where is problem ? local account = getPlayerAccount(source) if not isGuestAccount(account) then for i,data in ipairs(dataTable) do if not getAccountData(account, data) then setAccountData(account, data, "0") outputDebugString("Setting data: " .. tostring(data) .. " for player: " .. tostring(getPlayerName(source)) .. " to 0") end end end if not isGuestAccount(account) then for i,data in pairs(textDataTable) do if not getAccountData(account, data) then setAccountData(account, data, getPlayerName(source)) end end ------------------------------------------------------------------ function BuyRepair (player, command) if (getAccountData(account, "cash") > 2000) then local auto = getPedOccupiedVehicle(player) local nick = getPlayerName(player) fixVehicle(auto) setAccountData(account, "cash", playerCash - 2000) scoreboardRefresh(thePlayer) outputChatBox("Player #0fc0fc" .. nick .. " #0fc0fcbought for $10 000 repair! #0fc0fc(/fix for #ffff00VIP#0fc0fc)", getRootElement(), 255, 0, 0, true) else outputChatBox("Not enough money.", player, 255, 0, 0, true) end end addCommandHandler("fix", BuyRepair)
  11. ah when i remove songOn on write to false when i dead i will head song on 100% and i dont want this i wanna on all maps and when i death set song volume to 50%
  12. hmm i write to false but when player death he hears "100%" but when map start he hears 50%
  13. i try your code but it work for 1 times when i play next map then dont work like onClientMapStarting dont work
  14. Hey i wanna create when map start set map music to 50% or less this is my code but dont work who know where will problem ? thank you addEventHandler("onClientMapStarting",getRootElement(), function radioFix() if not songOn then setSoundVolume(getRootElement(),0.3) songOn = true setElementData(getLocalPlayer(),"Radio.Channel",tonumber(getRadioChannel())) setRadioChannel(0) addEventHandler("onClientPlayerRadioSwitch",getRootElement(),radioFix) end end)
  15. i added but problem in debug see Server triggered clientside event onPlayerHell, but event is not added clientside
  16. agrh i have problem again i dont know where is problem Client function hell ( onPlayerHell ) local sound = playSound("song/hell.mp3") setSoundVolume(sound, 0.5) end addEventHandler("onPlayerHell", getLocalPlayer(), hell) addEventHandler("onPlayerHell", getRootElement(), hell) Server local restriction = {} function fck ( player, cmd ) accountname = getAccountName ( getPlayerAccount ( player ) ); if not isObjectInACLGroup ( 'user.' .. accountname, aclGetGroup ( 'vip' ) ) then return end if not restriction[player] then restriction[player] = {} end if not restriction[player][cmd] then triggerClientEvent("onPlayerHell",getRootElement()) restriction[player][cmd] = true setTimer ( function ( ) restriction[player][cmd] = false end, 5000, 1 ); else outputChatBox ( '#FF0000[Commands]: You must wait #FFFFFF5 seconds#FF0000 to write this command again.', player, 255, 255, 255, true ); end end addCommandHandler( 'fu', fck );
  17. accountname = getAccountName (getPlayerAccount(playerElement)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "vip" ) ) then local restriction = {} function fck(player, cmd) if (not restriction[player]) then restriction[player] = {} end if not restriction[player][cmd] then outputChatBox("#FFFFFF".. getPlayerName(player) .."#5DACD1 says: F*ck You! ", root, 255, 255, 255, true) restriction[player][cmd] = true setTimer(function () restriction[player][cmd] = false end, 5000, 1) else outputChatBox("#FF0000[Commands]: You must wait #FFFFFF5 seconds#FF0000 to write this command again.", player, 255, 255, 255, true) end end addCommandHandler("fu", fck)
  18. Hey i wanna create when player will in alc group etc. vip then he can use command. how i create it ? can you show me example ? local restriction = {} function fck(player, cmd) if (not restriction[player]) then restriction[player] = {} end if not restriction[player][cmd] then outputChatBox("#FFFFFF".. getPlayerName(player) .."#5DACD1 says: F*ck You! ", root, 255, 255, 255, true) restriction[player][cmd] = true setTimer(function () restriction[player][cmd] = false end, 5000, 1) else outputChatBox("#FF0000[Commands]: You must wait #FFFFFF5 seconds#FF0000 to write this command again.", player, 255, 255, 255, true) end end addCommandHandler("fu", fck) how i add here "when player is acl gorup vip" ?
  19. JoZeFSvK

    Country

    Thank you this work
  20. JoZeFSvK

    Country

    I dont know why but i dont see my country in admin panel i dont see my flag and when i join to server i see join from nil. i need fix this problem and I do not know if it is possible to adjust in game
×
×
  • Create New...