Compa Posted February 10, 2013 Share 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? Link to comment
PaiN^ Posted February 10, 2013 Share 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 Link to comment
Compa Posted February 10, 2013 Author Share Posted February 10, 2013 That doesn't work. I'm using a commandhandler addCommandHandler("testing", disablepickups) Link to comment
iPrestege Posted February 10, 2013 Share 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) Link to comment
HunT Posted February 10, 2013 Share Posted February 10, 2013 Can u use my pickup manager here : viewtopic.php?f=108&t=50029 Link to comment
Compa Posted February 10, 2013 Author Share 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 Link to comment
iPrestege Posted February 10, 2013 Share Posted February 10, 2013 Np. Just Do What Hunterix Say On This Topic : viewtopic.php?f=108&t=50029 . Link to comment
PaiN^ Posted February 10, 2013 Share Posted February 10, 2013 Np. Just Do What Hunterix Say On This Topic : viewtopic.php?f=108&t=50029 . +1 Link to comment
Castillo Posted February 10, 2013 Share Posted February 10, 2013 No, because Hunterix script disables them, Compa wants to remove them. Link to comment
PaiN^ Posted February 10, 2013 Share Posted February 10, 2013 So, Can you do the script Solidsnake ? I really wan to know how Link to comment
Compa Posted February 10, 2013 Author Share Posted February 10, 2013 Thanks for helping Solidsnake! Top scripter! @Mr.alm he already made a function for me. Link to comment
50p Posted February 10, 2013 Share 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. Link to comment
Castillo Posted February 10, 2013 Share Posted February 10, 2013 That doesn't work, the pickups are created client side on a table. Link to comment
50p Posted February 10, 2013 Share 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. Link to comment
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