3HAXAPb94 Posted October 24, 2013 Share 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) Link to comment
Tete omar Posted October 24, 2013 Share Posted October 24, 2013 What are you trying to do? Link to comment
3HAXAPb94 Posted October 24, 2013 Author Share Posted October 24, 2013 I want destroy pickup. with model 1242 (armor) Link to comment
Tete omar Posted October 24, 2013 Share 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.. Link to comment
3HAXAPb94 Posted October 24, 2013 Author Share Posted October 24, 2013 Tete, its doesnt work... Link to comment
3HAXAPb94 Posted October 24, 2013 Author Share Posted October 24, 2013 I want work with this pickup as element. Destroy element it just for example (for test). Link to comment
Tete omar Posted October 24, 2013 Share 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) Link to comment
3HAXAPb94 Posted October 24, 2013 Author Share 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) Link to comment
Tete omar Posted October 24, 2013 Share 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. Link to comment
3HAXAPb94 Posted October 24, 2013 Author Share Posted October 24, 2013 Thanks.. Now I need make custom pickup for using? Link to comment
denny199 Posted October 24, 2013 Share 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. Link to comment
3HAXAPb94 Posted October 24, 2013 Author Share 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 Link to comment
3HAXAPb94 Posted October 24, 2013 Author Share Posted October 24, 2013 So now I have new Question. How to make new racepickup? Link to comment
Castillo Posted October 25, 2013 Share Posted October 25, 2013 See how the current ones are made, and then do the same. Link to comment
3HAXAPb94 Posted October 25, 2013 Author Share Posted October 25, 2013 For my gamemode not need all race pickups just need one racepickup. I will use "repair" 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