Jump to content

Search the Community

Showing results for tags 'events'.

  • 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 8 results

  1. Greeting, for the love of God please allow extended entities on events again. I wanted to update a server to the latest release and the only thing I got was bugs because of this. Sincerely devgosling
  2. So, i was on my way to create a simple practice Script. Everything fine so far, my ClientSide Menu opens etc. The button activation gets fired and is from the correct element. The the Remote Event should trigger which does not seem to happen. Any Thoughts where i messed up? So far i received no Error what so ever. Server Side Main.cs (Snippet) [RemoteEvent("VehicleSpawn")] public void VehicleSpawn(Player player, bool locked, bool engine, string vehName) { player.SendChatMessage("Got called"); uint vHash = NAPI.Util.GetHashKey(vehName); player.SendChatMessage(vHash.ToString()); NAPI.Vehicle.CreateVehicle(vHash, player.Position.Around(5), 0.0f, 0, 0, locked: locked, engine: engine); } Client Side Main Class public class Main : Events.Script { public Main() { Events.Add("playRP.CMD.vehicle", VehicleNative); } public void VehicleNative(object[] args) { Chat.Show(false); RAGE.Ui.Cursor.Visible = true; MenuPool mPool = new MenuPool(); UIMenu VehicleMenu = new UIMenu("Spawner","Spawn your desired Vehicle"); mPool.Add(VehicleMenu); bool Locked = false; bool Engine = true; UIMenuCheckboxItem locked = new UIMenuCheckboxItem("Locked?", false); UIMenuCheckboxItem engine = new UIMenuCheckboxItem("Engine On?", true); VehicleMenu.AddItem(locked); VehicleMenu.AddItem(engine); var vehNames = new List<dynamic> { "Infernus", "Cheetah", "Dominator" }; string selectedVeh = vehNames[0]; UIMenuListItem VehicleName = new UIMenuListItem("Vehicle", vehNames, 0); VehicleMenu.AddItem(VehicleName); UIMenuItem CreateButon = new UIMenuItem("Create Vehicle!"); VehicleMenu.AddItem(CreateButon); VehicleMenu.OnCheckboxChange += (sender, item, flag) => { if(sender == VehicleMenu) { if (item == locked) Locked = flag; else if (item == engine) Engine = flag; } }; VehicleMenu.OnListChange += (sender, item, index) => { if(sender == VehicleMenu) { if(item == VehicleName) { selectedVeh = item.IndexToItem(index).ToString(); } } }; CreateButon.Activated += (sender, item) => { if(sender == VehicleMenu) { if(item == CreateButon) { Chat.Output("CALLED ACTIVATED"); Events.CallRemote("VehicleSpawn", locked, engine, selectedVeh); Chat.Show(true); VehicleMenu.Visible = false; VehicleMenu.FreezeAllInput = false; RAGE.Ui.Cursor.Visible = false; } } }; VehicleMenu.OnMenuClose += (sender) => { if(sender == VehicleMenu) { Chat.Show(true); VehicleMenu.Visible = false; VehicleMenu.FreezeAllInput = false; RAGE.Ui.Cursor.Visible = false; } }; VehicleMenu.Visible = true; VehicleMenu.FreezeAllInput = true; VehicleMenu.RefreshIndex(); Events.Tick += (name) => { mPool.ProcessMenus(); }; } } Thanks in Advance for helping and hopefully pointing out the Obvious ^^
  3. https://wiki.rage.mp/index.php?title=EventTriggeredByKey As i understood, it should give me the keyCode of the player's pressed key in the first parameter, but it gives nothing.. When this event triggers?
  4. ok simple, what am i doing wrong? Yes I am new to JS: Serverside: mp.events.add('testEvent',(para1,para2,para3) => { console.log('para1:'+para1); console.log('para2:'+para2); console.log('para3:'+para3); }); Clientside: mp.events.callRemote('testEvent',1,2,3); Console: para1:[object Object] para2:1 para3:2 thanks for help! Hank edit: discovered https://wiki.rage.mp/index.php?title=Getting_Started_with_Events
  5. Привет! Сегодня поговорим о событиях Ссылка на проект: https://github.com/SirEleot/RageMpTutorial.git
  6. Hey, Im new to the RAGE-MP. I started moving from GT-MP and have issue with events. PlayerConnected doesn't trigger also PlayerDisconnected tells me that i have wrong number of parameters dispite using sample code. using GTANetworkAPI; namespace RP { public class ConnectionHandler : Script { [ServerEvent(Event.PlayerConnected)] public void OnPlayerConnect(Client player) { NAPI.Util.ConsoleOutput("Connected"); World.Players.Add(player, new Player(player)); } [ServerEvent(Event.PlayerDisconnected)] public void OnPlayerDisconnect(Client player, DisconnectionType type, string reason) { if(type == DisconnectionType.Left) NAPI.Chat.SendChatMessageToAll("~b~" + player.Name + "~w~ left. " + reason); World.Players.Remove(player); } } } I downloaded GTANetworkAPI version 3.6 as NuGet Package
  7. Hello, I started some days ago scripting a new server, lot of information is missing or need to be found in some external examples, but anyway, the most part I found it. But when started with clientside, I can't understand the way it works. So then, from JS called from HTML, you need to use mp.triggers(). Ok. If you call from (for example) client package "Test", file "Index.js", you can use mp.game.player object to access to the local player that triggered that event, ok. But the weird thing is, and my questions are : 1. In the Wiki, there are two sections on player commands, the top one (related with entities) and the bottom one ( related with ?? ), this last ones ( bottom) works well with mp.game.player, but the other ones I can't get them working ( apparently doesn't exists). So the first question is, how to access the first ones. 2. The second one is, if I want to sync a local even, for example an animation, from each local clientside player, do I have to do like this?? : /* Event call from server to all players */ mp.events.add('playerStartedAnim', function(targetPlayer, animation1, animation2){ /* loop through players until find the one that wants to play animation */ mp.players.forEach(function(pl){ if(pl.name == targetPlayer){ /* play animation ??*/ pl.taskPlayAnim(animation1,animation2,8.0,1,-1,49,1.0,false,false,false); } }); }); Well, above code is not working because the question 1, so take it like an example for what I'm asking. Thanks a lot for reading and thanks for advance.
  8. Merksk8

    Add Events

    Hello, Talking in discord, I heard that there are events implemented that are not on the Wiki. Would be amazing to know them, at least a simple list with name events to test them, or if there are other way to know them, I would appreciate to know how. Thanks a lot, rage-mp seems to work perfect, so thanks for your work.
×
×
  • Create New...