ZORAM
New Member
- Joined
- Aug 6, 2013
- Messages
- 27
- Reaction score
- 0
Hello Guys,
I have a script of a weapon, that uses ammo, and i get a error in console because this function.
Here my script:
>> actions.xml
Actions > script > new2.lua
ScreenShot Error:
I thank for Help, and with be God!
I have a script of a weapon, that uses ammo, and i get a error in console because this function.
Code:
getItemNameById(item.itemid)
Here my script:
>> actions.xml
Code:
<actionitemid="8927"script="new2.lua"/>
Actions > script > new2.lua
Code:
function onUse(cid, item, frompos, item2, topos)
local config = {
storageativ = 76650, -- storage que será utilizado
ammo = 1294 --- id do item que será a munição.
}
if getPlayerStorageValue(cid, config.storageativ) > 0 then
setPlayerStorageValue(cid, config.storageativ, 0)
doPlayerSendTextMessage(cid, 19, "You desactivated your "..getItemNameById(item.itemid)..", you're no longer attacking in area!")
elseif getPlayerStorageValue(cid, config.storageativ) <= 0 then
setPlayerStorageValue(cid, config.storageativ, 1)
doPlayerSendTextMessage(cid, 19, "You activated your "..getItemNameById(item.itemid)..", now you'll attack in area for the price of a "..getItemNameById(config.ammo).."!")
end
return true
end
ScreenShot Error:
I thank for Help, and with be God!