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
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
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
Castillo Posted February 10, 2013 Posted February 10, 2013 No, because Hunterix script disables them, Compa wants to remove them.
PaiN^ Posted February 10, 2013 Posted February 10, 2013 So, Can you do the script Solidsnake ? I really wan to know how
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.
Castillo Posted February 10, 2013 Posted February 10, 2013 That doesn't work, the pickups are created client side on a table.
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.
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