Bassam421
Lockout RPG/PVP Owner
[18/12/2012 17:31:04] [Error - CreatureScript Interface]
[18/12/2012 17:31:04] data/creaturescripts/scripts/honor.luanLogin
[18/12/2012 17:31:04] Description:
[18/12/2012 17:31:04] data/creaturescripts/scripts/honor.lua:3: attempt to call global 'getPlayerhonor_points' (a nil value)
[18/12/2012 17:31:04] stack traceback:
[18/12/2012 17:31:04] data/creaturescripts/scripts/honor.lua:3: in function <data/creaturescripts/scripts/honor.lua:1>
And i'm using this script
how do i do so it looks in the database for the player honor? i have a table called honor_points in my database
[18/12/2012 17:31:04] data/creaturescripts/scripts/honor.luanLogin
[18/12/2012 17:31:04] Description:
[18/12/2012 17:31:04] data/creaturescripts/scripts/honor.lua:3: attempt to call global 'getPlayerhonor_points' (a nil value)
[18/12/2012 17:31:04] stack traceback:
[18/12/2012 17:31:04] data/creaturescripts/scripts/honor.lua:3: in function <data/creaturescripts/scripts/honor.lua:1>
And i'm using this script
Lua:
function onLogin(cid)
registerCreatureEvent(cid, "honorlook")
doPlayerSendTextMessage(cid, 19, "You have ".. getPlayerhonor_points(cid) .." honor's.")
return true
end
function onLook(cid, thing, position, lookDistance)
if isPlayer(thing.uid) and thing.uid ~= cid then
doPlayerSetSpecialDescription(cid,'[Honor: '..getPlayerhonor_points(cid)..']')
return true
elseif thing.uid == cid then
doPlayerSetSpecialDescription(cid,'[Honor: '..getPlayerhonor_points(cid)..']')
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)..''
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
Last edited: