• 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!

CREATE ITEM WITH CUSTOM NAME BESIDE CHARACTER!!! and if itemName contains playerName

Blood BlvD Ot

Member
Joined
Jun 12, 2010
Messages
243
Reaction score
7
hey I need to know a way around this, I'm pretty sure its easy and possible.

I need to know the command for:

doCreateItem(............

create item with custom name of:

local crateName = " " .. getPlayerName .. " 's Crate "
local itemID =

and place the item beside character.

--------------------------------------------------------
AND I also need to know this :

if itemName contains playerName then.
doPlayerAddItem(cid...blablabla...
----------------------------------------------
If you could help you will be my bestiee ;) Tanxxx
 
Idk man :p
Try this probably:
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
ppos = getPlayerPosition(cid)
name = getPlayerName(cid)
local t = {
[0] = {x = ppos(cid).x, y = ppos(cid).y-1, z = ppos(cid).z},
[1] = {x = ppos(cid).x-1, y = ppos(cid).y, z = ppos(cid).z},
[2] = {x = ppos(cid).x, y = ppos(cid).y+1, z = ppos(cid).z},
[3] = {x = ppos(cid).x+1, y = ppos(cid).y, z = ppos(cid).z}
}
 
for k, v in pairs(t) do
    if getPlayerDirection(cid) == k then
       doItemSetAttribute(doCreateItem(xxxx,1,v[1]), 'name', name)
    end
return true
end
end
 
already did, that script completly doesn't work even from the begginning xD
theres something wrong with ur whole positioning thingys.

i'm guessing ppos(cid) is reading as
getPlayerPosition(cid)(cid) 2x cids?
 
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
ppos = getPlayerPosition(cid)
name = getPlayerName(cid)
local t = {
[0] = {x = ppos.x, y = ppos.y-1, z = ppos.z},
[1] = {x = ppos.x-1, y = ppos.y, z = ppos.z},
[2] = {x = ppos.x, y = ppos.y+1, z = ppos.z},
[3] = {x = ppos.x+1, y = ppos.y, z = ppos.z}
}
 
for k, v in pairs(t) do
    if getPlayerDirection(cid) == k then
       doItemSetAttribute(doCreateItem(xxxx,1,v[1]), 'name', name)
    end
return true
end
end

Post errors if there are too.
 
[09/12/2010 20:16:34] [C]: in function 'doCreateItem'
[09/12/2010 20:16:34] data/talkactions/scripts/scriptTest.lua:13: in function <data/talkactions/scripts/scriptTest.lua:1>

-----------------------------------------------------------------------------------

function onSay(cid, item, fromPosition, itemEx, toPosition)
local ppos = getPlayerPosition(cid)
local name = getPlayerName(cid)
local t = {
[0] = {x = ppos.x, y = ppos.y-1, z = ppos.z},
[1] = {x = ppos.x-1, y = ppos.y, z = ppos.z},
[2] = {x = ppos.x, y = ppos.y+1, z = ppos.z},
[3] = {x = ppos.x+1, y = ppos.y, z = ppos.z}
}

for k, v in pairs(t) do
if getPlayerLookDir(cid) == k then
doItemSetAttribute(doCreateItem(xxxx,1,v[1]), 'name', name)
end
return true
end
end
-----------------------------------------
I fixed some of your commands.
 
function onSay(cid, item, fromPosition, itemEx, toPosition)
?? lol :p
If it doesnt work, Im sorry bro, Im not good enough for it, Cyko can do this for sure, or Cyber
 
Ok , well thanks :), I found a way around this :P.
Thanks for the effort Repp++

I'll just have to use a storage I guess =/.


local pos = getPlayerPosition(cid)
local dropZone = {x = pos.x+1, y = pos.y, z = pos.z, stackpos=1}
local name = getPlayerName(cid)
if pos == pos then
doCreateItem(1740,1,dropZone)
end
return true
end

DUDE OMFG!!! I DON'T KNOW HOW I FIGURED THIS OUT :D!!!! CHECK IT :P

Code:
 function setItemName(uid,name)
		return doItemSetAttribute(uid,'name',name)
    end
function onSay(cid, words, param, channel, item, itemEx)
local pos = getPlayerPosition(cid)
local dropZone = {x = pos.x+1, y = pos.y, z = pos.z, stackpos=1}
local playerName = getPlayerName(cid)
local crateName = " " .. getPlayerName(cid) .. "'s Crate"
	if pos == pos then
		setItemName(doCreateItem(1740,1,dropZone),crateName)
    end
return true
end
 
Last edited by a moderator:
@CyberM: I see whut u did thar...

LUA:
function onSay(cid, words, param, channel, item, itemEx)
Forgot slot, position, moveItem, tileItem, var, interval, target, isAggressive, openBox, current, users...
 
Last edited:
Back
Top