lordzokarum 2 Posted April 6, 2017 Share Posted April 6, 2017 hallo, ich komm einfach nicht mehr weiter. Bitte helft mir. das Problem ist ich will nur das der player coins bekommt wenn er z.b. irgendein metin kill sagen wir mal 2 coins als belohnung bekommt oder halt ween er einen Boss killt z.b. 1093. quest coins_for_kill begin state start begin when kill begin local metin = { [8024] = {30}, -- 1. Vnum des Metin 2. Anzahl der Coins [8025] = {20} } if npc.get_race() == metin[pc.get_mob_vnum] then mysql_query("UPDATE account.account SET coins = coins + "..metin[pc.get_mob_vnum][2].." WHERE id = "..pc.get_account_id()..";") end end end end aber leider funzt die obere quest nicht keine Fehler bei ./qc aber auch keine coins auf dem Konto. Danke Link to comment Share on other sites More sharing options...
Premium North 1174 Posted April 7, 2017 Premium Share Posted April 7, 2017 you guys really want to shitload your mysql server dont you Link to comment Share on other sites More sharing options...
Solution Tasho 243 Posted April 7, 2017 Solution Share Posted April 7, 2017 quest coins_for_kill begin state start begin when kill begin local mobVnum = npc.get_race() local mobCoins = ({ [8024] = 30, -- 30 Coins [8025] = 20 -- 20 Coins }) [mobVnum] if not mobCoins then return end pc.charge_cash(mobCoins, "coins_for_kill") syschat(string.format("You get %d coins from %s.", mobCoins, mob_name(mobVnum))) end end end This is correctly quest rewrited. Already ymir did the function for lua to charge the coins via pc.charge_cash, but not all people was used because name of row is called: "cash" and they are used on website/itemshop etc row "coins", but can change very easy. Go in /src/db/ClientManager.cpp sprintf(szQuery, "update account set `cash` = `cash` + %d where id = %d limit 1", packet->dwAmount, packet->dwAID); Replace `cash` = `cash` with `coins` = `coins` 1 Link to comment Share on other sites More sharing options...
lordzokarum 2 Posted April 7, 2017 Author Share Posted April 7, 2017 thanx i will try it now, i hope it will work Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now