Max+ Posted April 12, 2013 Posted April 12, 2013 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
MIKI785 Posted April 12, 2013 Posted April 12, 2013 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 Owner of mshost.cz MTA portal.
Max+ Posted April 13, 2013 Author Posted April 13, 2013 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
Max+ Posted April 13, 2013 Author Posted April 13, 2013 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
Max+ Posted April 14, 2013 Author Posted April 14, 2013 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
Puma Posted April 14, 2013 Posted April 14, 2013 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.
Max+ Posted April 14, 2013 Author Posted April 14, 2013 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
PaiN^ Posted April 14, 2013 Posted April 14, 2013 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 !
50p Posted April 14, 2013 Posted April 14, 2013 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. - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
Max+ Posted April 14, 2013 Author Posted April 14, 2013 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
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