Jump to content

[Help] Pickups


[MTA]Weed

Recommended Posts

Hello, anyone got any idea whats wrong with my pickup, everything working well and pickups should respawn by the time given in .map

and its working very well for the armor and health pickup, they respawn at the interval they should, but not same as weapons, the dont respawn never, you pick once and they are gone.

    pickupTable[source] = {}
    
    for i, p in ipairs(tempMapTable[source].DMpickup) do
        
        local pickup
        
        if p.typ == "health" then 
            pickup = createPickup ( p.posX, p.posY, p.posZ, 0, p.amount, p.respawn)
        elseif p.typ == "armor" then 
            pickup = createPickup ( p.posX, p.posY, p.posZ, 1, p.amount, p.respawn)
        else
            pickup = createPickup ( p.posX, p.posY, p.posZ, 2, tonumber(p.typ), p.respawn, p.amount)

        end
    
        setElementInterior(pickup, p.interior)
        setElementDimension(pickup, getElementDimension(source))
        table.insert(pickupTable[source], pickup)
        
    end
    

end


this should be for the weapon pickups: 

            pickup = createPickup ( p.posX, p.posY, p.posZ, 2, tonumber(p.typ), p.respawn, p.amount)

 

Link to comment
  • Moderators

I never said that you have to look at your debug console. The only thing I did, was give you a link which you can use to check what is going on with your pick-ups. Which is ALSO debugging. Make use of it, or smoke yourself and do not.

 

 

 

 

  • Haha 1
Link to comment
  • Moderators

I am very sorry to say this, but your creativity skills are lower than zero... Because of the weed? O.o

 

Well here you are! Show me what you are made of!

-- serverside
addCommandHandler("checkPickups",
function ()
	local pickups = getElementsByType ( "pickup")
	for i=1, #pickups do
		local pickup = pickups[i]
		if getPickupType ( pickup ) == 2 then -- weapon pickup
			local respawnInterval = getPickupRespawnInterval ( pickup )
			iprint("RespawnInterval:", respawnInterval)
		end
	end
end)

 

 

  • Like 2
  • Haha 1
Link to comment
  • Moderators
1 hour ago, [MTA]Weed said:

@IIYAMA

the problem was in another resource which was not allowing the pickups to respawn, thanks.

topic can be closed. thanks @IIYAMA for ur time.

 

I apologies for my out of placed joke. But I am glad you figured it out with or without my help. :P

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...