Jump to content
RAGE Multiplayer Community

Generic Native Keypad 1.0.0

   (0 reviews)

1 Screenshot

About This File

Originally created around 2019, so it might be broken with newer versions of RageMP, though I believe I fixed this at some point.

The system allows you to set up a keypad server-side and hook an action to the Confirm button in the keypad. The action is invoked server-side and as argument you get the value which the user put in the keypad client-side. You can set the title, subtitle and even control if the input in the field will be asterisks for cases where the player would be typing a pin etc.

The entire keypad requires no CEF at all, and no web related dependencies. Instead the whole thing is defined and rendered using native GTA:V UI elements.

Getting started

To get started put the keypad.js in your client folder and remember to include it in the index.js. Then grab the KeypadLibrary.cs and put it in your server project. With this you are ready to create keypads wherever you need them. Invoke the following function:

StartKeypadForPlayer(Player player, string title, string subTitle, bool useAsterisk, Action<Player,int> callback)

as such:

KeypadLibrary.StartKeypadForPlayer(
    ply, "Withdraw", 
    $"Current bank balance: ~g~${ply.cash}", 
    false, 
    (ply, x) =>
    {
        ply.SendChatMessage("You are withdrawing: " + x);
    });

The system supports all native colors from GTA:V so you can color the title and subtitle if needed.

Here's the GitHub link for those interested https://github.com/Andreas1331/ragemp-keypad

 Share


User Feedback

Join the conversation

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

Guest
×
×
  • Create New...