ok now i use phpmyadmin buti get an error its say
[Error - Npc interface]
[05/11/2013 16:55:48] data/npc/scripts/rebirth.luanCreatureSay
[05/11/2013 16:55:48] Description:
[05/11/2013 16:55:48] data/npc/scripts/rebirth.lua:69: attempt to call global 'getPlayerRebirth' (a nil value)
[05/11/2013 16:55:48] stack traceback:
[05/11/2013 16:55:49] data/npc/scripts/rebirth.lua:69: in function <data/npc/scripts/rebirth.lua:61>
local level = 717171 -- the min level
function onSay(cid, words, param, channel)
if getPlayerLevel(cid) >= level then
local guid = getPlayerGUID(cid)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `Rebirths` = `Rebirths` + 1, `level` = 8, `experience` = 4200, `health` = 2000, `healthmax` = 2000, `mana` = 2000, `manamax` = 2000, `promotion` = 0 WHERE `id` = " .. guid)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You need level " .. level .. ".")
end
return true
end
`health` = 2000, `healthmax` = 2000, `mana` = 2000, `manamax` = 2000, `promotion` = 0
local level = 717171 -- the min level
function onSay(cid, words, param, channel)
if getPlayerLevel(cid) >= level then
local guid = getPlayerGUID(cid)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `Rebirths` = `Rebirths` + 1, `level` = 8, `experience` = 4200 WHERE `id` = " .. guid)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You need level " .. level .. ".")
end
return true
end
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
function onLook(cid, thing, position, lookDistance)
if(isPlayer(thing.uid) and thing.uid ~= cid and getPlayerRebirth(thing.uid) ~= -1) then
doPlayerSetSpecialDescription(thing.uid, (getPlayerSex(thing.uid) == PLAYERSEX_FEMALE and ".\nShe" or ".\nHe") .. " has " .. getPlayerRebirth(thing.uid) .. " " .. (getPlayerRebirth(thing.uid) == 1 and "rebirths" or "rebirth"))
elseif(thing.uid == cid and getPlayerRebirth(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 " .. getPlayerRebirth(cid) .. " " .. (getPlayerRebirth(cid) == 1 and "rebirths." or "rebirth."))
end
return true
end
function onLook(cid, thing, position, lookDistance)
if(isPlayer(thing.uid) and thing.uid ~= cid and getPlayerRebirth(thing.uid) ~= -1) then
doPlayerSetSpecialDescription(thing.uid, (getPlayerSex(thing.uid) == PLAYERSEX_FEMALE and ".\nShe" or ".\nHe") .. " has " .. getPlayerRebirth(thing.uid) .. " " .. (getPlayerRebirth(thing.uid) == 1 and "rebirths" or "rebirth"))
elseif(thing.uid == cid and getPlayerRebirth(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 " .. getPlayerRebirth(cid) .. " " .. (getPlayerRebirth(cid) == 1 and "rebirths." or "rebirth."))
end
return false, doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, message .. " \and " .. getPlayerLPrestiges(cid) .. " " .. (getPlayerLPrestiges(cid) == 1 and "legend rebirths." or "legend rebirth."))
end
return true
end
foreach($skills as $skill)
Can you tell me wich server version you are using, and try to change your npc libs otherwiseget this error :
[20:21:31.978] [Error - NpcScript Interface]
[20:21:31.978] data/npc/scripts/rebirth.luanThink
[20:21:31.978] Description:
[20:21:31.978] data/npc/scripts/rebirth.lua:120: attempt to call global 'getDistanceTo' (a nil value)
[20:21:31.978] stack traceback:
[20:21:31.978] data/npc/scripts/rebirth.lua:120: in function <data/npc/scripts/rebirth.lua:115>