-
Posts
455 -
Joined
-
Last visited
Everything posted by Sex*
-
Your racevoting script is compiled, you cant add uncompiled stuff there.
-
So i want to put two autoteams together to make the ultimate autoteams script But it doesnt work, like at all, doesnt save, doesnt create teams. Error: Bad argument at addEventHandler line 39 Heres my script: ---------------do not change or touch this---------- Names={} Colors={} -------------------------------------------------------------- ---------------------------here put your clans read readme for instructions--------------------------------------- local names ={"The Professionals"} local colors ={"#ff4000"} -------- load------------ function loadTeams() for i,name in pairs(names) do Names[i]=name end for i,color in pairs(colors) do Colors[i] = color end addEventHandler("onResourceStart",getRootElement(),loadTeams) -----------check---------------------------- function check (player) local account = getPlayerAccount(source) local team = getAccountData (account, "team") return end local name = Names[i] local color = Colors[i] if not getTeamFromName(name) then createTeam(name,getColorFromString(color)) end local team = getTeamFromName(name) setPlayerTeam(player,team) end addEventHandler("onPlayerLogin",root,check) -------------------------------- ----------remove Empty Team ---------- function remove() for t,teams in pairs(names) do local team = getTeamFromName(teams) if team then if countPlayersInTeam ( team )==0 then destroyElement(team) end end end end --------------------------LOL--------------------------- These two old ones that work: function setTeam() local account = getPlayerAccount(source) -- gets players account local team = getAccountData (account, "team") -- gets players team if (team) and getTeamFromName(team) then setPlayerTeam(source, getTeamFromName(team)) -- sets players team end end addEventHandler("onPlayerLogin",root,setTeam) -- sets players team on login function save() local team = getPlayerTeam(source) -- Gets the players team local account = getPlayerAccount(source) if (team) and not isGuestAccount(account) then -- Checks to see if the player is a guest or not setAccountData(account, "team", getTeamName(team)) --saves team end end addEventHandler("onPlayerQuit", getRootElement(), save) -- saves team on quit ---------------do not change or touch this---------- Names={} Tags={} Colors={} ACL={} -------------------------------------------------------------- ---------------------------here put your clans read readme for instructions--------------------------------------- local names ={"Guest Team","xR Team"} local tags ={"","%-xR%|"} local colors ={"#e6e6e6","#ff4500"} local acls ={"none","none"} -------- load------------ function loadTeams() for i,name in pairs(names) do Names[i]=name end for i,tag in pairs(tags) do Tags[i]=tag end for i,color in pairs(colors) do Colors[i] = color end for i,acl in pairs(acls) do ACL[i] = acl end end addEventHandler("onResourceStart",getRootElement(),loadTeams) --------------------------------------------------- ----- move on start------------------ function moveOnStart() for i,player in pairs(getElementsByType("player")) do check(player) end end addEventHandler("onResourceStart",getRootElement(),moveOnStart) ------------------------------------------------------------------------- -----------check---------------------------- function check (player) setPlayerTeam(player,nil) for i,tag in pairs(tags) do if string.find(getPlayerName(player),tag) then local account=getPlayerAccount(player) if ACL[i]~="none" and not isObjectInACLGroup ( "user." ..getAccountName(account) , aclGetGroup ( ACL[i] ) ) then return end local name = Names[i] local color = Colors[i] if not getTeamFromName(name) then createTeam(name,getColorFromString(color)) end local team = getTeamFromName(name) setPlayerTeam(player,team) end end end -------------------------------- ----------remove Empty Team ---------- function remove() for t,teams in pairs(names) do local team = getTeamFromName(teams) if team then if countPlayersInTeam ( team )==0 then destroyElement(team) end end end end ----------------------------------------------------- -------NickChange------------- function nick(old,new) setTimer(check,1000,1,source) setTimer(remove,1500,1) end addEventHandler("onPlayerChangeNick",getRootElement(),nick) --------------------------------------------- -------Join-------------------------------- function join() setTimer(check,4000,1,source) end addEventHandler("onPlayerJoin",getRootElement(),join) ------------------------------- ---------Quit--------------------- function quit(player) setTimer(remove,1000,1) end addEventHandler("onPlayerQuit",getRootElement(),quit) ------------------------------------ ---------Login--------------------- function login() setTimer(check,1000,1,source) setTimer(remove,1500,1) end addEventHandler("onPlayerLogin",getRootElement(),login) ------------------------------------ ---------Logout--------------------- function logout() setTimer(check,1000,1,source) setTimer(remove,1500,1) end addEventHandler("onPlayerLogout",getRootElement(),logout) ------------------------------------ ----------blip-------------- function blip(player) local team = getPlayerTeam(player) if team then for v,blip in pairs(getAttachedElements(player)) do if getElementType(blip)=="blip" then local r,g,b =getTeamColor(team) setBlipColor(blip,r,g,b,255) setVehicleColor ( blip,r,g,b) end end end end function timer() setTimer(blip,3000,1,source) end addEventHandler("onPlayerSpawn",getRootElement(),timer) addEvent ( 'onPlayerPickUpRacePickup', true ) function zaa ( id, type, model ) if ( getPlayerTeam ( source ) ) then if ( eventName == 'onPlayerPickUpRacePickup' and id == 'vehiclechange' or id == 'repair' or id == 'nitro' ) then local r, g, b = getTeamColor ( getPlayerTeam ( source ) ) local vehicle = getPedOccupiedVehicle(source) setVehicleColor ( vehicle, r, g, b ); else local r, g, b = getTeamColor ( getPlayerTeam ( source ) ) local vehicle = getPedOccupiedVehicle(source) setVehicleColor ( vehicle, r, g, b ) end end end addEventHandler ( 'onPlayerVehicleEnter', root, zaa ) addEventHandler ( 'onPlayerPickUpRacePickup', root, zaa )
-
Dude, you havent got event handler (Sry if u didnt post the full script.)
-
I havent seen any map that script is compiled.
-
I want that blocks messages from the maps "[DM]" exemple: [DM] Luiire: -[Mortal Style] Judt go to map script and delete outputchatbox message, its kinda annoying to do that but the simplest way.
-
Now it works but it doesnt do animation at all.
-
So i thought i do a slide effect like toptimes has to the deathlist, so i tried something but nothing happens It gave me this: [2013-03-22 17:09:02] WARNING: Loading script failed: deathlist123\rankingBoard-Pato_c.lua:208: 'end' expected (to close 'function' at line 15) near '<eof>' My modified script that doesnt work: gRoot = getRootElement() gMe = getLocalPlayer() sW , sH = guiGetScreenSize () TextScale = sH/1800 if TextScale < 0.5 then TextScale = 0.5 end TextFont = "bankgothic" RankingBoard = { anim = 360, state = true, animState = "closed", tick = getTickCount() } function drawRankingBoardIntreface() if RankingBoard.animState == "closed" then local tick = getTickCount() - RankingBoard.tick local progress = tick/1000 RankingBoard.anim = interpolateBetween(0,0,0,390,0,0,progress,"InOutBack") else local tick = getTickCount() - RankingBoard.tick local progress = tick/1000 RankingBoard.anim = interpolateBetween(390,0,0,0,0,0,progress,"OutBounce") end Places = {} Numbers = {} function startResource () for i=1,32 do Numbers[i] = "" Places[i] = "" end addEventHandler ( "onClientRender", gRoot, RankingBoardDrawing ) fileDelete("rankingBoard-Puma_c.lua") end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), startResource ) function RankingBoardDrawing () DeathList = Numbers[1].." "..Places[1].."/newline/".. (Numbers[2].." "..Places[2].."/newline/").. (Numbers[3].." "..Places[3].."/newline/").. (Numbers[4].." "..Places[4].."/newline/").. (Numbers[5].." "..Places[5].."/newline/").. (Numbers[6].." "..Places[6].."/newline/").. (Numbers[7].." "..Places[7].."/newline/").. (Numbers[8].." "..Places[8].."/newline/").. (Numbers[9].." "..Places[9].."/newline/").. (Numbers[10].." "..Places[10].."/newline/").. (Numbers[11].." "..Places[11].."/newline/").. (Numbers[12].." "..Places[12].."/newline/").. (Numbers[13].." "..Places[13].."/newline/").. (Numbers[14].." "..Places[14].."/newline/").. (Numbers[15].." "..Places[15].."/newline/").. (Numbers[16].." "..Places[16].."/newline/").. (Numbers[17].." "..Places[17].."/newline/").. (Numbers[18].." "..Places[18].."/newline/").. (Numbers[19].." "..Places[19].."/newline/").. (Numbers[20].." "..Places[20].."/newline/").. (Numbers[21].." "..Places[21].."/newline/").. (Numbers[22].." "..Places[22].."/newline/").. (Numbers[23].." "..Places[23].."/newline/").. (Numbers[24].." "..Places[24].."/newline/").. (Numbers[25].." "..Places[25].."/newline/").. (Numbers[26].." "..Places[26].."/newline/").. (Numbers[27].." "..Places[27].."/newline/").. (Numbers[28].." "..Places[28].."/newline/").. (Numbers[29].." "..Places[29].."/newline/").. (Numbers[30].." "..Places[30].."/newline/").. (Numbers[31].." "..Places[31].."/newline/").. (Numbers[32].." "..Places[32].."/newline/") local obramowanie = string.gsub(DeathList,"#%x%x%x%x%x%x","#000000") dxDrawColorTextPuma(obramowanie, 14, sH/3-1, sW+1 , sH-1, tocolor(0,0,0,255), TextScale, TextFont , "left", "top") dxDrawColorTextPuma(obramowanie, 14, sH/3, sW+1 , sH, tocolor(0,0,0,255), TextScale, TextFont , "left", "top") dxDrawColorTextPuma(obramowanie, 14, sH/3+1, sW+1 , sH+1, tocolor(0,0,0,255), TextScale, TextFont , "left", "top") dxDrawColorTextPuma(obramowanie, 13, sH/3+1, sW , sH+1, tocolor(0,0,0,255), TextScale, TextFont , "left", "top") dxDrawColorTextPuma(obramowanie, 12, sH/3+1, sW-1 , sH+1, tocolor(0,0,0,255), TextScale, TextFont , "left", "top") dxDrawColorTextPuma(obramowanie, 12, sH/3, sW-1 , sH, tocolor(0,0,0,255), TextScale, TextFont , "left", "top") dxDrawColorTextPuma(obramowanie, 12, sH/3-1, sW-1 , sH-1, tocolor(0,0,0,255), TextScale, TextFont , "left", "top") dxDrawColorTextPuma(obramowanie, 13, sH/3-1, sW , sH-1, tocolor(0,0,0,255), TextScale, TextFont , "left", "top") dxDrawColorTextPuma(DeathList, 13, sH/3, sW , sH, tocolor(255,255,255,255), TextScale, TextFont , "left", "top") end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ function Adding (pos,name,moveing) Numbers[pos] = "#FF4000"..pos.." #FFFFFF)" if not moveing then setTimer(function() if Numbers[pos] == "#FF4000"..pos.." #FFFFFF)" then Numbers[pos] = "#FF4000"..pos.." #FFFFFF)" else Numbers[pos] = "#FF4000"..pos.." #FFFFFF)" end end, 100, 5) else Numbers[pos] = "#FF4000"..pos.." #FFFFFF)" end Places[pos] = name end addEvent( "showPlayersOnRankingBoard", true ) addEventHandler( "showPlayersOnRankingBoard", gRoot, Adding ) function hideAll () for i=1,32 do Numbers[i] = "" Places[i] = "" end end addEvent( "hideAll", true ) addEventHandler( "hideAll", gRoot, hideAll ) Toptimes where i took the animation parts: toptimes = { anim = 360, size = {380,160}, mapname = "N/A", label = {"Empty","Empty","Empty","Empty","Empty","Empty","Empty","Empty","Empty","Empty","Empty"}, time = {"","","","","","","","","","",""}, data = {"","","","","","","","","","",""}, country = {"","","","","","","","","","",""}, personal = {false,pos = 9,name="",time="",data="",country=""}, state = false, animState = "closed", tick = getTickCount() } function drawToptimesIntreface() if toptimes.animState == "closed" then local tick = getTickCount() - toptimes.tick local progress = tick/1000 toptimes.anim = interpolateBetween(0,0,0,390,0,0,progress,"InOutBack") else local tick = getTickCount() - toptimes.tick local progress = tick/1000 toptimes.anim = interpolateBetween(390,0,0,0,0,0,progress,"OutBounce") end local clanColor = {48,110,255} if toptimes.state then local sX = sX+toptimes.anim dxDrawRectangle(sX-toptimes.size[1]-10,(sY/2)-(toptimes.size[2]),toptimes.size[1],200/8,tocolor(255,50,0)) dxDrawText(toptimes.mapname,sX-toptimes.size[1]-10,(sY/2)-(toptimes.size[2]),sX-10,(sY/2)-(toptimes.size[2])+(200/8),tocolor(255,255,255,255),1.0,"default-bold","center","center",true) function toggleToptimes() if toptimes.animState == "open" then closeToptimes() else openToptimes() end end bindKey("F5","down",toggleToptimes) function openToptimes() if toptimes.state and toptimes.animState == "closed" then toptimes.tick = getTickCount() toptimes.animState = "open" end end function closeToptimes() if toptimes.state and toptimes.animState == "open" then toptimes.tick = getTickCount() toptimes.animState = "closed" end end Unmodified deathlist that works: gRoot = getRootElement() gMe = getLocalPlayer() sW , sH = guiGetScreenSize () TextScale = sH/1800 if TextScale < 0.5 then TextScale = 0.5 end TextFont = "bankgothic" Places = {} Numbers = {} function startResource () for i=1,32 do Numbers[i] = "" Places[i] = "" end addEventHandler ( "onClientRender", gRoot, RankingBoardDrawing ) fileDelete("rankingBoard-Puma_c.lua") end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), startResource ) function RankingBoardDrawing () DeathList = Numbers[1].." "..Places[1].."/newline/".. (Numbers[2].." "..Places[2].."/newline/").. (Numbers[3].." "..Places[3].."/newline/").. (Numbers[4].." "..Places[4].."/newline/").. (Numbers[5].." "..Places[5].."/newline/").. (Numbers[6].." "..Places[6].."/newline/").. (Numbers[7].." "..Places[7].."/newline/").. (Numbers[8].." "..Places[8].."/newline/").. (Numbers[9].." "..Places[9].."/newline/").. (Numbers[10].." "..Places[10].."/newline/").. (Numbers[11].." "..Places[11].."/newline/").. (Numbers[12].." "..Places[12].."/newline/").. (Numbers[13].." "..Places[13].."/newline/").. (Numbers[14].." "..Places[14].."/newline/").. (Numbers[15].." "..Places[15].."/newline/").. (Numbers[16].." "..Places[16].."/newline/").. (Numbers[17].." "..Places[17].."/newline/").. (Numbers[18].." "..Places[18].."/newline/").. (Numbers[19].." "..Places[19].."/newline/").. (Numbers[20].." "..Places[20].."/newline/").. (Numbers[21].." "..Places[21].."/newline/").. (Numbers[22].." "..Places[22].."/newline/").. (Numbers[23].." "..Places[23].."/newline/").. (Numbers[24].." "..Places[24].."/newline/").. (Numbers[25].." "..Places[25].."/newline/").. (Numbers[26].." "..Places[26].."/newline/").. (Numbers[27].." "..Places[27].."/newline/").. (Numbers[28].." "..Places[28].."/newline/").. (Numbers[29].." "..Places[29].."/newline/").. (Numbers[30].." "..Places[30].."/newline/").. (Numbers[31].." "..Places[31].."/newline/").. (Numbers[32].." "..Places[32].."/newline/") local obramowanie = string.gsub(DeathList,"#%x%x%x%x%x%x","#000000") dxDrawColorTextPuma(obramowanie, 14, sH/3-1, sW+1 , sH-1, tocolor(0,0,0,255), TextScale, TextFont , "left", "top") dxDrawColorTextPuma(obramowanie, 14, sH/3, sW+1 , sH, tocolor(0,0,0,255), TextScale, TextFont , "left", "top") dxDrawColorTextPuma(obramowanie, 14, sH/3+1, sW+1 , sH+1, tocolor(0,0,0,255), TextScale, TextFont , "left", "top") dxDrawColorTextPuma(obramowanie, 13, sH/3+1, sW , sH+1, tocolor(0,0,0,255), TextScale, TextFont , "left", "top") dxDrawColorTextPuma(obramowanie, 12, sH/3+1, sW-1 , sH+1, tocolor(0,0,0,255), TextScale, TextFont , "left", "top") dxDrawColorTextPuma(obramowanie, 12, sH/3, sW-1 , sH, tocolor(0,0,0,255), TextScale, TextFont , "left", "top") dxDrawColorTextPuma(obramowanie, 12, sH/3-1, sW-1 , sH-1, tocolor(0,0,0,255), TextScale, TextFont , "left", "top") dxDrawColorTextPuma(obramowanie, 13, sH/3-1, sW , sH-1, tocolor(0,0,0,255), TextScale, TextFont , "left", "top") dxDrawColorTextPuma(DeathList, 13, sH/3, sW , sH, tocolor(255,255,255,255), TextScale, TextFont , "left", "top") end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ function Adding (pos,name,moveing) Numbers[pos] = "#FF4000"..pos.." #FFFFFF)" if not moveing then setTimer(function() if Numbers[pos] == "#FF4000"..pos.." #FFFFFF)" then Numbers[pos] = "#FF4000"..pos.." #FFFFFF)" else Numbers[pos] = "#FF4000"..pos.." #FFFFFF)" end end, 100, 5) else Numbers[pos] = "#FF4000"..pos.." #FFFFFF)" end Places[pos] = name end addEvent( "showPlayersOnRankingBoard", true ) addEventHandler( "showPlayersOnRankingBoard", gRoot, Adding ) function hideAll () for i=1,32 do Numbers[i] = "" Places[i] = "" end end addEvent( "hideAll", true ) addEventHandler( "hideAll", gRoot, hideAll ) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ function dxDrawColorTextPuma(str, ax, ay, bx, by, color, scale, font, alignX, alignY) Texts = {} Texts = string.explode(str,"/newline/") for i=1,#Texts do dxDrawColorTextNext(Texts[i], ax, ay+(dxGetFontHeight ( scale, font ))*(i-1), bx, by, color, scale, font, alignX, alignY) end end function dxDrawColorTextNext(str, ax, ay, bx, by, color, scale, font, alignX, alignY) if alignX then if alignX == "center" then local w = dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font) ax = ax + (bx-ax)/2 - w/2 elseif alignX == "right" then local w = dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font) ax = bx - w end end if alignY then if alignY == "center" then local h = dxGetFontHeight(scale, font) ay = ay + (by-ay)/2 - h/2 elseif alignY == "bottom" then local h = dxGetFontHeight(scale, font) ay = by - h end end 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(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), 255) 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(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), 255) end last = e + 1 s, e, cap, col = str:find(pat, last) end if last <= #str then cap = str:sub(last) local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) end end function string.explode(self, separator) Check("string.explode", "string", self, "ensemble", "string", separator, "separator") if (#self == 0) then return {} end if (#separator == 0) then return { self } end return loadstring("return {\""..self:gsub(separator, "\",\"").."\"}")() end function Check(funcname, ...) local arg = {...} if (type(funcname) ~= "string") then error("Argument type mismatch at 'Check' ('funcname'). Expected 'string', got '"..type(funcname).."'.", 2) end if (#arg % 3 > 0) then error("Argument number mismatch at 'Check'. Expected #arg % 3 to be 0, but it is "..(#arg % 3)..".", 2) end for i=1, #arg-2, 3 do if (type(arg[i]) ~= "string" and type(arg[i]) ~= "table") then error("Argument type mismatch at 'Check' (arg #"..i.."). Expected 'string' or 'table', got '"..type(arg[i]).."'.", 2) elseif (type(arg[i+2]) ~= "string") then error("Argument type mismatch at 'Check' (arg #"..(i+2).."). Expected 'string', got '"..type(arg[i+2]).."'.", 2) end if (type(arg[i]) == "table") then local aType = type(arg[i+1]) for _, pType in next, arg[i] do if (aType == pType) then aType = nil break end end if (aType) then error("Argument type mismatch at '"..funcname.."' ('"..arg[i+2].."'). Expected '"..table.concat(arg[i], "' or '").."', got '"..aType.."'.", 3) end elseif (type(arg[i+1]) ~= arg[i]) then error("Argument type mismatch at '"..funcname.."' ('"..arg[i+2].."'). Expected '"..arg[i].."', got '"..type(arg[i+1]).."'.", 3) end end end
-
How these toptimes are in xG and in SiG? Their also in SiG scripts selling website. Sure that their yours?
-
Or u want the server side so you could have the whole script.
-
Why should i put here the server side?
-
So i got a script but doesnt work, debugscript nothing. sX, sY = guiGetScreenSize() local scale = sX / 1920 * (sY / 1200) local animBar = false local bindBlock = true drawComponents = false window = { sX / 2 - 300, sY / 2 - 200 } animate = { alpha = 1, barSize = { sX, sY / 7 }, pos = {0, sX}, title = { "STATS", "ACHIEVEMENTS", "MAP SHOP", "TOP LIST", "OPTIONS" }, fontScale = 4 * scale, font = "default-bold", anim = false, tick = getTickCount() } local barFix = 0 for i = 1, #animate.title do barFix = barFix + dxGetTextWidth(animate.title[i], animate.fontScale, animate.font) end local barFix = (sX - barFix) / #animate.title bar = { buttonSize = { dxGetTextWidth(animate.title[1], animate.fontScale, animate.font) + barFix, dxGetTextWidth(animate.title[2], animate.fontScale, animate.font) + barFix, dxGetTextWidth(animate.title[3], animate.fontScale, animate.font) + barFix, dxGetTextWidth(animate.title[4], animate.fontScale, animate.font) + barFix, dxGetTextWidth(animate.title[5], animate.fontScale, animate.font) + barFix }, buttonSizeY = sY / 13, buttonPos = { 0, dxGetTextWidth(animate.title[1], animate.fontScale, animate.font) + barFix, dxGetTextWidth(animate.title[1], animate.fontScale, animate.font) + dxGetTextWidth(animate.title[2], animate.fontScale, animate.font) + barFix * 2, dxGetTextWidth(animate.title[1], animate.fontScale, animate.font) + dxGetTextWidth(animate.title[2], animate.fontScale, animate.font) + dxGetTextWidth(animate.title[3], animate.fontScale, animate.font) + barFix * 3, dxGetTextWidth(animate.title[1], animate.fontScale, animate.font) + dxGetTextWidth(animate.title[2], animate.fontScale, animate.font) + dxGetTextWidth(animate.title[3], animate.fontScale, animate.font) + dxGetTextWidth(animate.title[4], animate.fontScale, animate.font) + barFix * 4 }, buttonPosY = { animate.pos[2], animate.pos[2], animate.pos[2], animate.pos[2], animate.pos[2] }, lastButton = 0, currentAnimate = 0, hover = 0, currentWindow = 0 } function drawBottomBar() for i = 1, #bar.buttonSize do dxDrawRectangle(bar.buttonPos[i], bar.buttonPosY[i], bar.buttonSize[i], animate.barSize[2], tocolor(20, 20, 20, 100)) dxDrawLine(bar.buttonPos[i], bar.buttonPosY[i] + 2, bar.buttonPos[i] + bar.buttonSize[i], bar.buttonPosY[i] + 2, tocolor(100, 100, 100, 200), 2) dxDrawLine(bar.buttonPos[i], bar.buttonPosY[i], bar.buttonPos[i], bar.buttonPosY[i] + animate.barSize[2], tocolor(100, 100, 100, 200), 2) dxDrawLine(bar.buttonPos[i] + bar.buttonSize[i] - 2, bar.buttonPosY[i], bar.buttonPos[i] + bar.buttonSize[i] - 2, bar.buttonPosY[i] + animate.barSize[2], tocolor(100, 100, 100, 200), 2) dxDrawText(animate.title[i], bar.buttonPos[i] + 1, bar.buttonPosY[i] + 1, bar.buttonPos[i] + bar.buttonSize[i] + 1, bar.buttonPosY[i] + bar.buttonSizeY + 1, tocolor(0, 0, 0, 255), animate.fontScale, animate.font, "center", "center") dxDrawText(animate.title[i], bar.buttonPos[i], bar.buttonPosY[i], bar.buttonPos[i] + bar.buttonSize[i], bar.buttonPosY[i] + bar.buttonSizeY, tocolor(15, 192, 252, 255), animate.fontScale, animate.font, "center", "center") end end addEventHandler("onClientRender", getRootElement(), drawBottomBar) function animateBar() if not animBar then if not bindBlock then callServerFunction("unlockAch", getLocalPlayer(), 14) showCursor(true) animBar = true animate.tick = getTickCount() addEventHandler("onClientRender", getRootElement(), animateToolbar) end end bindKey("F7", "down", animateBar) end function checkHoverTab() if isCursorShowing() and animate.anim then local x, y = getCursorPosition() local x, y = x * sX, y * sY if x >= bar.buttonPos[1] and x <= bar.buttonPos[1] + bar.buttonSize[1] and y >= bar.buttonPosY[1] then animateButton(1) bar.hover = 1 elseif x >= bar.buttonPos[2] and x <= bar.buttonPos[2] + bar.buttonSize[2] and y >= bar.buttonPosY[2] then animateButton(2) bar.hover = 2 elseif x >= bar.buttonPos[3] and x <= bar.buttonPos[3] + bar.buttonSize[3] and y >= bar.buttonPosY[3] then animateButton(3) bar.hover = 3 elseif x >= bar.buttonPos[4] and x <= bar.buttonPos[4] + bar.buttonSize[4] and y >= bar.buttonPosY[4] then animateButton(4) bar.hover = 4 elseif x >= bar.buttonPos[5] and x <= bar.buttonPos[5] + bar.buttonSize[5] and y >= bar.buttonPosY[5] then animateButton(5) bar.hover = 5 else animateButton(0) bar.hover = 0 end end end addEventHandler("onClientRender", getRootElement(), checkHoverTab) function onPlayerButtonClick(button, state) if button == "left" and state == "down" and isCursorShowing() and bar.hover ~= 0 then toggleWindow(bar.hover) end end addEventHandler("onClientClick", getRootElement(), onPlayerButtonClick) animateWindow = {} function toggleWindow(id) if bar.currentWindow ~= id then bar.currentWindow = id animateWindow.tick = getTickCount() else bar.currentWindow = 0 end end function drawWindow() if bar.currentWindow ~= 0 then local tick = getTickCount() - animateWindow.tick local progress = tick / 1000 if progress >= 1 then progress = 1 drawComponents = true else drawComponents = false end windowX, windowY = interpolateBetween(0, 0, 0, 600, 400, 0, progress, "OutElastic") dxDrawRectangle(sX / 2 - windowX / 2, sY / 2 - windowY / 2, windowX, windowY / 14, tocolor(0, 0, 0, 150)) dxDrawRectangle(sX / 2 - windowX / 2, sY / 2 - windowY / 2, windowX, windowY, tocolor(0, 0, 0, 200)) end end addEventHandler("onClientRender", getRootElement(), drawWindow) local currentTick = getTickCount() function animateButton(id) if bar.lastButton ~= id then bar.lastButton = id bar.currentAnimate = id currentTick = getTickCount() end if bar.currentAnimate then for i = 1, 5 do if bar.currentAnimate == i then do local tick = getTickCount() local animProgress = tick - currentTick local progress = animProgress / 500 bar.buttonPosY[i] = interpolateBetween(bar.buttonPosY[i], 0, 0, sY - sY / 8, 0, 0, progress, "Linear") end else local tick = getTickCount() local animProgress = tick - currentTick local progress = animProgress / 500 bar.buttonPosY[i] = interpolateBetween(bar.buttonPosY[i], 0, 0, sY - sY / 13, 0, 0, progress, "Linear") end end end end function allowBind(bOl) bindBlock = not bOl end
-
Compiling is pointless because you can decompile them very easily. But FFS has some part in the script that if u decompile it, it will not be usable and is pointless. But idk how to do it.
-
I would like to present my friends new and his first map. The map is only playable in my server ~Tp|The Proffessionals[DM/DD/FUN] [http://tproffessionals.freeforums.org] (mtasa://62.141.35.9:2012)
-
Maybe the problem is in the server side? gRoot = getRootElement() Places = {} PlayersOnRankingBoard = {} function beforeCountDown (stateName,currentRaceStateName) if stateName == "NoMap" then destroyRankingBoard() MapIsRunning = nil PlayersOnRankingBoard = {} elseif stateName == "Running" then MapIsRunning = 1 end end addEvent("onRaceStateChanging",true) addEventHandler('onRaceStateChanging', gRoot, beforeCountDown) function hideRankingBoard() triggerClientEvent("hideAll", gRoot) end function destroyRankingBoard() for i=1,32 do Places[i] = nil end triggerClientEvent("hideAll", gRoot) end function showRankingBoard() for i=1,32 do if Places[i] then triggerClientEvent("showPlayersOnRankingBoard", gRoot, i,getPlayerName(Places[i]),true) end end end function showRankingBoardToPlayer(who) for i=1,32 do if Places[i] then triggerClientEvent(who,"showPlayersOnRankingBoard", gRoot, i,getPlayerName(Places[i]),true) end end end function moveRankingBoard() for j=1,32 do local i = 33-j if Places[i] then Places[i+1] = Places[i] Places[i] = nil end end end function playerJoin() showRankingBoardToPlayer(source) end addEventHandler ( "onPlayerJoin", getRootElement(), playerJoin ) function addPlayersToDeathList () for i=1,#PlayersOnRankingBoard do if PlayersOnRankingBoard[i] == source then return end end table.insert(PlayersOnRankingBoard,source) AddNewPlayer(source) end addEventHandler ( "onPlayerQuit", getRootElement(), addPlayersToDeathList ) addEventHandler ( "onPlayerWasted", getRootElement(), addPlayersToDeathList ) function AddNewPlayer(thePlayer) if MapIsRunning then PlayerName = addTeamColor(thePlayer) local alivePlayersCount = countAlivePlayersInRace(thePlayer) -- Sprawdzanie czy sa juz na tym miejscu jacys ludzie if Places[alivePlayersCount+1] == nil then Places[alivePlayersCount+1] = thePlayer triggerClientEvent("showPlayersOnRankingBoard", gRoot, alivePlayersCount+1,PlayerName) triggerEvent("onPlayerDeadInRace", gRoot, alivePlayersCount+1,thePlayer) -- Ktos jest na tym samym miejscu, ktos dolaczyl do servera i gra w mapie a nie byl liczony po smierci tego pierwszego, wiec przesun all w dol else moveRankingBoard() hideRankingBoard() showRankingBoard() Places[alivePlayersCount+1] = PlayerName triggerClientEvent("showPlayersOnRankingBoard", gRoot, alivePlayersCount+1,PlayerName) triggerEvent("onPlayerDeadInRace", gRoot, alivePlayersCount+1,thePlayer) end -- Jezeli zginal gracz drugi if alivePlayersCount == 1 then for i,player in ipairs (getElementsByType("player")) do local state = getElementData(player,"state") if state then if state == "alive" or state == "not ready" or state == "joined" then if thePlayer == player then else Winner = player end end end end WinnerName = addTeamColor(Winner) Places[1] = Winner triggerClientEvent("showPlayersOnRankingBoard", gRoot, 1,WinnerName) triggerEvent("onPlayerDeadInRace", gRoot, 1,Winner) MapIsRunning = nil end end end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ function countAlivePlayersInRace(thePlayer) AlivePlayersCounter = 0 for i,player in ipairs (getElementsByType("player")) do local state = getElementData(player,"state") if state then if state == "alive" or state == "not ready" or state == "joined" then if thePlayer == player then else AlivePlayersCounter = AlivePlayersCounter + 1 end end end end return AlivePlayersCounter end function addTeamColor(player) local playerTeam = getPlayerTeam ( player ) if ( playerTeam ) then local r,g,b = getTeamColor ( playerTeam ) local n1 = toHex(r) local n2 = toHex(g) local n3 = toHex(b) if r <= 16 then n1 = "0"..n1 end if g <= 16 then n2 = "0"..n2 end if b <= 16 then n3 = "0"..n3 end return "#"..n1..""..n2..""..n3..""..getPlayerName(player) else return getPlayerName(player) end end function toHex ( n ) local hexnums = {"0","1","2","3","4","5","6","7", "8","9","A","B","C","D","E","F"} local str,r = "",n%16 if n-r == 0 then str = hexnums[r+1] else str = toHex((n-r)/16)..hexnums[r+1] end return str end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
Dont work, crashed, basically thats the part of the tabs and the stats window: tabs = { guiCreateWindow(screenWidth/2-mainWindowWidth/2,screenHeight/2-mainWindowHeight/2,mainWindowWidth,mainWindowHeight,"WARNING! The userpanel has failed to load! Please contact NeXTreme as soon as possible!!",false), guiCreateWindow(screenWidth/2-mainWindowWidth/2,screenHeight/2-mainWindowHeight/2,mainWindowWidth,mainWindowHeight,"Players",false), guiCreateWindow(screenWidth/2-mainWindowWidth/2,screenHeight/2-mainWindowHeight/2,mainWindowWidth,mainWindowHeight,"Achievements",false), guiCreateWindow(screenWidth/2-mainWindowWidth/2,screenHeight/2-mainWindowHeight/2,mainWindowWidth,mainWindowHeight,"Shop",false), guiCreateWindow(screenWidth/2-mainWindowWidth/2,screenHeight/2-mainWindowHeight/2,mainWindowWidth,mainWindowHeight,"Maps",false), guiCreateWindow(screenWidth/2-mainWindowWidth/2,screenHeight/2-mainWindowHeight/2,mainWindowWidth,mainWindowHeight,"Options",false) } guiSetVisible(tabs[1],false) guiSetVisible(tabs[2],false) guiSetVisible(tabs[3],false) guiSetVisible(tabs[4],false) guiSetVisible(tabs[5],false) guiSetVisible(tabs[6],false) -- "Stats" TAB lblStats = guiCreateLabel(18,24,150,49,"Stats",false,tabs[1]) guiLabelSetColor(lblStats,255,130,0) guiLabelSetVerticalAlign(lblStats,"top") guiLabelSetHorizontalAlign(lblStats,"left",false) guiSetFont(lblStats,"sa-header") lblPlayerLevel = guiCreateLabel(18,83,136,15,"Level: N/A",false,tabs[1]) guiSetFont(lblPlayerLevel,"default-bold-small") lblPlayerStats = guiCreateLabel(18,201,84,16,"Player stats:",false,tabs[1]) guiLabelSetColor(lblPlayerStats,255,130,0) guiSetFont(lblPlayerStats,"default-bold-small") lblPlayerMoney = guiCreateLabel(18,98,151,14,"Money: N/A",false,tabs[1]) guiLabelSetColor(lblPlayerMoney,255,255,255) guiSetFont(lblPlayerMoney,"default-bold-small") lblAchievementsUnlocked = guiCreateLabel(18,126,180,14,"Achievements unlocked: 0/40",false,tabs[1]) guiSetFont(lblAchievementsUnlocked,"default-bold-small") lblTotalPlayingTime = guiCreateLabel(18,156,292,15,"Total playing time: N/A",false,tabs[1]) guiSetFont(lblTotalPlayingTime,"default-bold-small") lblNextLevelProgress = guiCreateLabel(335,131,232,45,"Progress to next level:",false,tabs[1]) guiLabelSetVerticalAlign(lblNextLevelProgress,"top") guiLabelSetHorizontalAlign(lblNextLevelProgress,"center",false) guiSetFont(lblNextLevelProgress,"default-bold-small") lblPlayerLevelRank = guiCreateLabel(388,45,124,22,"Loading...",false,tabs[1]) guiLabelSetColor(lblPlayerLevelRank,255,130,0) guiLabelSetVerticalAlign(lblPlayerLevelRank,"bottom") guiLabelSetHorizontalAlign(lblPlayerLevelRank,"center",false) guiSetFont(lblPlayerLevelRank,"default-bold-small") lblMapsWon = guiCreateLabel(18,242,205,15,"Maps won: N/A",false,tabs[1]) guiSetFont(lblMapsWon,"default-bold-small") lblTotalMapsPlayed = guiCreateLabel(18,227,205,15,"Total maps played: N/A",false,tabs[1]) guiSetFont(lblTotalMapsPlayed,"default-bold-small") lblWinRatio = guiCreateLabel(18,260,205,15,"Map win ratio: N/A",false,tabs[1]) guiSetFont(lblWinRatio,"default-bold-small") lblTotalHunters = guiCreateLabel(18,285,205,15,"Total hunters reached: N/A",false,tabs[1]) guiSetFont(lblTotalHunters,"default-bold-small") lblTotalToptimes = guiCreateLabel(18,306,205,15,"Total toptimes set: N/A",false,tabs[1]) guiSetFont(lblTotalToptimes,"default-bold-small") lblTotalMoney = guiCreateLabel(222,227,205,15,"Total money earned: N/A",false,tabs[1]) guiSetFont(lblTotalMoney,"default-bold-small") lblTimesJoined = guiCreateLabel(18,171,205,15,"Times joined the server: N/A",false,tabs[1]) guiSetFont(lblTimesJoined,"default-bold-small") lblSentMoney = guiCreateLabel(222,242,205,15,"Money sent to players: N/A",false,tabs[1]) guiSetFont(lblSentMoney,"default-bold-small") lblTotalDeaths = guiCreateLabel(447,257,135,15,"Total deaths: N/A",false,tabs[1]) guiSetFont(lblTotalDeaths,"default-bold-small") lblTotalBets = guiCreateLabel(222,270,205,15,"Total bets: N/A",false,tabs[1]) guiSetFont(lblTotalBets,"default-bold-small") lblBetsWon = guiCreateLabel(222,285,205,15,"Bets won: N/A",false,tabs[1]) guiSetFont(lblBetsWon,"default-bold-small") lblMoneyEarnBet = guiCreateLabel(222,307,205,15,"Money earned with betting: N/A",false,tabs[1]) guiSetFont(lblMoneyEarnBet,"default-bold-small") lblTotalReactionTests = guiCreateLabel(447,217,135,15,"Reaction tests won: N/A",false,tabs[1]) guiSetFont(lblTotalReactionTests,"default-bold-small") lblBestReactionTime = guiCreateLabel(447,232,135,15,"Best reaction time: N/A",false,tabs[1]) guiSetFont(lblBestReactionTime,"default-bold-small") progressLevel = guiCreateProgressBar(341,148,219,23,false,tabs[1]) buttonLevelUp = guiCreateButton(342,176,219,19,"Level up",false,tabs[1]) imageLevel = guiCreateStaticImage(370,73,161,52,"levels/LEVEL1.png",false,tabs[1])
-
This will make only the background image? or the edges of the window will go away also?
-
Im trying to replace the windows with an image so they would look cool and stuff
-
Lol, i said this is the bugged part: ---Bugged Part. dxDrawText(toptimes.time[i],sX-toptimes.size[1]+(toptimes.size[1]*0.52)-10,(sY/2)-(toptimes.size[2])+(200/8)+((i-1)*20),sX-(toptimes.size[1]*0.1)-10,(sY/2)-(toptimes.size[2])+(200/8)+((i)*20),tocolor(255,255,255,255),1,"default-bold","left","center",true,false,false,true)
-
So i have this script that works perfectly just that one bug is annoying me: As you see the first --Empty-- is in different place. This makes the other places: for i=1,8 do dxDrawText(i..") "..toptimes.label[i],sX-toptimes.size[1]+(toptimes.size[1]*0.03)-10,(sY/2)-(toptimes.size[2])+(200/8)+((i-1)*20),sX-(toptimes.size[1]*0.1)-10,(sY/2)-(toptimes.size[2])+(200/8)+((i)*20),tocolor(255,255,255,255),1,"default-bold","left","center",true,false,false,true) And this makes the first one, and is bugged: ---Bugged Part. dxDrawText(toptimes.time[i],sX-toptimes.size[1]+(toptimes.size[1]*0.52)-10,(sY/2)-(toptimes.size[2])+(200/8)+((i-1)*20),sX-(toptimes.size[1]*0.1)-10,(sY/2)-(toptimes.size[2])+(200/8)+((i)*20),tocolor(255,255,255,255),1,"default-bold","left","center",true,false,false,true)
-
Now its like this. I tried only one. tabs = { dxDrawImage ( screenWidth/2 - 50, 0, 100, 240, 'window.png', angle,"Stats", 0, -120 ) end function HandleTheRendering ( ) addEventHandler("onClientRender", getRootElement(), renderDisplay), guiCreateWindow(screenWidth/2-mainWindowWidth/2,screenHeight/2-mainWindowHeight/2,mainWindowWidth,mainWindowHeight,"Achievements",false), guiCreateWindow(screenWidth/2-mainWindowWidth/2,screenHeight/2-mainWindowHeight/2,mainWindowWidth,mainWindowHeight,"Shop",false), guiCreateWindow(screenWidth/2-mainWindowWidth/2,screenHeight/2-mainWindowHeight/2,mainWindowWidth,mainWindowHeight,"Maps",false), guiCreateWindow(screenWidth/2-mainWindowWidth/2,screenHeight/2-mainWindowHeight/2,mainWindowWidth,mainWindowHeight,"Options",false) } and the result: [2013-03-11 12:28:40] WARNING: Loading script failed: lol123\main_client.lua:191: '}' expected (to close '{' at line 189) near 'end'
-
Lol, you can download it from internet also, btw what gamomdes do you play?
-
I had tried that also, its buggeda and i found already a better spectators resource.
