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

TFS 0.3.4pl2 Actions Voc Quest

Lukanio

### Own3D ###
Joined
Nov 25, 2008
Messages
325
Reaction score
6
Script don't work
PHP:
function onUse(cid, item, frompos, item2, topos)
local vocation = getPlayerVocation(cid)

   	if item.uid == 7001 then
            if(isDruid or isSorcerer and getPlayerStorageValue(cid,7001) == -1) then
   			doPlayerAddItem(cid,2323,1)
   			doPlayerAddItem(cid,8870,1)
   			doPlayerAddItem(cid,7457,1)
   			setPlayerStorageValue(cid,7001,1)
            else
   			doPlayerSendTextMessage(cid,22,"To jest puste.")
end
           elseif(isKnight or isPaladin and getPlayerStorageValue(cid,7001) == -1) then
   			doPlayerAddItem(cid,2491,1)
   			doPlayerAddItem(cid,2477,1)
   			doPlayerAddItem(cid,2476,1)
   			doPlayerAddItem(cid,7457,1)
   			setPlayerStorageValue(cid,7001,1)
            else
   			doPlayerSendTextMessage(cid,22,"To jest puste.")
		end
end


   	 if item.uid == 7002 then
         if(isDruid or isSorcerer and getPlayerStorageValue(cid,7002) == -1) then
   			doPlayerAddItem(cid,10016,1)
   			doPlayerAddItem(cid,7730,1)
   			doPlayerAddItem(cid,8871,1)
   			setPlayerStorageValue(cid,7002,2)
            else
   			doPlayerSendTextMessage(cid,22,"To jest puste.")
end
         elseif(isKnight and getPlayerStorageValue(cid,7002) == -1) then
   			doPlayerAddItem(cid,2498,1)
   			doPlayerAddItem(cid,2488,1)
   			doPlayerAddItem(cid,2466,1)
   			setPlayerStorageValue(cid,7002,2)
            else
   			doPlayerSendTextMessage(cid,22,"To jest puste.")
end
         elseif(isPaladin and getPlayerStorageValue(cid,7002) == -1) then
   			doPlayerAddItem(cid,2498,1)
   			doPlayerAddItem(cid,2488,1)
   			doPlayerAddItem(cid,8891,1)
   			setPlayerStorageValue(cid,7003,2)
            else
   			doPlayerSendTextMessage(cid,22,"To jest puste.")
		end
end


      if item.uid == 7003 then
      if(isDruid or isSorcerer and getPlayerStorageValue(cid,7003) == -1) then
   			doPlayerAddItem(cid,2500,1)
   			doPlayerAddItem(cid,2499,1)
   			setPlayerStorageValue(cid,7003,1)
            else
   			doPlayerSendTextMessage(cid,22,"To jest puste.")
end
       elseif(isKnight or isPaladin and getPlayerStorageValue(cid,7003) == -1) then
   			doPlayerAddItem(cid,5741,1)
   			doPlayerAddItem(cid,2470,1)
   			doPlayerAddItem(cid,2472,1)
   			setPlayerStorageValue(cid,7003,1)
            else
   			doPlayerSendTextMessage(cid,22,"To jest puste.")
		end
   	end

   	return 1
end

PLX HELP :wub:
 
Try use this

like:
PHP:
function onUse(cid, item, frompos, item2, topos)
local vocationId = getPlayerVocation(cid)
local config = {
	[7001]={ -- Uniqueid and StorageValue
		[1]={2323,8870,7457}, -- 1 for sorcerer
		[2]={2323,8870,7457}, -- 2 for druid
		[3]={2491,2477,2476,7457}, -- 3 for paladin
		[4]={2491,2477,2476,7457} -- 4 for knight
	},
	[7002]={
		[1]={10016,7730,8871},
		[2]={10016,7730,8871},
		[3]={2498,2488,2466},
		[4]={2498,2488,8891}
	},
	[7003]={
		[1]={2500,2499},
		[2]={2500,2499},
		[3]={5741,2470,2472},
		[4]={5741,2470,2472}
	}
}
	if config[item.uid] then
		if getPlayerStorageValue(cid, config[item.uid]) < 1 then
			if config[item.uid][vocationId] then
				for i = 1, table.maxn(config[item.uid][vocationId]) do
					doPlayerAddItem(cid, config[item.uid][vocationId][i], 1)
				end
				setPlayerStorageValue(cid, config[item.uid], 1)
			else
				doPlayerSendTextMessage(cid, 22, "Sorry, you vocation is not able to open this.")
			end
		else
			doPlayerSendCancel(cid, "Empty!")
		end
	end
	return true
end
 
Back
Top