• 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 Talkaction bugged

Yaze

Well-Known Member
Joined
Sep 15, 2014
Messages
382
Reaction score
61
Hello guys, i've got no idea how to fix this im trying to find out over 1 hour now..

my talkaction script
Code:
function onSay(cid, words, param, channel)
local toPos = getCreatureLookPosition(cid) -- this function may not exists in old TFSes :/
toPos.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
local params = string.explode(param, ",")
local price = params[1]
table.remove(params, 1)
local desc = table.concat(params,",")
local name = ''
local item1 = getThingFromPos(toPos)
local itemid1 = item1.itemid
local count1 = item1.type
local itemid2 = 0
local count2 = 0

if(itemid1 == 0 or isCreature(item1.uid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "There is no moveable item in front of you or there is creature.")
return true
end
if(not price) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You must set price.")
return true
end
price = tonumber(price)
local itemInfo = getItemInfo(itemid1)
local offer_type = 'item'
if(isContainer(item1.uid)) then
local item2 = getContainerItem(item1.uid, 0)
if(item2.itemid > 0) then
count1 = getContainerCap(item1.uid)
itemid2 = item2.itemid
count2 = item2.type
offer_type = 'container'
itemInfo = getItemInfo(itemid2)
end
end
local count1_desc = (count1 > 0) and count1 or 1
local count2_desc = (count2 > 0) and count2 or 1
if(itemid2 == 0) then
name = count1_desc .. 'x ' .. itemInfo.name
else
name = count1_desc .. 'x ' .. count2_desc .. 'x ' .. itemInfo.name
end
db.executeQuery('INSERT INTO `z_shop_offer` (`id` ,`points` ,`itemid1` ,`count1` ,`itemid2` ,`count2` ,`offer_type` ,`offer_description` ,`offer_name`) VALUES (NULL , ' .. price .. ', ' .. itemid1 .. ', ' .. count1 .. ', ' .. itemid2 .. ', ' .. count2 .. ', \'' .. offer_type .. '\', ' .. db.escapeString(desc) .. ', ' .. db.escapeString(name) .. ');')
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Item >> " .. name .. " << added to SMS shop. Price is " .. price .. " premium points.")
return true
end

When i add items to shop they actually goes well, the images are working aswell but , at some items like "8.6" items the pictures are bugged..

http://gyazo.com/07d2052ab3d4808800ab69b9859bf181

here you can see.. How to fix that these items will be right aswell?
 
Theres no error, i can add items to shop, but some items get wrong picture..
as you see in the link i posted.
 
Theres no ".jpg" or ".gif" in my shopsystem.php
i did search with ctrl+f, cant find it

:/
 
Last edited by a moderator:
I did try it myself aswell, didnt worked xd werid :/

grr
 
Last edited by a moderator:
What version are you using? Over 860 go with 960 otherwise 860.
If you are using 860, you most likely have a bugged otb file(read wrong).
There was like 3 diffrent versions, one from the tfs team, one from RME and one more I think..

I think gesior used the tfs one, so you have to extract the images from your otb if you want the correct ones on your website.
He told me how to do this a long time ago but can't remember, you might be able to find some info on his websites or send him a pm.
 
This happens because the item you add in the shop uses an ItemID which the image server got another item for, this results in wrong image.

You can make an own folder on your website with the right images for the items and change the config's image url.
http://otland.net/threads/geisor-aac-donation-images.184255/

How i change the path to /home/otsmanager/www/public_html/item_images then? if i just
do like

Code:
$config['site']['outfit_images_url'] = 'http://outfit-images.ots.me/outfit.php';
$config['site']['item_images_url'] = '/home/otsmanager/www/public_html/item_images/';
$config['site']['item_images_extension'] = '.gif';
$config['site']['flag_images_url'] = 'http://flag-images.ots.me/';
$config['site']['flag_images_extension'] = '.png';
it dont work
 
How i change the path to /home/otsmanager/www/public_html/item_images then? if i just
do like

Code:
$config['site']['outfit_images_url'] = 'http://outfit-images.ots.me/outfit.php';
$config['site']['item_images_url'] = '/home/otsmanager/www/public_html/item_images/';
$config['site']['item_images_extension'] = '.gif';
$config['site']['flag_images_url'] = 'http://flag-images.ots.me/';
$config['site']['flag_images_extension'] = '.png';
it dont work
Use your IP/domain, not the server path to the images.

http://example.com/item_images/
 
I fixed it for you before nub, you should find item_images with all your shop offer thingies fixed in your web files if you didn't delete them lol

PS: that's not a talkaction bug
 
Back
Top