YlarSwe
New Member
Hello! I want a item script and changes the player voc to my voc id.
//Ylar
Sorry for my bad english...
//Ylar
Sorry for my bad english...
local t = { --- config
tovoc = 4 --- what vocation the user will get
}
function onUse(cid,item,fromPosition,toPosition,itemEx)
local v = getThingPos(cid)
if getPlayerVocation(cid) ~= 4 then
doPlayerSetVocation(cid,t.tovoc)
doPlayerSendTextMessage(cid,20,'Your vocation has changed to '.. getPlayerVocationName(cid)..'.')
doSendMagicEffect(v,12)
else
doPlayerSendTextMessage(cid,20,'You are a '.. getPlayerVocationName(cid)..' already!')
doSendMagicEffect(v,2)
end
return true
end
And you want to make server? :/function onUse
local t = { --- config
tovoc = 4 --- what vocation the user will get
}
function onUse(cid,item,fromPosition,toPosition,itemEx)
local v = getThingPos(cid)
if getPlayerVocation(cid) ~= 4 then
doPlayerSetVocation(cid,t.tovoc)
doPlayerSendTextMessage(cid,20,'Your vocation has changed to '.. getPlayerVocationName(cid)..'.')
doBroadcastMessage('Player '.. getPlayerName(cid)..' just chagned vocation to '.. getPlayerVocationName(cid)..'!')
doSendMagicEffect(v,12)
else
doPlayerSendTextMessage(cid,20,'You are already '.. getPlayerVocationName(cid)..'!')
doSendMagicEffect(v,2)
end
return true
end
local t = { --- config
tovoc = 4 --- what vocation the user will get
}
function onUse(cid,item,fromPosition,toPosition,itemEx)
local v = getThingPos(cid)
if getPlayerVocation(cid) ~= 4 then
doPlayerSetVocation(cid,t.tovoc)
doPlayerSendTextMessage(cid,20,'Your vocation has changed to '.. getPlayerVocationName(cid)..'.')
doBroadcastMessage('Player '..getPlayerByNameWildcard(cid)..' just changed vocation to '.. getPlayerVocationName(cid)..'!')
doSendMagicEffect(v,12)
else
doPlayerSendTextMessage(cid,20,'You are already '.. getPlayerVocationName(cid)..'!')
doSendMagicEffect(v,2)
end
return true
end