DayZ
dzr_notes
DZR|Mikhail  [developer] 10 Jun @ 4:23am
Spawn multiple notes in starting gear
Add this code to your init.c into the StartingEquipSetup class after SetRandomHealth( itemEnt );:

itemEnt = player.GetInventory().CreateInInventory( "DZR_PaperWrittenAdmin_Red" ); DZR_PaperWrittenAdmin_Red red_note = DZR_PaperWrittenAdmin_Red.Cast( itemEnt ); WrittenNoteData m_NoteContents = new WrittenNoteData(red_note); m_NoteContents.SetNoteText("Here goes your text\r\nAnd the second line. Use \r\n to start new lines of thext."); red_note.SetPaperWrittenText(m_NoteContents);

Now make the second code with different note, but use different variable names, add "2","3" etc., for example we add a green note after the red note:

itemEnt = player.GetInventory().CreateInInventory( "DZR_PaperWrittenAdmin_Green" ); DZR_PaperWrittenAdmin_Red green_note = DZR_PaperWrittenAdmin_Green.Cast( itemEnt ); WrittenNoteData m_NoteContents2 = new WrittenNoteData(green_note); m_NoteContents2.SetNoteText("Another note, but green. Here goes your text\r\nAnd the second line. Use \r\n to start new lines of thext."); green_note .SetPaperWrittenText(m_NoteContents2);

Pay attention, we changed in all places:
  • DZR_PaperWrittenAdmin_Red → DZR_PaperWrittenAdmin_Green
  • NoteContents → NoteContents2
  • red_note → green_note
Last edited by DZR|Mikhail; 10 Jun @ 4:23am