Jump to content


Recommended Posts



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);
                        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);
                        GTA.Native.Function.Call("FORCE_LOADING_SCREEN", false);
                        GTA.Native.Function.Call("SET_CAMERA_CONTROLS_DISABLED_WITH_PLAYER_CONTROLS", false);
                        //do that and that


Share this post

Link to post
Share on other sites

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.



Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now