Jump to content

Forums Announcement

Read-Only Mode for Announcements & Changelogs

Dear Survivors, we'd like to inform you that this forum will transition to read-only mode. From now on, it will serve exclusively as a platform for official announcements and changelogs.

For all community discussions, debates, and engagement, we encourage you to join us on our social media platforms: Discord, Twitter/X, Facebook.

Thank you for being a valued part of our community. We look forward to connecting with you on our other channels!

Stay safe out there,
Your DayZ Team

Sign in to follow this  
Maldonado18

Add Itens To HotBar (shortCut)

Recommended Posts

how do i edit my init.c so that a gun can appear on the hotbar?

itemEnt = player.GetInventory (). CreateInInventory ("M4A1"); - In this line, I'm saying that my character will be born with an M4, right? and how do I put this m4 on the shortcut bar? (hotBar) follows the photo.


https://prnt.sc/rk1arj

Share this post


Link to post
Share on other sites

This is how I do it:

private EntityAI weapon1;
weapon1 = player.GetInventory().CreateInInventory("M4A1");
player.SetQuickBarEntityShortcut(weapon1, 0);

The first argument in the last line, "weapon1", refers to the object you want to place in the quickbar. It can be called whatever, as long as you are consistent throughout the code. The second argument, "0", indicates the first quickbar button. Adjust it to your liking.

You can keep adding more weapons like this:

private EntityAI weapon2;
weapon2 = player.GetInventory().CreateInInventory("Glock19");
player.SetQuickBarEntityShortcut(weapon2, 1);

 

Edited by NoBeansForMe

Share this post


Link to post
Share on other sites
Sign in to follow this  

×