-
Posts
455 -
Joined
-
Last visited
Everything posted by Sex*
-
So i want to make something like this that image is the GUIWindow: local sW,sH = guiGetScreenSize ( ); local gUtils = { }; gUtils.guiW,gUtils.guiH = 650, 450; gUtils.posX,gUtils.posY = sW / 2 - gUtils.guiW / 2, sH / 2 - gUtils.guiH / 2; --Center of screen for all resolutions local gLabels = { }; local gButtons = { }; local staticimage = {}; resourceRoot = getResourceRootElement( getThisResource( ) ) localPlayer = getLocalPlayer() infoTable = {} Login_Edit = {} SanyButtons = {} SanysButtons = {} GUIEditor_Checkbox = {} font = {} font[-1] = guiCreateFont( "font/font2.ttf", 8 ) local g_Window = nil function createGui ( ) if g_Window then return end g_Window = {} gWindow = guiCreateStaticImage ( gUtils.posX, gUtils.posY, gUtils.guiW, gUtils.guiH, "images/window.png", false ) But if i make something like that it crashes, the original is like this: tabs ={ guiCreateWindow(screenWidth/2-mainWindowWidth/2,screenHeight/2-mainWindowHeight/2,mainWindowWidth,mainWindowHeight,"WARNING! The userpanel has failed to load! Please contact the owner as soon as possible!",false)} And if i tried to make something it came like this and didnt work: tabs = { local sW,sH = guiGetScreenSize ( ); local gUtils = { }; gUtils.guiW,gUtils.guiH = 650, 450; gUtils.posX,gUtils.posY = sW / 2 - gUtils.guiW / 2, sH / 2 - gUtils.guiH / 2; --Center of screen for all resolutions local gLabels = { }; local gButtons = { }; local staticimage = {}; resourceRoot = getResourceRootElement( getThisResource( ) ) localPlayer = getLocalPlayer() infoTable = {} Login_Edit = {} SanyButtons = {} SanysButtons = {} GUIEditor_Checkbox = {} local g_Window = nil function createGui ( ) if g_Window then return end g_Window = {} gWindow = guiCreateStaticImage ( gUtils.posX, gUtils.posY, gUtils.guiW, gUtils.guiH, "images/window.png",WARNING! The userpanel has failed to load! Please contact the owner as soon as possible!", false )}
-
Removed the ends, still doesnt work.
-
It doesnt create debug errors and doesnt work: local gRoot = getRootElement() local gMe = getLocalPlayer() local sW , sH = guiGetScreenSize () local TextScale = sH/1800 --if TextScale < 1.0 then TextScale = 1.0 end local TextFont = "bankgothic" local maxPlayers = 10 local slideFlag = false local elements = {} local places = {} local numbers = {} local alpha = {} local slide = {} function startResource () for i=1,maxPlayers do numbers[i] = "" places[i] = "" elements[i] = nil alpha[i] = 1 slide[i] = 0 end addEventHandler ( "onClientRender", gRoot, RankingBoardDrawing ) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), startResource ) addEvent("onPlayerWasted", true) addEventHandler("onPlayerWasted", getRootElement(), function(state) if(state)then removeEventHandler ( "onClientRender", gRoot, RankingBoardDrawing ) addEventHandler ( "onClientRender", gRoot, RankingBoardDrawing ) else removeEventHandler ( "onClientRender", gRoot, RankingBoardDrawing ) 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 function RankingBoardDrawing () local deathList = {} for i=1, maxPlayers do local name = places[i] if(isElement(elements[i]))then local tColor = "" local team = getPlayerTeam(elements[i]) if(team)then local r,g,b = getTeamColor ( team ) 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 tColor = "#"..n1..""..n2..""..n3 end name = tColor..getPlayerName(elements[i]) places[i] = name end if(#(tostring(i)) == 1)then deathList[i] = " "..numbers[i].." "..name else deathList[i] = numbers[i].." "..name end end dxDrawColorTextPuma(deathList, sW*0.00875, sH*0.325, sW , sH, tocolor(255,255,255,200), TextScale, TextFont , "left", "top") end end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ function Adding (s,nameS, element, moveing) local name = nameS local pos = s/2 local color = "#FF4000" if(pos == 1)then color = "#ff4000" elseif(pos == 2)then color = "#ff4000" elseif(pos == 3)then color = "#ff4000" end numbers[pos] = "#FFFFFF["..color..pos.."#FFFFFF]" if not moveing then setTimer(function() if numbers[pos] == "#FFFFFF["..color..pos.."#FFFFFF]" then numbers[pos] = "#FFFFFF["..color..pos.."#FFFFFF]" else numbers[pos] = "#FFFFFF["..color..pos.."#FFFFFF]"--"#FFFFFF )" end end, 100, 5) else numbers[pos] = "#FFFFFF["..color..pos.."#FFFFFF]" end --local nameFix = string.gsub(name, "\\", "\\\\") places[pos] = name elements[pos] = element alpha[pos] = 0 slide[pos] = 0 -- over range fix local co = 0 for i=1,maxPlayers do if not(places[i] == "")then co = co + 1 end end local index = 0 for i=1,maxPlayers do if not(places[maxPlayers-i+1] == "")then index = maxPlayers-i+1 break end end index = maxPlayers - index if(co > 16)then local nr = co - 16 nr = nr + index local off = maxPlayers for i=1,nr do numbers[off] = "" places[off] = "" elements[off] = nil off = off - 1 end end end addEvent( "showPlayersOnRankingBoard", true ) addEventHandler( "showPlayersOnRankingBoard", gRoot, Adding ) function hideAll () resetVariables() for i=1,maxPlayers do numbers[i] = "" places[i] = "" elements[i] = nil alpha[i] = 0 slide[i] = 0 end end addEvent( "hideAll", true ) addEventHandler( "hideAll", gRoot, hideAll ) function resetVariables() places = nil numbers = nil alpha = nil slide = nil elements = nil places = {} elements = {} numbers = {} alpha = {} slide = {} slideFlag = false end addEvent("onSlideList", true) addEventHandler("onSlideList", getRootElement(), function() slideFlag = true end) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ function getScale(w) local scale = (w*(1/900)) --scale = math.max(scale, 0.4) return scale end local limitY = 450/900*sW local block = (sW/28) local inc = 0.00925*sW local spaceHeight = 6/900*sW function dxDrawColorTextPuma(str, ax, ay, bx, by, color, scale, font, alignX, alignY) local Texts = {} --Texts = string.explode(str,"/newline/") Texts = str local index = 1 for i=1,#Texts do if not(places[i] == "")then local alphaS = math.min(alpha[i],225) local offset = math.max(0, (255 - alpha[i])/3) if((ay+(dxGetFontHeight ( scale, font ))*(index-1)) - offset > limitY)then break end alpha[i] = alpha[i] + 3 local sl = 0 local slY = 0 if slideFlag then if(index == 1)then sl = slide[index] + inc slide[index] = sl else if((slide[index - 1] - slide[index]) > block)then sl = slide[index] + inc slide[index] = sl end end if(index == 1 or index == 6 or index == 11 or index == 16 or index == 21)then slY = sl/2 elseif(index == 2 or index == 7 or index == 12 or index == 17 or index == 22)then slY = - sl/2 elseif(index == 3 or index == 8 or index == 13 or index == 18 or index == 23)then slY = sl/4 elseif(index == 4 or index == 9 or index == 14 or index == 19 or index == 24)then slY = - sl/4 else slY = 0 end end local shadow = string.gsub(Texts[i],"#%x%x%x%x%x%x","#000000") dxDrawColorTextNext(shadow, ax + 1 + sl, ((ay)+(dxGetFontHeight ( scale, font ))*(index-1)) - offset + slY + spaceHeight + 1, bx+2, bx+2, tocolor(255,255,255,50), scale, font, alignX, alignY, alphaS) dxDrawColorTextNext(Texts[i], ax + sl, (ay+(dxGetFontHeight ( scale, font ))*(index-1)) - offset + slY + spaceHeight, bx, by, color, scale, font, alignX, alignY, alphaS) index = index + 1 end end end function dxDrawColorTextNext(str, ax, ay, bx, by, color, scale, font, alignX, alignY, alpha) 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
-
OneBip option?
-
Fibre Optic Game Hosting! 100 slots for £4!!
Sex* replied to FibreOpticHosting's topic in Hosting solutions
OneBip option? -
Its possible but XML is laggy. I think that these would work better: setAccountData getAccountData
-
is not necessary to delete the text Yes, i know, i said it in my last post.
-
race_client. I just put "--" in there so they wont draw the text but they dont create debug errors and epic lags also then.
-
One way is deleting that text and creating a new one with dxDrawColorText like i did.
-
haha, that actually worked.ty
-
Okay, but please can someone help me with this? My server isnt going anywhere because of that bug.
-
So??
-
ye the client crashed.
-
Yes, in that picture yea. In that link is the custom ones. So something like this? What if player infernus isnt modded with custom wheels? Then he could have white wheels. function remove ( sourcePlayer, command ) theVehicle = getPlayerOccupiedVehicle ( sourcePlayer ) if ( theVehicle ) then removeVehicleUpgrade ( theVehicle, 1025 ) removeVehicleUpgrade ( theVehicle, 1075 ) ---and so on... end end addEventHandler ( "onClientMapStarting",getRootElement(), remove )
-
So i have this custom infernus.dff and infernus.txd at my GTA directory, FFS and some servers load my wheels on map start but my server loads my wheels at vehiclechange. So in map start i have original wheels. Like this: But my custom infernus have wheels like this: http://ffsgaming.net/threads/8367-Str1keZ-s-Infernus-Mod-%28-FFS-Gaming-Edition%29 And these wheels only load after vehiclechange. So how i would make it possible like FFS to load the wheels at map start? NB! I WANT TO LOAD THE INFERNUS WHEELS FROM MY GTA DIRECTORY [GTA3.img(infernus.dff and infernus.txd)]!!!
-
That didnt worked. All the text was gone:D
-
This is already the old sscript, i have fixed several bugs there, only problem is "slide effect" with the text and guiGetScreenSize. Right now: --Do you like this? sx,sy = guiGetScreenSize() local screenWidth,screenHeight = guiGetScreenSize() local messagesList = { "Press Space To Respawn", "More Information in Help [F9]", "The Proffessionals", "Have Fun!" } local currentMessage = 1 function toggleHideAll() startTimess = getTickCount() addEventHandler("onClientRender",getRootElement(),mapwindowa) end addEventHandler ( "onClientPlayerWasted", localPlayer, function ( ) toggleHideAll ( ) end ) function mapwindowa() local pX, pY, pZ = getElementPosition ( source ) local hours = getRealTime() .hour local minutes = getRealTime() .minute local seconds = getRealTime() .second local sec = getTickCount() / 1 local rotate = math.ceil(sec) * 0.20 deltaTime = (getTickCount()) - startTimess if deltaTime <= 1000 then beta = sy - ((deltaTime/1000)*100) elseif (deltaTime > 1000) and (deltaTime < 4000) then beta = sy-100 end dxDrawRectangle((sx-1400)/2,beta,1400,110,tocolor ( 0, 0, 0, 225 )) dxDrawImage ( screenWidth/1-200, screenHeight/1-100, 140, 100, 'load.png', rotate, 0, 0 ) dxDrawText("Time:"..hours..":"..minutes..":"..seconds,125+(sx-400)/2,beta+50,((sx-400)/2)+400,beta+99,tocolor(255,255,255),2,"default-bold","left","top",true,true,true) dxDrawText(messagesList[currentMessage],125+(sx-1000), 715, sx - 1000, 16, tocolor(250, 255, 255, 255), 2, "default-bold", "center", "top", false, false, true) end function updateMessage() if (currentMessage == #messagesList) then currentMessage = 1 else currentMessage = currentMessage + 1 end end setTimer(updateMessage, 5000, 0)
-
Ah got it working but now the problem is with guiGetScreenSize!!
-
So i put to scripts together to make them better but it doesnt work, script btw: sx,sy = guiGetScreenSize() font = dxCreateFont("tsw.ttf", 20) local screenWidth,screenHeight = guiGetScreenSize() local messagesList = { "LOL MESSAGE", "Server Owner: Sex*", "Have Fun!", } local currentMessage = 0 function toggleHideAll() startTimess = getTickCount() addEventHandler("onClientRender",getRootElement(),mapwindowa) end addEventHandler ( "onClientPlayerWasted", localPlayer, function ( ) toggleHideAll ( ) end ) function mapwindowa() local pX, pY, pZ = getElementPosition ( source ) local hours = getRealTime() .hour local minutes = getRealTime() .minute local seconds = getRealTime() .second local sec = getTickCount() / 1 local rotate = math.ceil(sec) * 0.20 deltaTime = (getTickCount()) - startTimess if deltaTime <= 1000 then beta = sy - ((deltaTime/1000)*100) elseif (deltaTime > 1000) and (deltaTime < 4000) then beta = sy-100 end dxDrawRectangle((sx-1400)/2,beta,1400,110,tocolor ( 0, 0, 0, 225 )) dxDrawImage ( screenWidth/1-200, screenHeight/1-100, 140, 100, 'load.png', rotate, 0, 0 ) dxDrawText("Time:"..hours..":"..minutes..":"..seconds,125+(sx-400)/2,beta+50,((sx-400)/2)+400,beta+99,tocolor(255,255,255),2,"default-bold","left","top",true,true,true) dxDrawText(messagesList[currentMessage + 1], screenWidth - 400, 6, screenWidth - 400, 16, tocolor(0, 255, 0, 255), 1, "font", "center", "top", false, false, false) end ) function updateMessage() if (currentMessage == 4) then currentMessage = 0 else currentMessage = currentMessage + 1 end end setTimer(updateMessage, 5000, 0) addEvent ("onfuckYouStoler", true) addEventHandler ("onfuckYouStoler", root, function () removeEventHandler ("onClientRender", root, mapwindowa) removeEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), mapwindowa) end )
