- Joined
- Jul 7, 2007
- Messages
- 4,049
- Reaction score
- 238
THIS IS RESOLVED =D
Hey
Its been a while since I last worked with LUA so forgive my ignorance
I want to make a function that unless written, it takes a default value, like this:
I know this script is almost useless, its just to demonstrate what I want to ask
In this case, I'd like the var short to always take the value false unless I said true when using it
Player is Sorcerer
getPlayerVocationName(cid) - short = false
...return "Sorcerer"
getPlayerVocationName(cid,true) - short = true
...return "SRC"
Hope I made my question clear
Thanks in Advance
Quetzalma
Hey
Its been a while since I last worked with LUA so forgive my ignorance
I want to make a function that unless written, it takes a default value, like this:
PHP:
function getPlayerVocationName(cid,short)
if isSorcerer(cid) then
if short then
return "SRC"
else
return "Sorcerer"
end
elseif isDruid(cid) then
if short then
return "DRD"
else
return "Druid"
end
elseif isPaladin(cid) then
if short then
return "PLD"
else
return "Paladin"
end
elseif isKnight(cid) then
if short then
return "KNT"
else
return "Knight"
end
else
if short then
return "NUB"
else
return "No Vocation"
end
end
end
In this case, I'd like the var short to always take the value false unless I said true when using it
Player is Sorcerer
getPlayerVocationName(cid) - short = false
...return "Sorcerer"
getPlayerVocationName(cid,true) - short = true
...return "SRC"
Hope I made my question clear
Thanks in Advance
Quetzalma
Last edited: