Jump to content

Alpha weapon


Ascla

Recommended Posts

Posted

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,

560x95.png
Posted
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.

560x95_FFFFFF_FF9900_000000_000000.png

Posted
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
Posted (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 by Guest

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted

Anderl, it's an error :P

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 

560x95.png
Posted

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

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