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.

How to Show a text notification on keyPress

Featured Replies

The goal is to execute a function when the player presses a key. How do i do it? Eg When I press "U" I want to show Hello world on the console log

Edited by kukupie

  • The title was changed to How to Show a text notification on keyPress
9 hours ago, kukupie said:

The goal is to execute a function when the player presses a key. How do i do it? Eg When I press "U" I want to show Hello world on the console log

Before I can answer that, is this for a callout or a plugin? If it is for a callout then you have to code this in the Process() method. You also need to reference System.Windows.Forms for this.


if (Game.IsKeyDown(System.Windows.Forms.Keys.U)) {

             Game.LogTrivial("Hello World");

}

 

Tell me if you are asking this for making a plugin or you were asking this for making a callout.

Edited by PTurtle

GRAY

  • Author
2 hours ago, PTurtle said:

Before I can answer that, is this for a callout or a plugin? If it is for a callout then you have to code this in the Process() method. You also need to reference System.Windows.Forms for this.


if (Game.IsKeyDown(System.Windows.Forms.Keys.U)) {

             Game.LogTrivial("Hello World");

}

 

Tell me if you are asking this for making a plugin or you were asking this for making a callout.

Hey thanks I got it to work. I am working on a plugin. I have one more issue I will be more than greatful if you could help me,

1) How do I find if an NPC has been taken down (Take down by holding E)? 

Functions.IsPedStoppedByPlayer(suspect);

This doesn't work on take downs and only works on ped that i take to and make them stop.

 

2nd) How do i find if an NPC is a part of pursuit or a suspect ?

I can't find the function to call for this

Edited by kukupie

22 hours ago, kukupie said:

Hey thanks I got it to work. I am working on a plugin. I have one more issue I will be more than greatful if you could help me,

1) How do I find if an NPC has been taken down (Take down by holding E)? 

Functions.IsPedStoppedByPlayer(suspect);

This doesn't work on take downs and only works on ped that i take to and make them stop.

 

2nd) How do i find if an NPC is a part of pursuit or a suspect ?

I can't find the function to call for this

This is the answer to the second one. I will answer the first one in new help ticket you have made. So for the second one, to check if a ped is part of a pursuit, you just do Functions.IsPedInPursuit(Ped ped). That should check whether the ped is in a pursuit or not.

 

GRAY

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.