[TC] Gaming Forums
Help me make .......... - Printable Version

+- [TC] Gaming Forums (https://forum.city-driving.co.uk)
+-- Forum: Community Area (/forumdisplay.php?fid=14)
+--- Forum: Live for Speed Area (/forumdisplay.php?fid=17)
+--- Thread: Help me make .......... (/showthread.php?tid=24268)



Help me make .......... - Siikais1 - 2016-10-27 14:52

Hello guys! Today i want make my own Strobe with commands like /o mw
then insim send on chat:


» If you are not in chase, when the siren shows you a distance of 400 meters or less,
» STOP as fast as possible on the grass or in a safe place and remain there
» until ALL police cars have passed.


RE: Help me make .......... - Adorable - 2016-10-27 15:59

Developing an InSim application requires knowledge of any programming languages, like C#, C++, Java, Python etc.

The most up to date InSim library currently is InSim.Net : https://github.com/alexmcbride/insimdotnet

Here's some code in c# you can use:
Code:
using System;
using System.Threading;
using InSimDotNet;
using InSimDotNet.Packets;

class Program
{
    // Create new InSim object
    static InSim insim = new InSim();
    static void Main()
    {
        // Initailize InSim
        insim.Initialize(new InSimSettings
        {
            Host = "127.0.0.1", // Host where LFS is runing
            Port = 29999, // Port to connect to LFS through
            Admin = String.Empty, // Optional game admin password
            Flags = InSimFlags.ISF_LOCAL,
        });

        // Bind MSO Packet
        insim.Bind<IS_MSO>(MessageOut);


        // Stop program from exiting
        Console.ReadLine();
    }

    static void MessageOut(InSim insim, IS_MSO mso)
    {
        if (mso.UserType == UserType.MSO_O)
        {
            switch (mso.Msg)
            {
                case "mw":
                    insim.Send("» If you are not in chase, when the siren shows you a distance of 400 meters or less,");
                    Thread.Sleep(550);
                    insim.Send("» STOP as fast as possible on the grass or in a safe place and remain there");
                    Thread.Sleep(550);
                    insim.Send("» until ALL police cars have passed.");
                    break;
                default:
                    insim.Send(new IS_MSL { Msg = "LocalInSim - Command not found" });
                    break;
            }
            }

        }
    }



RE: Help me make .......... - Siikais1 - 2016-10-28 15:10

i can't use that code it shows a loot of errors Sad


RE: Help me make .......... - Pete - 2016-10-28 16:03

(2016-10-28 15:10)Siikais1 Wrote:  i can't use that code it shows a loot of errors Sad

Step 1 to getting help, be more specific...


RE: Help me make .......... - Sam - 2016-10-28 16:12

Manners also help (:


RE: Help me make .......... - Siikais1 - 2016-10-28 20:47

If he told that he uses InSim.net then idk about it!! but when i paste that code on insim.net library i get errors like this:

Severity Code Description Project File Line Suppression State
Error CS0246 The type or namespace name 'InSim' could not be found (are you missing a using directive or an assembly reference?) InSimDotNet C:\Users\Siikais\Desktop\insim.net\InSimDotNet\InSim.cs 9 Active