Jump to content

Search the Community

Showing results for tags 'Natives'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • RAGE Multiplayer
    • Announcements
    • Discussion
    • Suggestions
  • Scripting
    • Scripting
    • Resources
  • Community
    • Support
    • Servers
    • Media Gallery
  • Non-English
    • Русский - Russian
    • Français - French
    • Deutsch - German
    • Espanol - Spanish
    • Română - Romanian
    • Portuguesa - Portuguese
    • Polski - Polish

Categories

  • Scripts
  • Gamemodes
  • Libraries
  • Plugins
  • Maps
  • Tools

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Facebook


Youtube


Skype


Web


VK

Found 2 results

  1. Hey folks! I am currently trying to get the original events as I need a specific event that is not provided by Rage. I have tried using javascript to read the events using the three natives: - GET_NUMBER_OF_EVENTS - GET_EVENT_AT_INDEX - GET_EVENT_DATA Reading the events and outputting the eventId works fine, but I can't read the eventdata. I thought maybe it was just JavaScript and wrote a script in C# for it. Unfortunately I have the same problem there: GET_EVENT_DATA always returns FALSE and the passed variable 'eventData' does not change. The Script: using System; using System.Collections.Generic; using RAGE; namespace ClientEvents { public class Main : RAGE.Events.Script { public Main() { RAGE.Events.Tick += this.OnTick; } public void OnTick(List<Events.TickNametagData> nametags) { int eventGroup = 0; for (int eventIndex = 0; eventIndex < RAGE.Game.Invoker.Invoke<int>(RAGE.Game.Natives.GetNumberOfEvents, eventGroup); eventIndex++) { int eventId = RAGE.Game.Invoker.Invoke<int>(RAGE.Game.Natives.GetEventAtIndex, eventGroup, eventIndex); int[] eventData = new int[32]; Chat.Output($"Event {eventId} was fired."); if (!RAGE.Game.Invoker.Invoke<bool>(RAGE.Game.Natives.GetEventData, eventGroup, eventIndex, eventData, 32)) { Chat.Output("Failed to retrieve EventData"); } } } } }
  2. For those you want to use the natives functions here's a file that will help you. Link : https://github.com/Mcfloy/natives To use it simply add it on your folder and type : const NATIVES = require('folder/natives'); Only JS for now, I'll probably do a TS one based on the work of CocaColaBear or Pet-Platoon. (A little example to show you how to get infinite ammo) var weaponHash = NATIVES.WEAPON.GET_SELECTED_PED_WEAPON(player.handle); mp.game.graphics.notify(`Result: ${weaponHash}`); NATIVES.WEAPON.SET_PED_INFINITE_AMMO(player.handle, true, weaponHash);
×
×
  • Create New...