• 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 Give backpack full of itens

R0Dr1g0

New Member
Joined
Jan 25, 2009
Messages
11
Reaction score
0
Well the VIP Players of my server will have one command that will make one BP of MP or HP appear

I Only made the Sorcerer kit at the moment but when im test nothing happens

Look the code
Code:
function onSay(cid, words, param)
local playerVoc = getPlayerVocation(cid)
	if playervoc == 1 then
		buyContainer(cid,2000,7618,1,0)
		buyContainer(cid,2002,7590,1,0)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você pegou seu Kitvip (Sorcerer).")
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "AVISO:Não use em batalha ou será punido!")
		doPlayerSay(cid,"Peguei meu KITVIP(Sorcerer)", TALKTYPE_ORANGE_1)

	end

end
I'm using TFS 0.2.7
 
edit Data/talkactions/talkactions.xml
Code:
<talkaction words="!bpofvip" event="script" value="bpofvip.lua"/>



add bpofvip.lua to Data/talkactions/scripts/

Code:
function onSay(cid, words, param)
local playerVoc = getPlayerVocation(cid)
	if playervoc == 1 then
		buyContainer(cid,2000,7618,1,0)
		buyContainer(cid,2002,7590,1,0)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você pegou seu Kitvip (Sorcerer).")
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "AVISO:Não use em batalha ou será punido!")
		doPlayerSay(cid,"Peguei meu KITVIP(Sorcerer)", TALKTYPE_ORANGE_1)

	end

end
 
edit Data/talkactions/talkactions.xml
Code:
<talkaction words="!bpofvip" event="script" value="bpofvip.lua"/>



add bpofvip.lua to Data/talkactions/scripts/

Code:
function onSay(cid, words, param)
local playerVoc = getPlayerVocation(cid)
	if playervoc == 1 then
		buyContainer(cid,2000,7618,1,0)
		buyContainer(cid,2002,7590,1,0)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você pegou seu Kitvip (Sorcerer).")
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "AVISO:Não use em batalha ou será punido!")
		doPlayerSay(cid,"Peguei meu KITVIP(Sorcerer)", TALKTYPE_ORANGE_1)

	end

end

Sorry still don't working
 
Try this one i edited.

Add in Talkactions.xml

PHP:
<talkaction words="!bpofvip" event="script" value="bpofvip.lua"/>

Add in Talkactions\Scripts\bpofvip.lua

PHP:
function onSay(cid, words, param)
local playervoc = getPlayerVocation(cid)
	if playervoc == 1 then   --Depending in your vocations.xml--
		doPlayerAddItem(cid,2000,7618,1,0)
		doPlayerAddItem(cid,2002,7590,1,0)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You got your Kitvip (Sorcerer).")
		doPlayerSay(cid,"I got my KITVIP (Sorcerer).", TALKTYPE_ORANGE_1)
		else 
		    doPlayerSendCancel(cid, "You're not a sorcerer.")
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
	end
end
 
Last edited:
Try this one i edited.

Add in Talkactions.xml

PHP:
<talkaction words="!bpofvip" event="script" value="bpofvip.lua"/>

Add in Talkactions\Scripts\bpofvip.lua

PHP:
function onSay(cid, words, param)
local playervoc = getPlayerVocation(cid)
	if playervoc == 1 then   --Depending in your vocations.xml--
		doPlayerAddItem(cid,2000,7618,1,0)
		doPlayerAddItem(cid,2002,7590,1,0)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You got your Kitvip (Sorcerer).")
		doPlayerSay(cid,"I got my KITVIP (Sorcerer).", TALKTYPE_ORANGE_1)
		else 
		    doPlayerSendCancel(cid, "You're not a sorcerer.")
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
	end
end

Well we have a progress,but i'm the messages don't arrive in console and the player don't send the message that he picked his kitvip.
And we got a lot of backpacks inside backpacks

EDIT:

I Switched the parameters and i'm got potions but no backpack,and looking at the documentation i readed the parameters
doPlayerAddItem(uid, itemid, <optional> count/subtype)
and there is no parameter to point the backpack
 
Last edited:
Back
Top