Jump to content

CreateDeath Pickup Bugged ?


Max+

Recommended Posts

Posted

Hi Guys i tryed make a pick show after player die a weapon pick up if any player take it it go and give him ammo ,

i killed my self and no pick up showing ,

function destroyDeathPickup ( pickup ) 
    if ( isElement ( pickup ) ) then 
        removeEventHandler ( "onPickupUse", pickup) 
        destroyElement ( pickup ) 
    end 
end 
  
addEventHandler ( "onPlayerWasted", root, 
    function ( ) 
        local timeout = 60000 
        local x, y, z = getElementPosition ( source ) 
        local currentweapon = getPedWeapon ( source ) 
        local totalammo = getPedTotalAmmo ( source ) 
        local pickup = createPickup ( x, y, z, 2, currentweapon, 50, totalammo ) 
        addEventHandler ( "onPickupUse", pickup, onDeathPickupHit ) 
        setTimer( destroyDeathPickup, timeout, 1, pickup ) 
    end 
) 

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Posted

There are no errors/warnings?

local pickup = createPickup ( x, y, z, 2, currentweapon, 50, totalammo ) 

You got respawn set at 50ms, that's a little bit low, don't you think? If you want the weapon to be spawned only once, use 60000 as your timeout is.

Lua Scripter

?ucet=miki_cz

Owner of mshost.cz MTA portal.

Posted

i didn't understand you , what you mean ?

i Need if i kill player create Pickup weapons , every time i kill a plyer ,

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Posted

so any attempt to help me ?

and it dosn't show any errors ,

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Posted

Please Some one Help Me littel bit ,

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Posted

Try replacing 50 in createPickup by your timeout variable.

"The total IQ of the world is a constant.

The more people, the more idiots."

- Anonymous.

Posted

and what's the time out .. whatever ?

i simply need to make if player die create pick up weapon that's all ,

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Posted

Server :

addEventHandler ( 'onPlayerWasted', root, 
    function ( attacker ) 
        if attacker and attacker ~= source then 
            local weapon = getPedWeapon ( source ); 
            local ammo = getPedTotalAmmo ( source ); 
            if weapon == 0 then return end; 
            if ammo == 0 then return end; 
            local x, y, z = getElementPosition ( source ); 
            createPickup ( x, y, z, 2, weapon, _, ammo ); 
        end 
    end  
); 

" Keep Thinking Different . " - Steve Jops

--------------------

Don't send me PMs asking for help, I Won't reply !

Posted

1. You add function onDeathPickupHit to event handler but this function does not exist.

2. removeEventHandler requires a function handle to be removed.

As mentioned before, try to change the respawn time of the pickup to something higher. It doesn't really matter how long because you may want to destroy it once a player hits it or timer will destroy it.

Posted

Ok Thank's Adam ,

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

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...