Hello Otland!
Today I have small request it was long time ago when I made my rebirth mysql and I left tibia for few months now I'm back and I need two this to be done I try my self but end up with errors.
This is my Rebirth Script
http://otland.net/threads/best-rebirth-system-mysql-by-god-batonik-with-gensior-script.186274/
first I want change my !rebirth talkaction script to mysql for my system
here my scritp
second I get new rebirth on look but I want change to mysql too
Best Regards
mlody.1039
Today I have small request it was long time ago when I made my rebirth mysql and I left tibia for few months now I'm back and I need two this to be done I try my self but end up with errors.
This is my Rebirth Script
http://otland.net/threads/best-rebirth-system-mysql-by-god-batonik-with-gensior-script.186274/
first I want change my !rebirth talkaction script to mysql for my system
here my scritp
Code:
local level = 717171 -- the min level
function onSay(cid, words, param, channel)
if(getPlayerLevel(cid) >= level) then
local guid = getPlayerGUID(cid)
doCreatureSetStorage(cid, 85987, getCreatureStorage(cid, 85987) == -1 and 1 or getCreatureStorage(cid, 85987) + 1)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `level` = 8, `experience` = 4200, `healthmax` = 2000, `manamax` = 2000, `promotion` = 0 WHERE `id` = " .. guid)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You need level " .. level .. ".")
end
return true
end
second I get new rebirth on look but I want change to mysql too
Code:
function onLogin(cid)
registerCreatureEvent(cid, "newlook")
return true
end
local config = {
storage = 85987 -- storage takie jak w skrypcie wyzej ;p
}
function onLook(cid, thing, position, lookDistance)
if isPlayer(thing.uid) and thing.uid ~= cid then
doPlayerSetSpecialDescription(thing.uid,'\n[Reborn: '..getPlayerStorageValue(thing.uid,config.storage) ..']')
return true
elseif thing.uid == cid then
doPlayerSetSpecialDescription(cid,'\n[Reborn: '..getPlayerStorageValue(cid,config.storage)..']')
local string = 'You see yourself.'
if getPlayerFlagValue(cid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION) then
string = string..' You are '.. getPlayerGroupName(cid) ..'.'
elseif getPlayerVocation(cid) ~= 0 then
string = string..' You are '.. getPlayerVocationName(cid) ..'.'
else
string = string..' You have no vocation.'
end
string = string..getPlayerSpecialDescription(cid)..'\n'
if getPlayerNameByGUID(getPlayerPartner(cid), false, false) ~= nil then
string = string..' You are '.. (getPlayerSex(cid) == 0 and 'wife' or 'husband') ..' of '.. getPlayerNameByGUID(getPlayerPartner(cid)) ..'.'
end
if getPlayerGuildId(cid) > 0 then
string = string..' You are ' .. (getPlayerGuildRank(cid) == '' and 'a member' or getPlayerGuildRank(cid)) ..' of the '.. getPlayerGuildName(cid)
string = getPlayerGuildNick(cid) ~= '' and string..' ('.. getPlayerGuildNick(cid) ..').' or string..'.'
end
if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS) then
string = string..'\nHealth: ['.. getCreatureHealth(cid) ..' / '.. getCreatureMaxHealth(cid) ..'], Mana: ['.. getCreatureMana(cid) ..' / '.. getCreatureMaxMana(cid) ..'].'
string = string..'\nIP: '.. doConvertIntegerToIp(getPlayerIp(cid)) ..'.'
end
if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEEPOSITION) then
string = string..'\nPosition: [X:'.. position.x..'] [Y:'.. position.y..'] [Z:'.. position.z..'].'
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string)
return false
end
return true
end
Best Regards
mlody.1039