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  
Zze

having a problem trying to get a random int..

Recommended Posts

hey, i am trying to set a random integer to set a random amount of rubles on a player at spawn...

so far i've tried

int cashrd = int.Parse(Math.RandomIntInclusive(8,348));

  - returns a string for some reason xD?
 

int cashrnd = random 348;  

-fucks off and thinks there isn't a semicolon :/

am I just stupid or what am i doing wrong :3?
 

Share this post


Link to post
Share on other sites

Using just this without int.Parse should work. It already returns an integer.

int cashrd = Math.RandomIntInclusive( 8, 348 );

This isn't valid code:

int cashrnd = random 348;

 

Share this post


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

×