R.I.P Logic

Members
  • Content Count

    215
  • Joined

  • Last visited

Community Reputation

8 Neutral

About R.I.P Logic

  • Rank
    Chump
  • Birthday 09/11/2003

Details

  • Location
    England

Recent Profile Visitors

568 profile views
  1. I've made a panel with enabling and disabling shader from World Textures, the issue is, when I enable it for the first time it works, then I disable it works. I enable it for the second time, I disable that second time doesn't work, like the engineRemoveShaderFromWorldTexture worked one time... Any clue?
  2. So you want that onPlayerLogin check if players have the files? If they don't have it I'll use fileCreate/write/close? You're idea works, I can let them play while those files are downloading and add a note that they download some stuff, so I won't need to add them in a meta.xml, I thought of it, but I've read at Avoid using fileExists before calling downloadFile. Always call downloadFile and handle the result in onClientFileDownloadComplete at https://wiki.multitheftauto.com/wiki/DownloadFile, but I don't have a choice anyway, thanks.
  3. Dude, I trigger it every time a player tries to add a picture, you can't add a command handler for it... It starts as a panel write the link and stuff, then press the button, then it triggers the FetchRemote to download it, then it goes to fileCreate write and close, then it triggers addToXML then it triggers a client event downloadFile, that's it. But the thing is, it doesn't say like file doesn't exist, I go to MTA > Mods > Deathmatch ... > to the script, but the picture wasn't there. I've reconnected, like maybe it will load the XML file, didn't. As I said only when I restart the script, that picture gets downloaded.
  4. function addToXML( player, GlobalID, folder, folder1 ) local xml = xmlLoadFile("meta.xml") if ( xml ) then huh = xmlCreateChild( xml, "file" ) xmlNodeSetAttribute( huh, "src", folder.."/"..folder1.."/"..GlobalID) xmlSaveFile(xml) xmlUnloadFile(xml) else print("Unable to open meta.xml") end end Already did that, unfortunate it didn't work, I've tried to reconnect thought maybe when I join the server that picture will be downloaded, but it didn't, only when I restarted the script, the picture gets downloaded
  5. So my only choice is to reload the XML file, means my only choice is the restart the script?
  6. Okay I'm not sure why but it's not working anymore, so I'm trying to download a picture using fetchRemote(Worked), then it will edit the (xmlLoadFile, xmlSaveFile, xmlUnloadFile) meta.xml(worked), and the file gets downloaded in the server script, BUT when I use downloadFile by triggering it from the client side(triggerClientEvent), the file doesn't get downloaded... So what should I do? Note: I need the file to be download globally, not for the client only...
  7. R.I.P Logic

    [HELP] Text

    Okay use addEventHandler( "onClientGUIClick", label, function, false) at the function write the login event, when he press on the text, the event will get trigger for whatever you desire
  8. Nvm worked, I used that function, but I've forgotten to add the client script to meta.xml, silly right? Thanks anyway
  9. R.I.P Logic

    [HELP] Text

    My bad local label function fedit() edit1 = guiCreateStaticImage(608, 544, 150, 40, "gfx/edit.png", false) addEventHandler("onClientGUIClick", edit1, fedit1, false) end addEventHandler("onClientResourceStart", getRootElement(), fedit) function fedit1 (button) if button == "left" then label = guiCreateLabel( 608, 544, 200, 30, "Text", false) guiSetVisible( label, true) end end function removeLabel() guiSetVisible( label, false) end --What ever you need to addEventHandler or addCommandHandler or call the function ' removeLabel() '
  10. R.I.P Logic

    [HELP] Text

    What about guiCreateLabel to write a text? But then you need to fix the position of it guiCreateLabel( x, y, width, height, text, relative, parent) so you can write it without using a window: guiCreateLabel( x, y, width, heigh, "The text you want to write here..", relative ) Don't write a parent so it can be shown, if you want to remove it you can write guiSetVisible( labelname, false) example: local label function fedit() edit1 = guiCreateStaticImage(608, 544, 150, 40, "gfx/edit.png", false) addEventHandler("onClientGUIClick", edit1, fedit1, false) end addEventHandler("onClientResourceStart", getRootElement(), fedit) function fedit (button) if button == "left" then label = guiCreateLabel( 608, 544, 200, 30, "Text", false) guiSetVisible( label, true) end end function removeLabel() guiSetVisible( label, false) end --What ever you need to addEventHandler or addCommandHandler or call the function ' removeLabel() ' I suggest guiCreateLabel because dxDrawText needs onClientRender and the event handler onClientRender reduce players FPS...
  11. I need to reload a xml file without restarting the resource is there a way to do that?
  12. How can I check if a link works? I've tried to write " https://imgur.com/download/B8ta5Aa/The+Senate+upvote+this+image+of+our+glorious+ruler+so+it's+the+first+image+when+you+google+%22The%20Senate%22 " and it worked, : How can I know if the link will work in MTA? Okay, thanks I tried to use, fileCreate, fileWrite, fileClose and it worked! I used outputChatBox and print, and suddenly I remembered that that encrypted language doesn't work in MTA, so I tried those 3 functions, worked. Thanks!
  13. -- Server function startImageDownload( playerToReceive ) fetchRemote ("https://imgur.com/download/B8ta5Aa/The+Senate+upvote+this+image+of+our+glorious+ruler+so+it's+the+first+image+when+you+google+%22The%20Senate%22", myCallback, "", false, playerToReceive ) end addCommandHandler( "d", startImageDownload) function myCallback( responseData, errno, playerToReceive ) if errno == 0 then triggerClientEvent( playerToReceive, "onClientGotImage", resourceRoot, responseData ) end end -- Client addEvent( "onClientGotImage", true ) addEventHandler( "onClientGotImage", resourceRoot, function( pixels ) downloadFile( pixels ) end ) File doesn't exist, it is the first time I use fetchRemote, so I'm not sure what's the wrong thing in it, now I know so I can download it I should edit meta.xml, but the image has not been downloaded, so any explanations?
  14. If I need to download a picture via link, which should be used? fetchRemote or callRemote ?
  15. Oh thanks, I didn't see that coming