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.

coding questions

Featured Replies

Hi

I'm trying to make a script (in C, using Microsoft Visual C# 2010 Express) for gta4, but as i'm new to this, i have a few questions:

1) how to play an audio file (mp3) in gta4 ?

2) let's say, i want to select a random location, how do i do that, do i have to write all possible locations, and then using a function to select one ?

3) how can i get locations positions (X;Y) ?

Thanks.

Edited by gangrenn

My youtube channel: https://www.youtube.com/user/gangrenn

Seagrave & pierce engine / ladder for GTA5: https://www.facebook.com/3DEmergencyVehicleModdingStudio/

 

1) Not sure, but I think you have to use the default sound players (which I also don't know how to use, but they should be reasonably well-documented)

2) Random location in what context? If you want to select a location around the player, something like GetLocationAround() (I *believe* the call for it is Player.Character.Position.GetLocationAround(float radius), though it may be something like World.GetLocationAroundPlayer().

If you want a random location out of a predefined set (say, you want to pick a random Burger Shot), yes, you should make a list and randomly pick an element.

3) Once you have a Vector3 loc for the location, loc.X and loc.Y get you the coordinates.

Edited by cp702

there are many tutorials on youtube search on there also this should be in random thanks

I don't really think there are tutorials to get random locations.. It is the best to ask fellow scripters. He did well by creating this topic, I would've done the same if I was desperate towards help.

And no this shouldn't be in Random, this is Grand Theft Auto IV related.

[url=http://www.gtagaming.com/downloads/author/145769]sy10Oxj.png[/url]

CLICKY

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...

Similar Content

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.