[Dev V Rev 12] Buy temmal send to mileage

If you want to help us or give some corrections / codes, put it here ;)

Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators

[Dev V Rev 12] Buy temmal send to mileage

Postby WiseGuy on Sat May 24, 2014 7:50 pm

wordpackets pakItemmallBuy

find:
  1.            } else { // Observe: Purchase success


replace the whole else block by:
  1.  
  2.             } else { // Observe: Purchase success
  3.                 ADDBYTE     ( pak, 6 );
  4.                 ADDBYTE     ( pak, 1 );
  5.  
  6.                 ADDDWORD    ( pak, Slot );
  7.                 ADDDWORD    ( pak, itemType );
  8.                 ADDDWORD    ( pak, itemID );
  9.                 ADDDWORD    ( pak, Amount );
  10.  
  11.                 for(int i=0; i<144; i++){
  12.                     ADDBYTE ( pak, 0 );
  13.                 }
  14.  
  15.                 GServer->DB->FreeResult( );
  16.  
  17.                 MYSQL_RES *result = GServer->DB->QStore("SELECT * FROM mileage WHERE owner='%i'", thisclient->Session->userid);
  18.                 int slotNum = mysql_num_rows(result)+1;
  19.                 GServer->DB->FreeResult( );
  20.  
  21.                 GServer->DB->Query("INSERT INTO mileage (`owner`,`itemnum`,`itemtype`,`count`,`durability`,`slotnum`) VALUES ('%i','%i','%i','%i','100','%i')",thisclient->Session->userid,itemID,itemType,Amount,slotNum);
  22.                 thisclient->CharInfo->Itemmall = thisclient->CharInfo->Itemmall - Price;
  23.                 thisclient->savedata( );
  24.             }
  25.  


as always, my mother language is BAHASA not C++
so, maybe I was mistake with this codes :lol:
It is nice to be important
but very very important to be nice
User avatar
WiseGuy
Pomic
Pomic
 
Posts: 112
Joined: Sat Nov 21, 2009 4:03 am
Location: Jakarta

Return to Submit Code

Who is online

Users browsing this forum: No registered users and 2 guests

cron