3HAXAPb94 Posted October 24, 2013 Posted October 24, 2013 This function not work I dont know how to fix it... function pic() for i,pickup in pairs(getElementsByType("pickup")) do local elementID = getElementModel(pickup) if elementID == 1242 then destroyElement (pickup) end end end addEventHandler("onClientResourceStart",resourceRoot,pic)
3HAXAPb94 Posted October 24, 2013 Author Posted October 24, 2013 I want destroy pickup. with model 1242 (armor)
Tete omar Posted October 24, 2013 Posted October 24, 2013 function pic ( ) for i, pickup in ipairs ( getElementsByType ( "pickup" ) ) do if ( getPickupType ( pickup ) == 1 ) then destroyElement ( pickup ) end end end addEventHandler( "onClientResourceStart", resourceRoot, pic ) Use this if you want to destroy all armour pickups..
3HAXAPb94 Posted October 24, 2013 Author Posted October 24, 2013 I want work with this pickup as element. Destroy element it just for example (for test).
Tete omar Posted October 24, 2013 Posted October 24, 2013 function pic ( ) for i, pickup in ipairs ( getElementsByType ( "pickup" ) ) do if ( getPickupType ( pickup ) == 3 ) and ( getElementModel ( pickup ) == 1242 ) then destroyElement ( pickup ) end end end addEventHandler ( "onClientResourceStart", resourceRoot, pic ) This should work i guess (P.S. Make sure you pasted it on clientside)
3HAXAPb94 Posted October 24, 2013 Author Posted October 24, 2013 Tete, I tested again and this code worked if I createPickup in script. But it doesnt work in map.(if created custom map)
Tete omar Posted October 24, 2013 Posted October 24, 2013 If you're using race maps, then you cannot get race pickups this way, because race pickups are not mta built-in elements, there must be a certain way to get them, you can find this out by reading race lua files.
3HAXAPb94 Posted October 24, 2013 Author Posted October 24, 2013 Thanks.. Now I need make custom pickup for using?
denny199 Posted October 24, 2013 Posted October 24, 2013 Try to use a command handler, and check after the map is loaded if it will destroy, because the map might not be loaded yet on the client's pc.
3HAXAPb94 Posted October 24, 2013 Author Posted October 24, 2013 Thanks. But I now know how I need make. It was be wrong with make createPickup. Now I need make looks like racepickup... Now looking code in race how to make racepickup
3HAXAPb94 Posted October 24, 2013 Author Posted October 24, 2013 So now I have new Question. How to make new racepickup?
Castillo Posted October 25, 2013 Posted October 25, 2013 See how the current ones are made, and then do the same.
3HAXAPb94 Posted October 25, 2013 Author Posted October 25, 2013 For my gamemode not need all race pickups just need one racepickup. I will use "repair"
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