Ascla Posted March 12, 2013 Posted March 12, 2013 Hey guys, I've a problem, I want to make a invisible just a weapon. I try : local weapon= giveWeapon ( thePlayer, 24, 100 ) if (arme) then setElementAlpha ( weapon, 0 ) end But "setElementAlpha" not found the element. Thanks,
-ffs-Sniper Posted March 12, 2013 Posted March 12, 2013 bool giveWeapon ( ped thePlayer, int weapon [, int ammo=30, bool setAsCurrent=false ] ) GiveWeapon does not return an element. Instead the function returns whether the weapon has been created (true or false). As there isn't any weapon element this is currently not possible by using setElementAlpha. At last you could try an invisible weapon model.
Anderl Posted March 12, 2013 Posted March 12, 2013 Hey guys,I've a problem, I want to make a invisible just a weapon. I try : local weapon= giveWeapon ( thePlayer, 24, 100 ) if (arme) then setElementAlpha ( weapon, 0 ) end But "setElementAlpha" not found the element. Thanks, Where are 'arme' and 'thePlayer' declared? "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
Moderators IIYAMA Posted March 12, 2013 Moderators Posted March 12, 2013 (edited) You can only set element alpha to custom weapons. Not with (onhand)weapons, they aren't elements. Can only be done by mods. Edited March 12, 2013 by Guest Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Ascla Posted March 12, 2013 Author Posted March 12, 2013 Anderl, it's an error function taser (thePlayer) local arme = giveWeapon ( thePlayer, 24, 100 ) if (arme) then setElementAlpha ( arme, 0 ) triggerClientEvent(thePlayer, "avoiruntazer", getRootElement(), thePlayer, taser) --attachElements ( taser, thePlayer, 0.2, 0, 1,180,0,0) end end
Anderl Posted March 12, 2013 Posted March 12, 2013 Ok, so.. Read what guys said above "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
Ascla Posted March 12, 2013 Author Posted March 12, 2013 Yes but this is a problem for me, because I want create a tazer without replacing one weapon in the game
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