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.

Modding Question (C#, IV)

Featured Replies

Ok I've been irritated with the fact when ingame you cant ever tell who the host is. I have spent the past 3 days trying diffrent things in C# trying to make it so I can figure out who the ingame host is without having to leave and rejoin.

All of which has failed.

Especially attempting to bind a console command.

	   public ConsoleCMD()

	   {

		   //Code

		   BindConsoleCommand("gethost", new ConsoleCommandDelegate(consoleHandle));

	   }

	   public void consoleHandle()

	   {

		   //code

	   }

What irritates me is that I keep getting "No overload for 'consoleHandle' matches delegate 'GTA.ConsoleCommandDelegate"

Any pointers on how to fix that error? (Mostly the fact I dont understand it results in the fact i cant fix it.)

[center][url="http://steamcommunity.com/id/Darth_Revan"][img]http://i1192.photobucket.com/albums/aa340/iconography1/Revan3.jpg[/img][/url] [color=#ff8c00][i][b]Thanks Iconography[/b][/i][/color] OS #1: Windows 7 x64 CPU: AMD Phenom II X4 940 ~3.0Ghz --- GPU: Nvidia GTS 250 (1GB) --- RAM: 4GB Keyboard: Logitech G15 --- Mouse: Logitech G500[/center]

Um..

The host is usually the guy with the orange name tag.

Unless of course, he leaves upon which it migrates to the second person who joined (which is usually red)

Processor: Intel i5-6600 @ 3.30GHz 

GPU: MSI ARMOR GeForce GTX 1080 OC

Ram: 16GB Skylake

  • Author

Thats the thing. Modded Multiplayer crashes so much you cant ever tell who the host is without rejoining. So i was hoping to just make a small script so I can know who the host is. If you ever hang out in a large lobby with a bunch of people and no one knows who the host is. it becomes really confusing.

It got to the point we all took turns modifying the weather and asking it it affect anyone else just to find out who was the host. since the host can freely modify the weather and it updates on all other clients.

[center][url="http://steamcommunity.com/id/Darth_Revan"][img]http://i1192.photobucket.com/albums/aa340/iconography1/Revan3.jpg[/img][/url] [color=#ff8c00][i][b]Thanks Iconography[/b][/i][/color] OS #1: Windows 7 x64 CPU: AMD Phenom II X4 940 ~3.0Ghz --- GPU: Nvidia GTS 250 (1GB) --- RAM: 4GB Keyboard: Logitech G15 --- Mouse: Logitech G500[/center]

  • Management Team


			public ConsoleCMD()

			{

				BindConsoleCommand("gethost", new GTA.ConsoleCommandDelegate(this.consoleHandle));

			}

			public void consoleHandle(GTA.ParameterCollection _params)

			{

				GTA.Game.Console.Print("The host is: " + this.NetworkGetHostServerName());

			}

			public static string NetworkGetHostServerName()

			{

				return GTA.Native.Function.Call<string>("NETWORK_GET_HOST_SERVER_NAME");

			}

I don't see why you need it though, unless you're trying to do something nefarious.

EDIT: nvm, saw your post above

  • Author

I wasnt expecting the code to be completed for me honestly, but I had to make some adjustments to get it working in C# (it wouldnt compile at all) it returns "The host is:" but it doesnt provide the actual information, it just leaves it blank. so im assuming it has to do with the fact i had to strip "static" from NetworkGetHostServerName() to get it to compile.

Gonna fiddle with it some more and see if i can get it work. Your code you posted made mine look like utter crap. lmfao

[center][url="http://steamcommunity.com/id/Darth_Revan"][img]http://i1192.photobucket.com/albums/aa340/iconography1/Revan3.jpg[/img][/url] [color=#ff8c00][i][b]Thanks Iconography[/b][/i][/color] OS #1: Windows 7 x64 CPU: AMD Phenom II X4 940 ~3.0Ghz --- GPU: Nvidia GTS 250 (1GB) --- RAM: 4GB Keyboard: Logitech G15 --- Mouse: Logitech G500[/center]

  • Management Team

The function below will return true if the local pc is the host, false otherwise:


		public static bool IsThisMachineTheServer()

		{

			return Function.Call<bool>("IS_THIS_MACHINE_THE_SERVER");

		}

Please do not PM me unless really necessary (knowing you helps). If you think you need my attention in a topic, tag me.

  • Author

I got it semi working. Thank you LMS and Jay. Still needs worked on but ill get it eventually. but you guys got me going better than what i had.

[center][url="http://steamcommunity.com/id/Darth_Revan"][img]http://i1192.photobucket.com/albums/aa340/iconography1/Revan3.jpg[/img][/url] [color=#ff8c00][i][b]Thanks Iconography[/b][/i][/color] OS #1: Windows 7 x64 CPU: AMD Phenom II X4 940 ~3.0Ghz --- GPU: Nvidia GTS 250 (1GB) --- RAM: 4GB Keyboard: Logitech G15 --- Mouse: Logitech G500[/center]

This is a support topic.
Only reply here to offer help or assistance to Revan. Off-topic or "me too" replies will be removed.

Need support yourself? Make a new topic instead.

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.