Cassandra Posted February 25, 2013 Posted February 25, 2013 Is there a way to fix that? Regards, Cassandra - V:MP
Jaysds1 Posted February 25, 2013 Posted February 25, 2013 Ya, you could set the pickup respawn to 0 to make it respawn right after. Using: setPickupRespawnInterval My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
Cassandra Posted February 25, 2013 Author Posted February 25, 2013 Ya, you could set the pickup respawn to 0 to make it respawn right after.Using: setPickupRespawnInterval Aren't there are any alternatives for that? To make a pickup not pickable. Regards, Cassandra - V:MP
Jaysds1 Posted February 25, 2013 Posted February 25, 2013 you could cancel one of the pickup's events: https://wiki.multitheftauto.com/wiki/Ser ... kup_events Example: addEventHandler("onPickupHit",root,function() cancelEvent() end) My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
Cassandra Posted February 25, 2013 Author Posted February 25, 2013 you could cancel one of the pickup's events: https://wiki.multitheftauto.com/wiki/Ser ... kup_eventsExample: addEventHandler("onPickupHit",root,function() cancelEvent() end) Thanks. It works fine now. Regards, Cassandra - V:MP
Jaysds1 Posted February 25, 2013 Posted February 25, 2013 np My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
Anderl Posted February 26, 2013 Posted February 26, 2013 Not a good idea, that will cancel the event from being called thus stopping any event triggered when an element hits a pickup. "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
Moderators IIYAMA Posted February 26, 2013 Moderators Posted February 26, 2013 I reply this because of andrel his reply. Maybe you want this. addEventHandler("onPickupHit",root,function(player) local theType = getPickupType ( source ) if theType == 2 then giveWeapon ( player, getPickupWeapon ( source ), getPickupAmmo ( source ), false ) elseif theType == 1 then setPedArmor ( player, getPedArmor ( player ) + getPickupAmount ( source )) elseif theType == 0 then setElementHealth ( player,getElementHealth ( player) + getPickupAmount ( source )) end cancelEvent() end) -- the maximum health is 200 and only able to reach that with full skill level. It will probably set to the highest possible health(depends on the skill level). (armor is 100) Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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