• 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

Member
Joined
Aug 31, 2016
Messages
39
Solutions
1
Reaction score
5
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
 
Solution
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
How do I work out what I want to do?



function onUseWeapon(cid, var)

local nameitem = getItemName(???????)
return true
end
 
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
 
Solution
Back
Top