- Joined
- Nov 28, 2014
- Messages
- 484
- Reaction score
- 286
So my brothers already have a tutorial that here in ragezone but not as complex as this. So I bring this to you friends
search for:
search for:
Code:
if(!win::bSuspended && !hudMain->isChatInputActive() && !hudMain->isPlayersListVisible())
{
bool showHudPause = Keyboard->WasPressed(kbsEsc);
if(!hudPause->isActive() || (hudPause->isActive() && !hudPause->isDisabledHotKeys()))
showHudPause = showHudPause || InputMappingMngr->wasReleased(r3dInputMappingMngr::KS_SWITCH_MINIMAP) || InputMappingMngr->wasReleased(r3dInputMappingMngr::KS_INVENTORY);
if(showHudPause && !hudAttm->isActive() && !hudVault->isActive() && !hudStore->isActive() && !hudSafelock->isActive() && !hudTrade->isActive() && !hudRepair->isActive() && !hudCraft->isActive())
{
if(!hudPause->isActive())
{
hudPause->Activate();
if(InputMappingMngr->wasReleased(r3dInputMappingMngr::KS_SWITCH_MINIMAP))
hudPause->showMap();
else if(InputMappingMngr->wasReleased(r3dInputMappingMngr::KS_INVENTORY))
hudPause->showInventory();
}
else
hudPause->Deactivate();
}
if((Keyboard->WasPressed(kbsEsc)) && hudVault->isActive())
hudVault->Deactivate();
if((Keyboard->WasPressed(kbsEsc)) && hudRepair->isActive())
hudRepair->Deactivate();
Add Bellow:
Code:
// DouglasPRO:: NEW LOGIC THE OPEN SHOP, IN GAME !
if(gClientLogic().m_gameInfo.channel == 3 || gClientLogic().m_gameInfo.channel == 4)
{
bool showStore = InputMappingMngr->wasPressed(r3dInputMappingMngr::KS_SHOW_STORE); //DouglasPRO
if(showStore && !hudAttm->isActive() && !hudVault->isActive() && !hudSafelock->isActive() && !hudTrade->isActive() && !hudRepair->isActive())
{
if(!hudStore->isActive())
{
if(hudPause->isActive())
hudPause->Deactivate();
hudStore->Activate();
}
else
hudStore->Deactivate();
}
}
if((Keyboard->WasPressed(kbsEsc)) && hudCraft->isActive())
hudCraft->Deactivate();
if((Keyboard->WasPressed(kbsEsc)) && hudSafelock->isActive())
hudSafelock->Deactivate();
// DouglasPRO :: DO NOT Deactivate() trade by escape
if((Keyboard->WasPressed(kbsEsc)) && hudTrade->isActive())
hudTrade->requestClose();
if((Keyboard->WasPressed(kbsEsc)) && hudStore->isActive())
hudStore->Deactivate();
search for:
Code:
m_Mapping[KS_SHOW_CRAFT_MENU] = KeyboardMapping(INPUTMAP_KEYBOARD, kbsK, "$HUD_Cntrl_ShowCraftMenu", false);
Add Bellow
Code:
m_Mapping[KS_SHOW_STORE] = KeyboardMapping(INPUTMAP_KEYBOARD, kbsF10, "$HUD_Cntrl_ShowStore", false); // DouglasPRO:: NEW LOGIC THE OPEN SHOP, IN GAME !
search for:
Code:
KS_INVENTORY,
Add Bellow
Code:
KS_SHOW_STORE, // DouglasPRO:: NEW LOGIC THE OPEN SHOP, IN GAME !
if someone gives you trade in this will return
Code:
void HUDTrade::eventTradeDecline(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount)
{
eventReturnToGame(pMovie, args, argCount);
}
Add Bellow
Code:
void HUDTrade::eventReturnToGame(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount)
{
requestClose();
// DouglasPRO :: DO NOT deactivate - wait for server to respond.
//Deactivate();
}
search for:
Code:
void HUDTrade::showNoWeight()
{
Scaleform::GFx::Value var[3];
var[0].SetString(gLangMngr.getString("TradeOtherNoWeight"));
var[1].SetBoolean(true);
var[2].SetString("");
gfxMovie.Invoke("_root.api.showInfoMsg", var, 3);
gfxMovie.Invoke("_root.api.Main.setUserTradeIndicator", false);
isUserIndicatorOn = false;
}
Add Bellow
Code:
void HUDTrade::requestClose()
{
if(isCloseRequested)
return;
isCloseRequested = true;
PKT_C2C_TradeRequest_s n;
n.code = PKT_C2C_TradeRequest_s::TRADE_Close; // DouglasPRO:: FUCKING ****
n.targetId = 0;
p2pSendToHost(gClientLogic().localPlayer_, &n, sizeof(n));
}
search for
Code:
void setOpposeTradeIndicator(bool set);
Add Bellow
Code:
void requestClose(); //DouglasPRO
search for
Code:
DEFINE_GAMEOBJ_PACKET_HANDLER(PKT_C2C_PlayerReload);
Add Bellow
Code:
DEFINE_GAMEOBJ_PACKET_HANDLER(PKT_C2C_TradeRequest); // DouglasPRO
search for
Code:
struct PKT_C2C_TradeRequest_s : public DefaultPacketMixin<PKT_C2C_TradeRequest>{
enum EOp
{
TRADE_Request, // C2C
TRADE_Answer, // C2S
TRADE_Open,
TRADE_Close,
TRADE_Confirm, // S2C: other player accept set
TRADE_Clear, // S2C: other player accept cleared
TRADE_Busy, // other player is busy
TRADE_NoSpace, // other player don't have enough free space
TRADE_NoWeight, // other player can't carry
};
PKT_C2C_TradeRequest_s() {}
PKT_C2C_TradeRequest_s(BYTE in_code, const GameObject* target)
{
code = in_code;
targetId = toP2pNetId(target->GetSafeNetworkID());
}
gp2pnetid_t targetId;
BYTE code;
};
replace code
Code:
struct PKT_C2C_TradeRequest_s : public DefaultPacketMixin<PKT_C2C_TradeRequest>
{
enum EOp
{
TRADE_Request, // C2C
TRADE_Answer, // C2S
TRADE_Open,
TRADE_Close,
TRADE_Confirm, // S2C: other player accept set
TRADE_Clear, // S2C: other player accept cleared
TRADE_Busy, // other player is busy
TRADE_NoSpace, // other player don't have enough free space
TRADE_NoWeight, // other player can't carry
};
PKT_C2C_TradeRequest_s() {}
PKT_C2C_TradeRequest_s(BYTE in_code, const GameObject* target)
{
code = in_code;
targetId = toP2pNetId(target->GetSafeNetworkID());
}
gp2pnetid_t targetId;
BYTE code;
};
TUTORIAL FINISHED FRIENDS GOODBYE
Credits
@DouglasPro
TheHexa :: some things
ADD REPUTATION AND LIKE FRIENDS
tt:
tt:
tt1:
Credits
@DouglasPro
TheHexa :: some things
ADD REPUTATION AND LIKE FRIENDS

