Lua onUseWeapon(cid, var) HELP!!!!!

pablobion

New Member
Joined
Aug 31, 2016
Messages
39
Best answers
1
Reaction score
3
Hi Everybody.

My Question is this: ¿This function have the parameter of the item that is being used by the player?

and if it is correct, ¿How ca i use it? (as actions: ¿¿¿onUse(cid,item)???)

Thanks for ur Time!

\/

function onUseWeapon(cid, var)

local nameitem = getItemName(????var??????)
return true
end
 

Sarah Wesker

ค∂vαηcε รүηтαx ❤
Joined
Mar 16, 2017
Messages
453
Best answers
41
Reaction score
271
Location
London
var is the variant of the spell, only have some variables, per example: var = { type, text, pos, number }
 
OP
P

pablobion

New Member
Joined
Aug 31, 2016
Messages
39
Best answers
1
Reaction score
3
How do I work out what I want to do?



function onUseWeapon(cid, var)

local nameitem = getItemName(???????)
return true
end
 
OP
P

pablobion

New Member
Joined
Aug 31, 2016
Messages
39
Best answers
1
Reaction score
3
var is the variant of the spell, only have some variables, per example: var = { type, text, pos, number }
How do I work out what I want to do?



function onUseWeapon(cid, var)

local nameitem = getItemName(???????)
return true
end
 

Sarah Wesker

ค∂vαηcε รүηтαx ❤
Joined
Mar 16, 2017
Messages
453
Best answers
41
Reaction score
271
Location
London
TFS 0.4
Code:
getPlayerWeapon(cid[, ignoreAmmo = false])
per example:
Code:
local weapon = getPlayerWeapon(cid)
local name = getItemAttribute(weapon.uid, ITEM_ATTRIBUTE_NAME) or getItemInfo(weapon.itemid).name
 
OP
P

pablobion

New Member
Joined
Aug 31, 2016
Messages
39
Best answers
1
Reaction score
3
TFS 0.4
Code:
getPlayerWeapon(cid[, ignoreAmmo = false])
per example:
Code:
local weapon = getPlayerWeapon(cid)
local name = getItemAttribute(weapon.uid, ITEM_ATTRIBUTE_NAME) or getItemInfo(weapon.itemid).name
Thanks!!! <3 <3
 
Top