AdmCronus 0 Posted June 13, 2013 i need to sell items for pont in databse see tabela: ALTER TABLE `char` ADD `pontos` INT NOT NULL ; i need player buy item for this pont. how i do? Share this post Link to post Share on other sites
0 mleo1 36 Posted June 13, 2013 maybe edit jaypee's v4phttps://github.com/mandark022/VoteForPoints/blob/master/npc%20script/rAthena/voteforpoints.txt function updatePoints {set .@char_id,getarg(0);set .@usedPoints,getarg(1);query_sql("UPDATE `chars` SET puntos=(puntos-"+.@usedPoints+") WHERE char_id='"+.@char_id+"'");return;}function getPoints {set .@char_id,getarg(0);query_sql("SELECT `puntos` FROM `char` WHERE charid_id="+.@char_id+" LIMIT 1",.@points);if(getarraysize(.@points)==0)return 0;return .@points[0];} change alsoupdatePoints(getcharid(0),.@rpoints);getPoints(getcharid(0);Did not test mwahah Share this post Link to post Share on other sites
0 AdmCronus 0 Posted June 13, 2013 (edited) is good, but i need to sell : exemple when player talk with npc for buy item per puntos. getitem 608,50; query_sql("UPDATE `chars` SET puntos=(puntos-100) WHERE char_id='"+.@char_id+"'"); how i do? Edited June 13, 2013 by AdmCronus Share this post Link to post Share on other sites
0 mleo1 36 Posted June 13, 2013 You're gonna make 608 to be points? set .@count, countitem(608);if (.@count == 0) end; delitem 608, .@count; query_sql("UPDATE `chars` SET puntos=(puntos+" +.@count+ ") WHERE char_id="+.@char_id); Share this post Link to post Share on other sites
0 AdmCronus 0 Posted June 13, 2013 (edited) are invert, i need to make items for puntos. ex: 607 x 20 for 10 pontos 678 x 50 for 15 pontos need to count if player have punto for get item. understand? Edited June 13, 2013 by AdmCronus Share this post Link to post Share on other sites
0 mleo1 36 Posted June 13, 2013 the first post does it. its a configurable seller npc. set .@charid, getcharid(0);query_sql("SELECT `puntos` FROM `char` WHERE `charid_id`=" +.@char_id, .@points);query_sql("UPDATE `char` SET puntos=(puntos-" +@points+ ") WHERE char_id="+.@char_id);getitem 502, @points; Share this post Link to post Share on other sites
0 AdmCronus 0 Posted June 13, 2013 (edited) i will test, and for check if player have puntos or not for he buy. npc check player have 5 pontos for buy item 607. Edited June 13, 2013 by AdmCronus Share this post Link to post Share on other sites
i need to sell items for pont in databse see tabela:
i need player buy item for this pont.
how i do?
Share this post
Link to post
Share on other sites