Jump to content

setElementData as a table .


PaiN^

Recommended Posts

setElementData ( source, 'WeaponsSelection', { 
                                            ['w1'] = a1, 
                                            ['w2'] = a2, 
                                            ['w3'] = a3 
                                                } ) 
  
local packeg = getElementData ( source, 'WeaponsSelection' ) 
if packeg then 
    for k,v in next, packeg do 
        giveWeapon ( source, tonumber( k ), v ) 
        giveWeapon ( source, tonumber( k ), v ) 
        giveWeapon ( source, tonumber( k ), v ) 
    end 
else 
    outputChatBox ( 'dsadsad', source ) 
end 

w1, w2, w3 = are defined as weapon id's

a1, a2, a3 = are defined as ammo ( int values )

WARNING: ***:42: Bad argument @ 'giveWeapon' [Expected weapon-type at argument 2, got nil]

* Note : I use the w1, w2, a1, a2 ... some where else in the script, And it works, It don't work when i try to get it from the element data !

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