• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

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

pablobion

New Member
Joined
Aug 31, 2016
Messages
39
Best answers
1
Reaction score
4
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
514
Best answers
46
Reaction score
327
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
4
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
4
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
514
Best answers
46
Reaction score
327
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
4
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