Compa Posted February 10, 2013 Posted February 10, 2013 Hey Guys, I'm trying to disable pick-ups but it isn't working function disablepickups() pickups = getElementsByType("repair") for i,v in ipairs(pickups) do destroyElement(v) end end Does someone know i'm doing wrong here?
PaiN^ Posted February 10, 2013 Posted February 10, 2013 Try this one : function ( ) if ( getElementType ( source ) == "repair" ) then for _,v in ipairs ( getElementsByType ( source ) ) do destroyElement ( source ) end end end " Keep Thinking Different . " - Steve Jops -------------------- Don't send me PMs asking for help, I Won't reply !
Compa Posted February 10, 2013 Author Posted February 10, 2013 That doesn't work. I'm using a commandhandler addCommandHandler("testing", disablepickups)
iPrestege Posted February 10, 2013 Posted February 10, 2013 That doesn't work.I'm using a commandhandler addCommandHandler("testing", disablepickups) function disablepickups(repair) if (getElementsByType(repair) == "pickup") then for _,v in ipairs(repair) do destroyElement(v) end end end addCommandHandler("testing", disablepickups)
HunT Posted February 10, 2013 Posted February 10, 2013 Can u use my pickup manager here : viewtopic.php?f=108&t=50029 @Huntone_
Compa Posted February 10, 2013 Author Posted February 10, 2013 (edited) @prestege Thanks, but it still doesn't work here. Can u use my pickup manager here : viewtopic.php?f=108&t=50029 Is there a solution without replacing race functions? My goal is btw to remove the pickups when i use the command. Edited February 10, 2013 by Guest
iPrestege Posted February 10, 2013 Posted February 10, 2013 Np. Just Do What Hunterix Say On This Topic : viewtopic.php?f=108&t=50029 .
PaiN^ Posted February 10, 2013 Posted February 10, 2013 Np. Just Do What Hunterix Say On This Topic : viewtopic.php?f=108&t=50029 . +1 " Keep Thinking Different . " - Steve Jops -------------------- Don't send me PMs asking for help, I Won't reply !
Castillo Posted February 10, 2013 Posted February 10, 2013 No, because Hunterix script disables them, Compa wants to remove them. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
PaiN^ Posted February 10, 2013 Posted February 10, 2013 So, Can you do the script Solidsnake ? I really wan to know how " Keep Thinking Different . " - Steve Jops -------------------- Don't send me PMs asking for help, I Won't reply !
Compa Posted February 10, 2013 Author Posted February 10, 2013 Thanks for helping Solidsnake! Top scripter! @Mr.alm he already made a function for me.
50p Posted February 10, 2013 Posted February 10, 2013 function disablepickups(_,_,pickupType) local racePickups = getElementsByType( "racepickup" ); for _,v in ipairs(racePickups) do if getElementData( v, "type" ) == pickupType then -- skip this statement if you want to remove all race pickups destroyElement(v) end end end addCommandHandler("testing", disablepickups) -- /testing repair EDIT: Sorry, haven't read your last post. - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
Castillo Posted February 10, 2013 Posted February 10, 2013 That doesn't work, the pickups are created client side on a table. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
50p Posted February 10, 2013 Posted February 10, 2013 Right, not used to race resource but just checked it and it seems only dummy elements are server-side and pickups themselves are not actual pickups but models with colshape around them. - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
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