WiBox

Members
  • Content Count

    229
  • Joined

  • Last visited

Community Reputation

11 Decent

About WiBox

  • Rank
    Trick
  • Birthday 09/11/2003

Details

  • Location
    England

Recent Profile Visitors

634 profile views
  1. -- Wait my bad I forget to think about how triggerEvent works, thank you both!
  2. 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 ( exports.settings:getSetting("setHaze") ) then setHaze( exports.settings:getSetting("setHaze") ) end end addEventHandler("onSettingsChange", root, set) I gave an example like replacing onPlayerLogin with onSettingsChange, when a player logins all event handler with onPlayerLogin will activate.. I want it like that when a function activate all the handlers will activate as well... Example, in addEventHandler("onWeaponFire", ...) How does it activate? when a random weapon has fire.. of course it's a function so it checks if a random weapon has fire, when a random weapon fire, all addEventHandler('onWeaponFire"..) in all resources will activate. Isn't that right? I want to do the same thing with onSettingsChange
  3. 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..
  4. 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 but when the settings[A custom settings window I created..] change the event handler will function... If it still unclear, I want to create a function that I can trigger in another resource using addEventHandler
  5. 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("onSettingsChange", root, set) --[[ So What I need is when the function applySetting is trigger from onClientGUIClick I need to trigger " addEventHandler("onSettingsChange", root, set) " I need something like this so I don't have to use exports on each resource and add it inside the applySetting function...]]
  6. 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.
  7. 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?
  8. 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.
  9. 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_weapon", true) end, 60000, 1) toggleControl( "fire", false) toggleControl( "aim_weapon", false) end end addEventHandler("onClientPlayerWeaponFire", localPlayer, shotCheck) function disableRPGonSwitch( privSlot, newSlot) if ( ( ( getPedWeapon( localPlayer, newSlot) == 35 ) or ( getPedWeapon( localPlayer, newSlot) == 36 ) ) and ( isTimer(rpgTimer[localPlayer]) ) )then toggleControl( "fire", false) toggleControl( "aim_weapon", false) else toggleControl( "fire", true) toggleControl( "aim_weapon", true) end end addEventHandler("onClientPlayerWeaponSwitch", root, disableRPGonSwitch) But still, and plus... Do you want to laugh? function shotCheck(weapon) if ( weapon == 35 or weapon == 36 ) then toggleControl( "fire", false) toggleControl( "aim_weapon", false) end end addEventHandler("onClientPlayerWeaponFire", localPlayer, shotCheck) I've tried it like that, it should disable Aiming and firing any type of weapon, ain't I right? It didn't stop anything, RPG neither the M4... Also, I tried that way in Server-Side rpgTimer = {} function shotCheck(weapon) rpgTimer[source] = setTimer( function() toggleControl( source, "fire", false) toggleControl( source, "aim_weapon", false) end, 60000, 1) toggleControl( source, "fire", false) toggleControl( source, "aim_weapon", false) end addEventHandler("onPlayerWeaponFire", root, shotCheck) Nothing at all... So, is there a special way if using this command "toggleControl", or it should've a time because I've detected something while using it, if you use it, the RPG stop firing for 0.3seconds, the weapon aiming goes back like you're aiming horizontally... I felt like I have to activate the "toggleControl" each 0.3seconds It happend in this code: rpgTimer = {} function shotCheck(weapon) if ( weapon == 35 or weapon == 36 ) then rpgTimer[localPlayer] = setTimer( function() toggleControl( "fire", true) toggleControl( "aim_weapon", true) end, 60000, 1) toggleControl( "fire", false) toggleControl( "aim_weapon", false) end end addEventHandler("onClientPlayerWeaponFire", localPlayer, shotCheck) function disableRPGonSwitch( privSlot, newSlot) if ( ( ( getPedWeapon( localPlayer, newSlot) == 35 ) or ( getPedWeapon( localPlayer, newSlot) == 36 ) ) and ( isTimer(rpgTimer[localPlayer]) ) )then toggleControl( "fire", false) toggleControl( "aim_weapon", false) else toggleControl( "fire", true) toggleControl( "aim_weapon", true) end end addEventHandler("onClientPlayerWeaponSwitch", root, disableRPGonSwitch)
  10. 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?
  11. https://wiki.multitheftauto.com/wiki/DestroyElement
  12. Depends, do you want to delete object that you created? Or you want to delete object that exists already in Gta-Sa map?
  13. 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.
  14. WiBox

    RPG Time Limiter

    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 toggleControl( "fire", false) toggleControl( "aim-wepaon", false) else toggleControl( "fire", true) toggleControl( "aim-wepaon", true) end end addEventHandler("onClientPlayerWeaponSwitch", root, disableRPGonSwitch) I'm trying to make a limit between each RPG shots, but for some reasons when I use "onClientRender" instead of "onClientPlayerWeaponSwitch" it works...
  15. 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?