Gelio
Lua PHP C++ programmer
Hello. Script sets player vocation to any you want. You need to say this:
/setVoc "Name of player,Voc
Voc can be:
Script:
data/talkactions/scripts/promote player.lua:
I'm polish and variables are with polish names. I will translate:
It run on TFS 0.2, 0.3 and on Devland (8.1)
I'm waiting for your comments.
Yours,
Gelio
/setVoc "Name of player,Voc
Voc can be:
promote give player promotion if he/she is not promoted (if vocation is lower that 5)Sorcerer
Druid
Paladin
Knight
Master Sorcerer
Elder Druid
Royal paladin
Elite Knight
promote
Script:
data/talkactions/scripts/promote player.lua:
Code:
function onSay(cid, words, param)
local znajdz = string.find(param, ",")
local name = string.sub(param, 1, znajdz-1)
local profesja = string.sub(param, znajdz+1)
local player = getPlayerByName(name)
local jakiAccessMoze = 1
if (getPlayerAccess(cid) >= jakiAccessMoze) then
if isPlayer(player) then
if (profesja == "Sorcerer") then
doPlayerSetVocation(player,1)
elseif (profesja == "Druid") then
doPlayerSetVocation(player,2)
elseif (profesja == "Paladin") then
doPlayerSetVocation(player,3)
elseif (prosefja == "Knight") then
doPlayerSetVocation(player,4)
elseif (profesja == "Master Sorcerer") then
doPlayerSetVocation(player,5)
elseif (profesja == "Elder Druid") then
doPlayerSetVocation(player,6)
elseif (profesja == "Royal Paladin") then
doPlayerSetVocation(player,7)
elseif (profesja == "Elite Knight") then
doPlayerSetVocation(player,8)
elseif (profesja == "promote") then
if (getPlayerVocation(player) <= 4) then
doPlayerSetVocation(player,getPlayerVocation(player)+4)
else
doPlayerSendCancel(cid,"Player ".. name .." is already promoted")
end
end
else
doPlayerSendCancel(cid,"Player is offline")
end
else
doPlayerSendCancel(cid,"You are not a gamemaster")
end
end
To talkactions.xml:znajdz - find (it look for "," in param)
name - name of player (it is string from begin of param to ",")
profesja - vocation (it is string from "," to end)
jakiAccessMoze - which access can (player from that access can set somebody's vocation)
Code:
<talkaction words="/setVoc" script="promote player.lua" />
I'm waiting for your comments.
Yours,
Gelio