Sex* Posted February 25, 2013 Share Posted February 25, 2013 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 ) Link to comment
Max+ Posted February 25, 2013 Share Posted February 25, 2013 /debugscript 3 What Does it say ? Link to comment
Moderators IIYAMA Posted February 26, 2013 Moderators Share Posted February 26, 2013 sx,sy = guiGetScreenSize() font = dxCreateFont("tsw.ttf", 20) local screenWidth,screenHeight = guiGetScreenSize() local messagesList = { "LOL MESSAGE", "Server Owner: Sex*", "Have Fun!"--, 1 to much. >>>>>>>>>>>>>>>>>>>>>>>> } 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 (":O", true) addEventHandler (":O", root, function () removeEventHandler ("onClientRender", root, mapwindowa) removeEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), mapwindowa) end ) I found one bug in your table: "Have Fun!", = to "Have Fun!" This small comma is so sneaky, I also forget to add and remove them. If it still does not work, do what mat+ said and tell us the other errors. Link to comment
Sex* Posted February 26, 2013 Author Share Posted February 26, 2013 Ah got it working but now the problem is with guiGetScreenSize!! Link to comment
Moderators IIYAMA Posted February 26, 2013 Moderators Share Posted February 26, 2013 nice Link to comment
codeluaeveryday Posted February 27, 2013 Share Posted February 27, 2013 Try this friend, plus there are many bugs. SCREENSHOT AND UPLOAD WHAT IT LOOKS LIKE IN 800x600 and your main resolution. sx,sy = guiGetScreenSize() font = dxCreateFont("tsw.ttf", 20) 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/1366)*sx)/2,beta,(1400/1366)*sx,110,tocolor ( 0, 0, 0, 225 )) dxDrawImage ( sx-200, sy-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 (":O", true) addEventHandler (":O", root, function () removeEventHandler ("onClientRender", root, mapwindowa) removeEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), mapwindowa) end ) Link to comment
Sex* Posted February 27, 2013 Author Share Posted February 27, 2013 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) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now