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

Action Promotion using action :)

Sirion_Mido

Experienced Member
Joined
Jul 22, 2012
Messages
579
Reaction score
43
Location
E-G-Y-P-T
this script could be not hard :) but could be useful for some people

Here We Are :)
in your actions/scripts create file name voc.lua and paste the following
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local voc = {1,2,3,4}

if isInArray(voc,getPlayerVocation(cid)) then
doPlayerSetPromotionLevel(cid, 1)
doCreatureSay(cid, "Promoted !", TALKTYPE_ORANGE_1)
end
return true
end

now in your actions/actions.xml paste the following:
XML:
	<action itemid="5785" event="script" value="voc.lua"/>


Rep++ If It helpful For You :)
 
Last edited:
u can add it buy promotion with items and money ?
 
no one can do it i want player buy promotion by items and with lvl 100
 
Lua:
local itemid = 4131

function onUse(cid, item, fromPosition, itemEx, toPosition)
local voc = {1,2,3,4}
 
if isInArray(voc,getPlayerVocation(cid)) and getPlayerLevel(cid) > 100 then
doPlayerRemoveItem (itemid,1)
doPlayerSetPromotionLevel(cid, 1)
doCreatureSay(cid, "Promoted !", TALKTYPE_ORANGE_1)
end
return true
end

U can always try, i dont try it
 
no one can do it i want player buy promotion by items and with lvl 100

Here We Are :)
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)

local voc = {1,2,3,4} -- here vocations id 
local item = 8313 -- here item id
 
if isInArray(voc,getPlayerVocation(cid)) and getPlayerItemCount(cid, item) and getPlayerLevel(cid) >= 100  then
doPlayerSetPromotionLevel(cid, 1)
doCreatureSay(cid, "Promoted !", TALKTYPE_ORANGE_1)
doPlayerRemoveItem(cid, item, 1)
end
return true
end

not tested tell me if it works or not :)

Rep++ If It Helpful For You
 
both script no work when use action just need lvl 100 to promot but items no work please if anyone can help me i want that script for lvl 200 items 2159,100
 
try this one?
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local voc = {1,2,3,4} -- here vocations id 
local item = 2159 -- here item id
local count = 100 -- how many items needed
local level = 200 -- level needed to use this item
if isInArray(voc,getPlayerVocation(cid)) and doPlayerRemoveItem(cid, item, count) thenand getPlayerLevel(cid) >= level then
doPlayerSetPromotionLevel(cid, 1)
doCreatureSay(cid, "Promoted !", TALKTYPE_ORANGE_1)
end
return true
end
 
Last edited:
[19/02/2013 23:13:35] [Error - LuaScriptInterface::loadFile] data/actions/scripts/other/voc.lua:6: 'then' expected near 'thenand'
[19/02/2013 23:13:35] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/other/voc.lua)
[19/02/2013 23:13:35] data/actions/scripts/other/voc.lua:6: 'then' expected near 'thenand'
[19/02/2013 23:13:35] Reloaded actions.
[19/02/2013 23:14:00] [Error - LuaScriptInterface::loadFile] data/actions/scripts/other/voc.lua:6: unexpected symbol near 'and'
[19/02/2013 23:14:00] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/other/voc.lua)
[19/02/2013 23:14:00] data/actions/scripts/other/voc.lua:6: unexpected symbol near 'and'
[19/02/2013 23:14:00] Reloaded actions.
[19/02/2013 23:14:22] [Error - LuaScriptInterface::loadFile] data/actions/scripts/other/voc.lua:6: unexpected symbol near '>='
[19/02/2013 23:14:22] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/other/voc.lua)
[19/02/2013 23:14:22] data/actions/scripts/other/voc.lua:6: unexpected symbol near '>='


i use tfs 3.6
 
oh sorry , try this one :p
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local voc = {1,2,3,4} -- here vocations id 
local item = 2159 -- here item id
local count = 100 -- how many items needed
local level = 200 -- level needed to use this item
if isInArray(voc,getPlayerVocation(cid)) and doPlayerRemoveItem(cid, item, count) and getPlayerLevel(cid) >= level then
doPlayerSetPromotionLevel(cid, 1)
doCreatureSay(cid, "Promoted !", TALKTYPE_ORANGE_1)
end
return true
end
 
yea mido its work but i want it say You need level 200 and 100 b coins when use it without items and lvl please do it and when use it and u have promotion say You already promoted
 
Here We Are , tell me if it work or no
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local voc = {1,2,3,4} -- here vocations id 
local item = 2159 -- here item id
local count = 100 -- how many items needed
local level = 200 -- level needed to use this item
if isInArray(voc,getPlayerVocation(cid)) and doPlayerRemoveItem(cid, item, count) and getPlayerLevel(cid) >= level then
doPlayerSetPromotionLevel(cid, 1)
doCreatureSay(cid, "Promoted !", TALKTYPE_ORANGE_1)
else
doPlayerSendCancel(cid, "You need level 200 and 100 B-Coins to use this item")
elseif getPlayerPromotionLevel(cid) = 1 then
doPlayerSendCancel(cid, "You Already Promoted")
end
return true
end

Rep++ If It Helplful For You
 
[20/02/2013 12:30:05] [Error - LuaScriptInterface::loadFile] data/actions/scripts/other/voc.lua:11: 'end' expected (to close 'if' at line 6) near 'else'
[20/02/2013 12:30:05] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/other/voc.lua)
[20/02/2013 12:30:05] data/actions/scripts/other/voc.lua:11: 'end' expected (to close 'if' at line 6) near 'else'
 
i make errors because i no test the scripts ;)
Here We Are :)
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local voc = {1,2,3,4} -- here vocations id 
local item = 2159 -- here item id
local count = 100 -- how many items needed
local level = 200 -- level needed to use this item
if isInArray(voc,getPlayerVocation(cid)) and doPlayerRemoveItem(cid, item, count) and getPlayerLevel(cid) >= level then
doPlayerSetPromotionLevel(cid, 1)
doCreatureSay(cid, "Promoted !", TALKTYPE_ORANGE_1)
else
doPlayerSendCancel(cid, "You need level 200 and 100 B-Coins to use this item")
end
if getPlayerPromotionLevel(cid) = 1 then
doPlayerSendCancel(cid, "You Already Promoted")
end
return true
end
 
Lua:
local promotion = 1
local itemId = 2159 -- here item id
local count = 100 -- how many items needed
local level = 200 -- level needed to use this item

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerPromotionLevel(cid) < promotion then
		if getPlayerLevel(cid) >= level then
			if doPlayerRemoveItem(cid, itemId, count) then
				doPlayerSetPromotionLevel(cid, 1)
				doCreatureSay(cid, "Promoted !", TALKTYPE_ORANGE_1)
			else
				doPlayerSendCancel(cid, "you need ".. count .. " of " .. getItemNameById(itemId) .. " to be promoted")
			end
		else
			doPlayerSendCancel(cid, "you don't have enough level")
		end
	else
		doPlayerSendCancel(cid, "You Already Promoted")
	end
	return true
end
 
thx Sirion_Mido bUt no work and thx ahmed30 ur script work fine

- - - Updated - - -

But u can change it to talk in (cid) ,19 ?? and send effect and disteeffect

local disteffect = 35
local effect = 66


for i = 1, 30 do
doSendDistanceShoot({x = position.x + math.random(-7, 7), y = position.y + math.random(-5, 5), z = position.z}, position, disteffect)
 
Last edited:
replace
Code:
doCreatureSay(cid, "Promoted !", TALKTYPE_ORANGE_1)
with
Code:
doPlayerSendTextMessage(cid, 19, "Promoted !")
 
i want it say doPlayerSendTextMessage(cid, 19, "you don't have enough level !") and all like this and want to make effect and disteffect

local disteffect = 35
local effect = 66


for i = 1, 30 do
doSendDistanceShoot({x = position.x + math.random(-7, 7), y = position.y + math.random(-5, 5), z = position.z}, position, disteffect)
 
Back
Top