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.

"DRAW_COLOURED_CYLINDER" issues

Featured Replies

Hey

 

This isn't LCPDFR API related, but more C# related.

 

I want to draw a coloured cylinder, and then when the player walks in, do things, but i have 2 problems:

1) the cylinder appear then disappear immediately.

2) even if the cylinder disappear, i try and walk where it's supposed to be, but nothing happens.

 

I do not have any errors, but everything after the part where i draw a coloured cylinder, do not work, after some research it came to my attention, that i have to add this native function into a loop in order for it, to works, but when i do that (in a while): my game freeze and crash ...

Here is a part of the code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GTA;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Drawing;
using System.IO;
using System.Reflection;

double 1_x = -271.885, 1_y = 1542.18, 1_z = 20.4199;
GTA.Native.Function.Call("DRAW_COLOURED_CYLINDER", 1_x, 1_y, 1_z, -2, 0.80000000, 255, 0, 0, 0);

if (Player.Character.Position.DistanceTo(new Vector3(-271.885f, 1542.18f, 20.4199f)) < 1.0f)
                    {

                        user_choice = 1;
                        GTA.Native.Function.Call("FORCE_LOADING_SCREEN", true);
                        Wait(6000);
                        GTA.Native.Function.Call("CLEAR_AREA",1_x,1_y, 1_z, 50f);
                        GTA.Native.Function.Call("SET_CAMERA_CONTROLS_DISABLED_WITH_PLAYER_CONTROLS", true);
                        spawn();
                        GTA.Native.Function.Call("FORCE_LOADING_SCREEN", false);
                        GTA.Native.Function.Call("SET_CAMERA_CONTROLS_DISABLED_WITH_PLAYER_CONTROLS", false);
                        //do that and that
                    }

Thanks.

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

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

 

  • Management Team

Hello gangrenn,

 

you're right, you have to put it in a loop. However you mustn't use a while loop as that will never return and thus the game freezes (as you have experienced). You have to put it into your Tick function and call it every Tick in order to be visible. I'll see if I can add our class for the arrow to the API so you have an easy to use class which fires an event once the player is standing in the arrow and draws itself.

 

LMS

Please do not PM me unless really necessary (knowing you helps). If you think you need my attention in a topic, tag me.

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.