Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by WiBox

  1. Well, if I spawn peds in a certain range from the player in a way that would be inside his distance of render things will be solved, better than using setElementStreamable. Thank you
  2. I'm trying to make something like a NPC system, while using setPedControlState and setPedAnalogControlState (Ped was inside a vehicle) I've seen that, while the ped is inside my distance of render (setFarClipDistance) the control state works, but when the ped is outside it, he won't move.. So I used outputChatBox with getElementPosition ped when I'm far it gave the same coordination in another words the ped didn't move, isn't there a way to disable that? To make a ped drive a car even if he's not inside my distance of render?
  3. -- Wait my bad I forget to think about how triggerEvent works, thank you both!
  4. Dude that's not what I need I want to like function applySetting() -- when this function activate, all 'addEventHandler('onSettingsChange" .. will activate setSetting(slcSet, guiGetText(settingsEdit)) end addEventHandler("onClientGUIClick", apply, applySetting, false) ------------------------------------------------------------------------------------------------------------- --[[ of using triggerEvent I want to use 'addEventHandler' so when it apply settings all the eventhandler with "onSettingsChange" shall activate]] -- CLIENT SIDE (?) -- SECOND RESOURCE function set() if ( ex
  5. setPedAnimation(thePlayer, "ped", "seat_down", -1, false, false, false, false) The first "false" in that line above is for the loop, if you wrote it true it will activate the animation loop But if you wrote "false" it won't. But remember, the first false in this line is for the loop argument..
  6. I know I can do it that way, but what I'm asking is: I want to something like the server events and client event, I can trigger them anywhere using addEventHandler only, example, so I use "addEventHandler("onPlayerLogin", ...) not triggerEvent("onPlayerLogin", ...). So what I'm looking for I want to create a function that when it function an event handler named 'onSettingsChange' will activate.. function logins() outputChatBox("Welcome....", source) end addEventHandler("onPlayerJoin", root, logins) Here once the player join, the event handler functions right? I want to create like it
  7. Can you give me an example? I don't want to trigger the function using triggerServerEvent or triggerClientEvent, I want to trigger a function from another resource using addEventHandler.. like addEventHandler("onClientGUIClick", apply, applySetting, false) addEventHandler("onClientGUIClick", apply, onApplying, false) function applySetting() setSetting(slcSet, guiGetText(settingsEdit)) end in another resource: function set() if ( exports.settings:getSetting("setHaze") ) then setHaze( exports.settings:getSetting("setHaze") ) end end addEventHandler("onSetting
  8. https://wiki.multitheftauto.com/wiki/SetPedAnimation Check this again, in the optional arguments the 4th is named loop. Enabling or Disabling this is what you're looking for.
  9. Greetings. I've had some circumstances so I had that idea to activate an function by using a "addEventHandler", what I'm looking for is to create an Event Handler that can be used on any function like "onPlayerLogin", "onClientPlayerWeaponFire"... Is there a way to create such thing?
  10. WiBox

    RPG Time Limiter

    Nevermind, in another script that my friend added, he used once you enter a specific area you can't use your weapons and he used the event handler "onClientRender" so it seems while it was getting disable here, in my friend's script it re enable it... Thank you.
  11. WiBox

    RPG Time Limiter

    Man it's not about the way of how I wrote is wrong, it's about the "toggleControl("aim_weapon", false) isn't working only if I used "onClientRender" or 'onClientPreRender". I've tried the way you said, but it's still the same I used "print' to make sure that it's arriving to the command "toggleControl("aim_weapon", false) but that command isn't triggering... the logic of the script I wrote isn't wrong: rpgTimer = {} function shotCheck(weapon) if ( weapon == 35 or weapon == 36 ) then rpgTimer[localPlayer] = setTimer( function() toggleControl( "fire", true) toggleControl( "aim_we
  12. WiBox

    RPG Time Limiter

    I'm trying to make my scripts with no FPS drop, if I use many setTimers, won't it affect it? It worked, but isn't there a way so the player won't be able to aim with the weapon?
  13. https://wiki.multitheftauto.com/wiki/DestroyElement
  14. Depends, do you want to delete object that you created? Or you want to delete object that exists already in Gta-Sa map?
  15. Did you check the debug? If you did, can you send what it says? If you don't know what's the debug it's a command "/debugscript" use it at level 3: "/debugscript 3", it will tell you were there're warning or errors.
  16. rpgLimiter = {} function shotCheck(weapon) if ( weapon == 35 or weapon == 36 ) then rpgLimiter[localPlayer] = true setTimer( function() rpgLimiter[localPlayer] = false end, 10000, 1) toggleControl( "fire", false) toggleControl( "aim-wepaon", false) end end addEventHandler("onClientPlayerWeaponFire", localPlayer, shotCheck) function disableRPGonSwitch( privSlot, newSlot) if ( ( ( getPedWeapon( localPlayer, newSlot) == 35 ) or ( getPedWeapon( localPlayer, newSlot) == 36 ) ) and ( rpgLimiter[localPlayer] == true ) ) then
  17. 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?
  18. 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.
  19. 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 s
  20. 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
  21. So my only choice is to reload the XML file, means my only choice is the restart the script?
  22. 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...
  23. WiBox

    [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
  24. Nvm worked, I used that function, but I've forgotten to add the client script to meta.xml, silly right? Thanks anyway
  25. WiBox

    [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() '
  • Create New...