Skip to content
View in the app

A better way to browse. Learn more.

LCPDFR.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Help with random int

Featured Replies

Hey guys, I have another problem. I'm making a callout in which there are 2 possibilities of what can happen. One is when you ring the doorbell of the house, the suspect will open up, the second is that another person will open the door. I'm using this for these possibilities:

 int r_talk = new Random().Next(1, 2);

If r_talk is 1, the suspect spawns, if it's 2 then non-suspect spawns. I have to define the variable at the beginning of the code so it stays the same during whole callout, because if not, a thing can happen where the suspect spawns and he acts like the non-suspect. My problem is, when the r_talk is chosen to be 1 or 2, it will stay the same during the whole game session, so if I repeat the callout, the outcome will be the same, e.g. the suspect will spawn every time. So, is there a way to randomize it over and over again every time the callout is accepted? Thanks in advance

Edited by kicdjo

You probably need to define the variable on the class, but don't initialize it until OnBeforeCalloutDisplayed or OnCalloutAccepted. 

[REL] Coastal Callouts: An action-packed mod with new vehicles, maps, capabilities, and callouts in and around the waters of Los Santos

[REL] Police Tape: Make your scenes more realistic while stopping peds and traffic

[REL] Better EMS: Realistic and dynamic EMS response

Join the Parks Benefactor Program to support my work and get early beta access!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.