Hey,
releasing my Sell Gun for $ feature, so if you want to make some looters happy...
You can sell guns and gear.
Weight = Money.
4x multiplier for Sniper rifles
5%-10% bonus with skills.
No GUI, you sell item that you put in the 5 slot(6 quickslot?).
It's the base, there is NPC & skills already but then you would have no fun with it, right?
Then Have fun!
ServerGameLogic.h
Search for
Add belowCode:int Cmd_GiveItem(obj_ServerPlayer* plr, const char* cmd);
ServerGameLogic.cppCode:int Cmd_Sell(obj_ServerPlayer* plr, const char* cmd);
Search for
Add belowCode:if(strncmp(cmd, "/gi", 3) == 0) return Cmd_GiveItem(plr, cmd);
Search forCode:if(strncmp(cmd, "/sell", 5) == 0) return Cmd_Sell(plr, cmd);
Add aboveCode:int ServerGameLogic::Cmd_GiveItem(obj_ServerPlayer* plr, const char* cmd) {
Code:int ServerGameLogic::Cmd_Sell(obj_ServerPlayer* plr, const char* cmd) { if(plr->loadout_->GameFlags & plr->loadout_->GAMEFLAG_NearPostBox) { //read item from 6 quickslot wiInventoryItem& wi = plr->loadout_->Items[5]; const BaseItemConfig* itm = g_pWeaponArmory->getConfig(wi.itemID); if(!itm) return 2; //if not from weapon armory int prize = int(itm->m_Weight + 0.5); //convert weight to int prize *= 1000; if(prize < 1) return 2; //remove wi.quantity--; if(wi.quantity == 0) { wi.Reset(); } if(itm->category != storecat_SNP) prize = prize / 4; // 400% bonus for selling sniper rifle //skills 31 & 33 int bonus; if(plr->loadout_->Stats.skillid33 == 1) { //10% bonus bonus = prize / 5; bonus /= 2; prize += bonus; } else if(plr->loadout_->Stats.skillid31 == 1) { //5% bonus bonus = prize / 5; bonus /= 4; prize += bonus; } //log r3dOutToLog("%s - sold %s for $%d\n", plr->loadout_->Gamertag, itm->m_StoreName, prize); //send message PKT_C2C_ChatMessage_s n2; n2.userFlag = 0; n2.msgChannel = 1; char message[128]; sprintf(message, "You have sold %s for $%d", itm->m_StoreName, prize); r3dscpy(n2.msg, message); r3dscpy(n2.gamertag, "<System>"); p2pSendToPeer(plr->peerId_, plr, &n2, sizeof(n2)); //add the prize plr->profile_.ProfileData.GameDollars += prize; return 1; } return 2; }




Reply With Quote![[Release] Sell Gun - Cmd](http://ragezone.com/hyper728.png)


