Jump to content

John Smith

Members
  • Posts

    656
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by John Smith

  1. bilal why don't you put a pirate ship onto your 'pirate gaming' logo?
  2. both methods of yours work - @Et-win, @Bonsai thanks for help, Et-win and Bonsai
  3. i dont understand what you exactly mean by this
  4. i have made outputChatBox debugs and events work fine for exactly my button, but the problem is in setting the new image i am trying to overlap current image because if i remove event handler of original image, everything will be fucked up due to my low scripting skills and not knowing how to avoid onclientrender is already handled error
  5. umm maybe im doing it wrong but it doesnt work function buttonEnter () if source == menuButton then dxDrawImage(screenWidth/2.20,screenHeight/1.50, 150,40,'images/exitmenu_hover.png') addEventHandler("onClientRender",root,buttonEnter) end end addEventHandler( "onClientMouseEnter", getRootElement(),buttonEnter) function buttonExit () if source == menuButton then removeEventHandler("onClientRender",root,buttonEnter) end end addEventHandler( "onClientMouseLeave", getRootElement(),buttonExit)
  6. hi im having this code(its not full code but i'm posting everything regarding this button) menuButton = guiCreateButton( 873, 720, 150, 40, "Exit to Menu", false ) function drawRooms() guiSetAlpha(menuButton,0) end addEventHandler( "onClientMouseEnter", getRootElement(), function () if source == menuButton then -- also tried replacing this with 'guielement' dxDrawImage(screenWidth/2.20,screenHeight/1.50, 150,40,'images/exitmenu_hover.png') end end ) addEventHandler( "onClientMouseLeave", getRootElement(), function () if source == menuButton then dxDrawImage(screenWidth/2.20,screenHeight/1.50, 150,40,'images/exitmenu.png') end end ) no debug errors
  7. et-win im sorry but i didnt quite understand what u meant about what i have to fill in if you have time, can you please please show me how this script(lines or full script) would look like if i had infernus in table with id 411 and then tried to check for it as well as checking for hunter file existance sry for my english..
  8. ohhh i just noticed it now,i forgot to make it like /mods folder path thing,i forgot about that sorry. anyway could you just tell me 2 things? 1) what is this 3rd thing loadMod(tableData[1], tableData[2], tableData[3]) tableData is for downloadFiles table and there are 2 files only so why must there be a third one? or perhaps this is used because there are 3 arguments in loadMod function? 2) how could i exactly make more files? something like this? local downloadFiles = { {"txd", "hunter.txd", 425}, {"dff", "hunter.dff", 425}, {"txd1", "infernus.txd", 411}, {"dff1", "infernus.dff", 411}, } and it would work automatically or i have to add/edit some more things? sorry for much questions, i just wanna know 100% how this script works so i could edit it later if needed
  9. i have used et-win's example(on page 2) as im not experienced with file functions and triggering events, but it doesn't work in bottom right corner i see downloading (0/2) but it isn't downloading and at line 67 it says file doesn't exist
  10. i still dont understand how to make this work maybe i am dumb but i really dont understand what is the problem in the code, and why is it not downloading
  11. fileExists is used because onClientFileDownloadComplete is triggered when ONE by ONE file is downloaded, so if i remove the checks there is possibility of launching carmod without a texture or its shape so it would be fucked and i believe cars wouldn't even be modded if there wasn't import txd and dff function in my script
  12. umm yeah i already have it in meta, and i have already checked before, its not in my resource folder ,so its not downloaded and i dont know why
  13. yeah, and i have replaced those both with setElementPosition onPlayerWasted with a timer, thanks but theres a problem when i didn't download yet the carmod, it outputs that i have triggered the download in chat, but it isnt really downloading i believe, no debugscript 3 errors and my code is same as above posted
  14. my whole pc is lagging i couldnt even see anything in debugscript 3 because it wasnt possible because of loading and on console it says nothing, only thing which is getting infinite or overflow is my spawn script in which idk why i get c stack overflow but its attached to onPlayerSpawn but it never caused that 1 minute til crash freeze
  15. i still have that freeze local screenWidth,screenHeight = guiGetScreenSize() local downloadFiles = { { "mods/alpha.txd" }, { "mods/alpha.dff" }, } function downloadState() dxDrawText("Downloading... (0/2)",screenWidth,screenHeight,screenWidth,screenHeight,tocolor(255,255,255,255),1,"bankgothic") end addEventHandler ( "onClientFileDownloadComplete", resourceRoot, function ( file, success ) if ( success ) then -- alpha if ( file == "mods/alpha.txd" and fileExists("mods/alpha.dff") ) or ( file == "mods/alpha.dff" and fileExists("mods/alpha.txd") ) then local txdalp = engineLoadTXD ( "mods/alpha.txd" ) local dffalp = engineLoadDFF ( "mods/alpha.dff", 602 ) engineImportTXD ( txdalp, 602 ) engineReplaceModel ( dffalp, 602 ) removeEventHandler("onClientRender",root,downloadState) end end end ) function checkIfPlayerAlreadyHasDownloaded() if ( fileExists("mods/alpha.dff") and fileExists("mods/alpha.txd")) then local txdalp = engineLoadTXD ( "mods/alpha.txd" ) local dffalp = engineLoadDFF ( "mods/alpha.dff", 602 ) engineImportTXD ( txdalp, 602 ) engineReplaceModel ( dffalp, 602 ) else outputChatBox("client has no carmods, and has triggered the download!") for _, downFile in pairs( downloadFiles ) do downloadFile ( downFile ) end end end addEventHandler("onClientPlayerSpawn",root,checkIfPlayerAlreadyHasDownloaded) addEventHandler("onClientRender",root,downloadState) i used your fix bonsai but i dont understand the handler part,onClientRender is attached to total another function and im having freeze
  16. that was used for debugging purposes, and as i expected, deleting it didn't fix anything, i still had the freeze
  17. so like this? local screenWidth,screenHeight = guiGetScreenSize() local downloadFiles = { { "mods/alpha.txd" }, { "mods/alpha.dff" }, } function downloadState() dxDrawText("Downloading... (0/2)",screenWidth,screenHeight,screenWidth,screenHeight,tocolor(255,255,255,255),1,"bankgothic") end addEventHandler ( "onClientFileDownloadComplete", resourceRoot, function ( file, success ) if ( success ) then -- alpha if ( file == "mods/alpha.txd" and fileExists("mods/alpha.dff") ) or ( file == "mods/alpha.dff" and fileExists("mods/alpha.txd") ) then local txdalp = engineLoadTXD ( "mods/alpha.txd" ) local dffalp = engineLoadDFF ( "mods/alpha.dff", 602 ) engineImportTXD ( txdalp, 602 ) engineReplaceModel ( dffalp, 602 ) removeEventHandler("onClientRender",root,downloadState) end end end ) function checkIfPlayerAlreadyHasDownloaded() if ( fileExists("mods/alpha.dff") and fileExists("mods/alpha.txd")) then outputChatBox("Loading carmods...") local txdalp = engineLoadTXD ( "mods/alpha.txd" ) local dffalp = engineLoadDFF ( "mods/alpha.dff", 602 ) engineImportTXD ( txdalp, 602 ) engineReplaceModel ( dffalp, 602 ) else outputChatBox("client has no carmods, and has triggered the download!") for _, downFile in pairs( downloadFiles ) do downloadFile ( downFile[1] ) addEventHandler("onClientRender",root,downloadState) end end end addEventHandler("onClientPlayerSpawn",root,checkIfPlayerAlreadyHasDownloaded) edit: im still getting huge freeze as explained in my previous post
  18. if someone could help me, that'd be great
  19. there was no difference, when i spawned i had mta loading gif for 1 minute untill i timed out, and while i had loading gif, it was extremely fast spamming my chat with Loading carmods...
  20. hello i found one code on forum not sure where but i have been using it and i tried editing it but theres a problem local screenWidth,screenHeight = guiGetScreenSize() local downloadFiles = { { "mods/alpha.txd" }, { "mods/alpha.dff" }, } function downloadState() dxDrawText("Downloading... (0/2)",screenWidth,screenHeight,screenWidth,screenHeight,tocolor(255,255,255,255),1,"bankgothic") end addEventHandler("onClientRender",root,downloadState) for _, downFile in pairs( downloadFiles ) do downloadFile ( downFile[1] ) downloadState() end addEventHandler ( "onClientFileDownloadComplete", resourceRoot, function ( file, success ) if ( success ) then -- alpha if ( file == "mods/alpha.txd" and fileExists("mods/alpha.dff") ) or ( file == "mods/alpha.dff" and fileExists("mods/alpha.txd") ) then local txdalp = engineLoadTXD ( "mods/alpha.txd" ) local dffalp = engineLoadDFF ( "mods/alpha.dff", 602 ) engineImportTXD ( txdalp, 602 ) engineReplaceModel ( dffalp, 602 ) removeEventHandler("onClientRender",root,downloadState) end end end ) function checkIfPlayerAlreadyHasDownloaded() if ( fileExists("mods/alpha.dff") and fileExists("mods/alpha.txd")) then outputChatBox("Loading carmods...") local txdalp = engineLoadTXD ( "mods/alpha.txd" ) local dffalp = engineLoadDFF ( "mods/alpha.dff", 602 ) engineImportTXD ( txdalp, 602 ) engineReplaceModel ( dffalp, 602 ) else outputChatBox("client has no carmods, and has triggered the download!") for _, downFile in pairs( downloadFiles ) do downloadFile ( downFile[1] ) downloadState() end end end addEventHandler("onClientPlayerSpawn",root,checkIfPlayerAlreadyHasDownloaded) i have already previously downloaded files but when i spawn i need to wait 20 seconds of mta loading gif image and it spams chat with loading carmods...i cant even count how much there were,its whole chat like 10 times i am not sure what is causing this freeze please help
  21. you think its not possible?how?half of mta servers got nametag system like that,most popular ones in race would be TG or FFS and theres even the code in dxscoreboard which does this if column.name == "name" then local playerName = getElementData( player, "pnick" ) -- here i changed the definition so it puts that data on scoreboard if serverInfo.allowcolorcodes then if string.find( playerName, "#%x%x%x%x%x%x" ) then local colorCodes = {} while( string.find( playerName, "#%x%x%x%x%x%x" ) ) do local startPos, endPos = string.find( playerName, "#%x%x%x%x%x%x" ) if startPos then colorCode = string.sub( playerName, startPos, endPos ) table.insert( colorCodes, { { getColorFromString( colorCode ) }, startPos } ) playerName = string.gsub( playerName, "#%x%x%x%x%x%x", "", 1 ) i just dont know how to "transform" this code into my code so that it would work
  22. it will remove hex codes in way of this before - #00FF00Mi#0000FFke later - Mike but its still not in 2 colors in nametag and i believe there are no 2 colors in nametag because i would need to remove gsub thing and somehow use getColorFromString function but i dont know how to use it so i didnt remove it yet can you help me with how to use getColorFromString in this case?
×
×
  • Create New...