then i retive the monsters that the player Account posses using
offset = offset
function rst(new_tre, new_ire, original_tre, original_ire, offset)
new_tre[new_ire].address= original_tre[original_ire].address + offset
new_tre[new_ire].flags = gg.TYPE_DWORD
end
gg.searchNumber(AccID..";6;1065353216::", gg.TYPE_DWORD,false, gg.SIGN_EQUAL,0,-1,-1)
rF = gg.getResults(gg.getResultsCount())
p={}for i=2,#rF,3do
p[i]={}
rst(p, i, rF, i, offset)end
p_mnst = gg.getValues(p)
so at this point i hate the database with all monster that exist on game on names {} and the monsters ID number that the account have on p_mnst {} now what i want to do is get the names of the IDs on p_mnst {} and insert on new table IDandNames {} so i could ad the monster with the names on a submenu where the people could change data on that particular monster
so the p_mnst {} will look like this
p_mnst {10115,10213,10315}
the IDandNames {} should look like this
IDandNames {10115="monster name",-- so the ID number retrived from p_mnst{} and the monster name retrived from Names{}10213="monster name",10315="monster name",}
the submenu should look something like this
monsterPoss = gg.choice({
IDandNames[1],--here should be the name of the monster and not the ID number
IDandNames[2],
IDandNames[3],},nil," Select the monster you want to edit")if monsterPoss ==1then
gg.searchNumber(AccID..";"..IDandNames["monster name"]..";1065353216::", gg.TYPE_DWORD,false, gg.SIGN_EQUAL,0,-1,-1)
rK = gg.getResults(gg.getResultsCount())do stuff
where ..IDandNames["monster name"] should be the ID number of the monster you selected to change
i dont know how to do all of this on lua since lua dosnt have table.match or somethink like this
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.
Question
hsusudhbsjwhdhdgsj
How i should match 2 table and if the key match insert them in a third table the key from second table and the value from first table
basically what im trying to do is this
i have a table with all monsters data
then i retive the monsters that the player Account posses using
so at this point i hate the database with all monster that exist on game on names {} and the monsters ID number that the account have on p_mnst {} now what i want to do is get the names of the IDs on p_mnst {} and insert on new table IDandNames {} so i could ad the monster with the names on a submenu where the people could change data on that particular monster
so the p_mnst {} will look like this
the IDandNames {} should look like this
the submenu should look something like this
i dont know how to do all of this on lua since lua dosnt have table.match or somethink like this
Can someone help me build a code for this
6 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.