Well, i Wanted to make my Rebirth/prestige script what ever you guys wana call it tell you if you had Legend aswell. I made it there are no error's just the fact that when you look at someone nothing happends no errors or crashs.
Here is my Version of the script.
My Legend Prestige Function.
This is the Original script i had gotten from a fellow otlander.
http://otland.net/threads/best-rebirth-system-mysql-by-mlody-1039-with-gesior-script.186274/
Here is my Version of the script.
Code:
function onLook(cid, thing, position, lookDistance)
if(isPlayer(thing.uid) and thing.uid ~= cid and getPlayerPrestige(thing.uid) ~= -1 and getPlayerLPrestiges(thing.uid) ~= -1) then
doPlayerSetSpecialDescription(thing.uid, (getPlayerSex(thing.uid) == PLAYERSEX_FEMALE and ".\nShe" or ".\nHe") .. " has " .. getPlayerPrestige(thing.uid) .. " " .. (getPlayerPrestige(thing.uid) == 1 and "Prestiges" or "Prestige") "and has" .. getPlayerLPrestiges(thing.uid) .. " " .. (getPlayerLPrestiges(thing.uid) == 1 and "Legends" or "Legend."))
elseif(thing.uid == cid and getPlayerPrestige(cid) ~= -1 and getPlayerLPrestiges(cid) ~= -1) then
local message = "You see yourself."
if(getPlayerFlagValue(cid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION)) then
message = message .. " You are " .. getPlayerGroupName(cid) .. "."
elseif(getPlayerVocation(cid) ~= 0) then
message = message .. " You are a " .. getPlayerVocationName(cid):lower() .. "."
else
message = message .. " You have no vocation."
end
if(getPlayerByName(getPlayerPartner(cid), false, false) ~= nil) then
message = message .. " You are " .. (getPlayerSex(cid) == PLAYERSEX_FEMALE and "wife" or "husband") .. " of " .. getPlayerByName(getPlayerPartner(cid)) .. "."
end
if(getPlayerGuildId(cid) > 0) then
message = message .. " You are " .. (getPlayerGuildRank(cid) == "" and "a member" or getPlayerGuildRank(cid)) .. " of the " .. getPlayerGuildName(cid)
message = getPlayerGuildNick(cid) ~= "" and message .. " (" .. getPlayerGuildNick(cid) .. ")." or message .. "."
end
if(getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS)) then
message = message .. "\nHealth: [" .. getCreatureHealth(cid) .. " / " .. getCreatureMaxHealth(cid) .. "], Mana: [" .. getCreatureMana(cid) .. " / " .. getCreatureMaxMana(cid) .. "]."
message = message .. "\nIP: " .. doConvertIntegerToIp(getPlayerIp(cid)) .. "."
end
if(getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEEPOSITION)) then
message = message .. "\nPosition: [X: " .. position.x .. "] [Y: " .. position.y .. "] [Z: " .. position.z .. "]."
end
return false, doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, message .. " \nYou have " .. getPlayerPrestige(cid) .. " " .. (getPlayerPrestige(cid) == 1 and "Prestiges." or "Prestige") "and you have " .. getPlayerLPrestiges(cid) .. " " .. (getPlayerLPrestiges(cid) == 1 and "Legends." or "Legend."))
end
return true
end
My Legend Prestige Function.
Code:
-- Legend Prestige --
function getPlayerLPrestiges(cid)
local Info = db.getResult("SELECT `LPrestiges` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. " LIMIT 1")
if Info:getID() ~= LUA_ERROR then
local Lpres= Info:getDataInt("LPrestiges")
Info:free()
return Lpres
end
return LUA_ERROR
end
This is the Original script i had gotten from a fellow otlander.
http://otland.net/threads/best-rebirth-system-mysql-by-mlody-1039-with-gesior-script.186274/
Last edited: