• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[request] sql query

iruga

#S¥Ơ'..
Joined
May 18, 2009
Messages
371
Reaction score
4
Location
Brazil
query_insert.setQuery("INSERT INTO `player_items` (`player_id`, `pid`, `sid`, `itemtype`, `count`, `attributes`) VALUES ");

I wonder how to add an item within a specific slot, and within that slot to add another item into another slot.

Example: add item in slot (cid, 10) "slot_ammo," the itemID is 105 and into the slot (cid, 10) have a backpack where item 105 is added.

REP+ for anyhelp. :p
 
Last edited:
bump time is 24h
bye

ahhgeeznotthisshitagain.jpg


<_<
 
pid is the value for slot (1-10), if there is already an item you should move it with another query, sid store the order (i think) so new added item should have last sid + 1, the latest container its the higher pid. enough info?
 
pid is the value for slot (1-10), if there is already an item you should move it with another query, sid store the order (i think) so new added item should have last sid + 1, the latest container its the higher pid. enough info?

thanks, but i want to know how do this:

add item in slot (cid, 10) "slot_ammo," the itemID is 105 and into the slot (cid, 10) have a backpack where item 105 is added.

:huh:
 
i think you could kick the player before running the query

something like:
doRemoveCreature(cid) and query_insert.setQuery("INSERT INTO...
 
but why the player should be iffline i dont get it? any reason special? i tought it was a query for use via php but as i see you want to use from game, that dumb since from game its easier handle slots/items o_O without queries
 
because i use a learnspell system and i will explain.


when the player buys a spell, uses the NPC function doPlayerLearnInstantSpell and is added an item in the specified location ..

it adds the item into the slot of ammunition within that slot is another slot item that is like a backpack, it is there that the item will be added.

ItemAmmo:102
ItemBP:108
ItemWillBeAdded:182

Therefore the use of dbquery ...^_^

//EDIT

and I do not know each other is possible I add one item at a certain place, from a command like doPlayerAddItem ()...
 
could be possible, those items can only be used in that slot (xml specifications) ?
also if you can handle cpp, could be even easier using internal move item, i can guide you. btw this topic going too long send me a pm with your msn.
 
Back
Top