function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
local amount = db.storeQuery("SELECT COUNT(*) FROM `player_deaths` WHERE `player_id` = '".. getPlayerGUID(cid) .."'")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have died ".. result.getNumber(amount, "COUNT(*)") .." times.")
return true
end
thank you for your reply, i've aries xml 0.4.0 8.1 and i get this error at my consoleLua:function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) local amount = db.storeQuery("SELECT COUNT(*) FROM `player_deaths` WHERE `player_id` = '".. getPlayerGUID(cid) .."'") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have died ".. result.getNumber(amount, "COUNT(*)") .." times.") return true end
Post a link to your 0.4 sourcesthank you for your reply, i've aries xml 0.4.0 8.1 and i get this error at my console
i dont have the sourcePost a link to your 0.4 sources
Well it will be a little difficult to help you. because the 0.4 sources that we do find on github does have a db table and your script throws errors when we call this table.i dont have the source
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
-- is db a table and does it contain values
if db and next(db) then
-- does it have a function named storeQuery
if type(db.storeQuery) == 'function' then
local amount = db.storeQuery("SELECT COUNT(*) FROM `player_deaths` WHERE `player_id` = '".. getPlayerGUID(cid) .."'")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have died ".. result.getNumber(amount, "COUNT(*)") .." times.")
end
return true
end
return false
end
He said he's using xml based server, so he hasnt any database at all...Well it will be a little difficult to help you. because the 0.4 sources that we do find on github does have a db table and your script throws errors when we call this table.
The only other solution would be to re-write the script like this.
But then again the script may never execute.Lua:function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) -- is db a table and does it contain values if db and next(db) then -- does it have a function named storeQuery if type(db.storeQuery) == 'function' then local amount = db.storeQuery("SELECT COUNT(*) FROM `player_deaths` WHERE `player_id` = '".. getPlayerGUID(cid) .."'") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have died ".. result.getNumber(amount, "COUNT(*)") .." times.") end return true end return false end
Its ancient history. I suggest to change it for newest TFS.thank you for your reply, i've aries xml 0.4.0 8.1 and i get this error at my console
dude this an xml 8.1 server Aries 0.4.0 if can write the script at new methodWell it will be a little difficult to help you. because the 0.4 sources that we do find on github does have a db table and your script throws errors when we call this table.
The only other solution would be to re-write the script like this.
But then again the script may never execute.Lua:function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) -- is db a table and does it contain values if db and next(db) then -- does it have a function named storeQuery if type(db.storeQuery) == 'function' then local amount = db.storeQuery("SELECT COUNT(*) FROM `player_deaths` WHERE `player_id` = '".. getPlayerGUID(cid) .."'") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have died ".. result.getNumber(amount, "COUNT(*)") .." times.") end return true end return false end
Where did he say he was using an xml based server?He said he's using xml based server, so he hasnt any database at all...
Anyway i doubt you will get any help. Especially if you havent got a source.
Would of been helpful if you mentioned that originally anyway as @2Rec suggested upgrade or learn xml which is easier for youdude this an xml 8.1 server Aries 0.4.0 if can write the script at new method
could you post some script with onDeath and PrepareDeath scriptsDoes the xml server have 'onDeath' or 'onPrepareDeath' and storage values?
If yes, you could create an onDeath/PrepareDeath script to count player deaths using storage values, then use that storage value in the movement script.
Does the xml server have either?could you post some script with onDeath and PrepareDeath scripts
\Does the xml server have either?
Well.. I found the spot you could maybe get it working, but idk what lines to put here for storage.\
i dont know but, i've some source xml like aries 0.4.0 99% but 8.00 i can send it to you private i am not good at programming
void Creature::onKilledCreature(Creature* target)
{
if(getMaster()){
getMaster()->onKilledCreature(target);
}
#ifdef __JD_DEATH_LIST__
if(target->getPlayer()){
target->getPlayer()->addDeath(getName(), target->getPlayer()->getLevel(), std::time(NULL));
}
#endif
}
query_insert.setQuery("INSERT INTO `playerstorage` (`player` , `key` , `value` ) VALUES ");
omg This is not reasonable did not work right?Well.. I found the spot you could maybe get it working, but idk what lines to put here for storage.
You'd have to advance the player storage in this file.. and recompile I guess.
creature.cpp
Code:void Creature::onKilledCreature(Creature* target) { if(getMaster()){ getMaster()->onKilledCreature(target); } #ifdef __JD_DEATH_LIST__ if(target->getPlayer()){ target->getPlayer()->addDeath(getName(), target->getPlayer()->getLevel(), std::time(NULL)); } #endif }
I found this line in
ioplayersql.cpp
Code:query_insert.setQuery("INSERT INTO `playerstorage` (`player` , `key` , `value` ) VALUES ");
Dunno if it's correct or not to use.
zzzz
I'm at my knowledge limit here.
-- edit
As far as I can tell, creaturescripts don't exist on your server.. so basically your missing out on 3/4 of the functions used for anything cool. :/
onLogin
onLogout
onSpawnSingle
onSpawn
onChannelJoin
onChannelLeave
onChannelRequest
onThink
onAdvance
onLook
onDirection
onOutfit
onMailSend
onMailReceive
onTradeRequest
onTradeAccept
onTextEdit
onHouseEdit
onReportBug
onReportViolation
onThankYou
onStatsChange
onAreaCombat
onThrow
onPush
onTarget
onFollow
onCombat
onAttack
onCast
onKill
onDeath
onPrepareDeath
I know that little server means a lot to you, but if you want any cool functions dealing with players directly.. your going to miss out.
i tested this script at tfs 0.4.0 8.6 it's also not workingWell it will be a little difficult to help you. because the 0.4 sources that we do find on github does have a db table and your script throws errors when we call this table.
The only other solution would be to re-write the script like this.
But then again the script may never execute.Lua:function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) -- is db a table and does it contain values if db and next(db) then -- does it have a function named storeQuery if type(db.storeQuery) == 'function' then local amount = db.storeQuery("SELECT COUNT(*) FROM `player_deaths` WHERE `player_id` = '".. getPlayerGUID(cid) .."'") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have died ".. result.getNumber(amount, "COUNT(*)") .." times.") end return true end return false end
it's do nothingwhat doesn't work about it?
does it give error? does it do nothing?