Newbie Spellweaver
- Joined
- Nov 9, 2013
- Messages
- 82
- Reaction score
- 57
Heyyo!
How annoying is it, to search for id of your wanted mag and then writing down /gi <itemid of magazine> just to give yourself ONE crappy magazine? How about like 10+ mags? :glare:
I became really frustrated while I had to test something with guns!
Yeez! xD
So here it is.
A simple cmd that will give ya mags for you current weapon that you are holding in your hands.
Completely server-sided with a simple command /ammo
Search in ServerGameLogic.cpp
Add BELOW
Search for
Add ABOVE
You might want to add return values.![Stick out tongue :p :p](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Now search in ServerGameLogic.h
Add BELOW
When you use this on Crossbow it will give you 2x Arrow stacked, another statement needed.
tt1:
PS: I will update these codes once I release more stuff later.
How annoying is it, to search for id of your wanted mag and then writing down /gi <itemid of magazine> just to give yourself ONE crappy magazine? How about like 10+ mags? :glare:
I became really frustrated while I had to test something with guns!
Yeez! xD
So here it is.
A simple cmd that will give ya mags for you current weapon that you are holding in your hands.
Completely server-sided with a simple command /ammo
Search in ServerGameLogic.cpp
Code:
if(strncmp(cmd, "/gi", 3) == 0 && plr->profile_.ProfileData.isDevAccount)
return Cmd_GiveItem(plr, cmd);
Add BELOW
Code:
if(strncmp(cmd, "/ammo", 5) == 0 && plr->profile_.ProfileData.isDevAccount)
return Cmd_Ammo(plr, cmd);
Search for
Code:
int ServerGameLogic::Cmd_SetVitals(obj_ServerPlayer* plr, const char* cmd)
{
Add ABOVE
Code:
int ServerGameLogic::Cmd_Ammo(obj_ServerPlayer* plr, const char* cmd)
{
//lets get the weapon config from the selected weapon
ServerWeapon* wpn = plr->m_WeaponArray[plr->m_SelectedWeapon];
//statements, you might want to add more?
if(wpn && wpn->getCategory() != storecat_MELEE)
{
//get clip config from wpn
const WeaponAttachmentConfig* clip = wpn->getClipConfig();
//basicly lets just take the weapon item for our clip item
wiInventoryItem wi;
wi = plr->loadout_->Items[plr->loadout_->CHAR_LOADOUT_WEAPON1];
wi.itemID = clip->m_itemID; //now overrides with clip item id
wi.quantity = 2; //set how many mags per command you want!
wi.Var1 = clip->m_Clipsize; //set max clipsize from the clip config
//add it to the backpack
plr->BackpackAddItem(wi);
}
return 0;
}
You might want to add return values.
Now search in ServerGameLogic.h
Code:
int Cmd_GiveItem(obj_ServerPlayer* plr, const char* cmd);
Add BELOW
Code:
int Cmd_Ammo(obj_ServerPlayer* plr, const char* cmd);
When you use this on Crossbow it will give you 2x Arrow stacked, another statement needed.
PS: I will update these codes once I release more stuff later.
Last edited: