Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20

Thread: Help libcod windows

  1. #11
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    Quote Originally Posted by Lucky View Post
    Why libcod dont work?

    Attachment 835
    Attachment 836
    So far i can see it did work.

    Edit: it says PLUGIN LOADED and the lines in the injector look ok.
    Last edited by Mitch; 8th February 2015 at 16:41.

  2. #12
    ... connecting
    Join Date
    Dec 2014
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    what did you mean?
    Pls help me with run libcod on windows.

  3. #13
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    Quote Originally Posted by Lucky View Post
    what did you mean?
    Pls help me with run libcod on windows.
    Try this in your _menus.gsc

    PHP Code:
    onMenuResponse()
    {
        for(;;)
        {
            
    self waittill("menuresponse"menuresponse);
            
    //iprintln("^6", response);
            
            
    if(response == "libcodtest")
            {
                
    self iprintln("IP: " self getIP());
                
    self iprintln("Ping: " self getPing());
                
    self iprintln("Jump: " self jumpButtonPressed());
                
    self iprintln("Velocity: " self getVelocity());
            }
            
            if(
    response == "libcodtest2")
            {
                
    self setVelocity((0,0,1000));
            } 
    Now in game type this in your console:
    /openscriptmenu -1 libcodtest
    /openscriptmenu -1 libcodtest2

  4. #14
    ... connecting
    Join Date
    Dec 2014
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    if(response == "libcodtest")
    {
    self iprintln("Velocity: " + self getVelocity());
    }

    if(response == "libcodtest2")
    {
    self setVelocity((0,0,1000));
    }
    Error:Unknown Function.
    If i put
    getVelocity()
    {
    player = self;

    functionid = 1;
    playerid = player getEntityNumber();
    ret = closer(functionid, playerid);
    //iprintln("ret=", ret);
    return ret;
    }

    setVelocity(velocity)
    {
    player = self;

    functionid = 0;
    playerid = player getEntityNumber();
    x = velocity[0];
    y = velocity[1];
    z = velocity[2];
    ret = closer(functionid, playerid, x, y, z);
    }
    And use in game console:
    /openscriptmenu -1 libcodtest or /openscriptmenu -1 libcodtest2
    Nothing happens

  5. #15
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    We aren't using closer anymore for our functions in libcod.

    You can now just call 'player getVelocity()' when libcod has been loaded.
    (Windows supports only the basic functions compared to Linux version)

    (Short support list: mysql_..., Cmd_ExecuteString, printf, ..Velocity, ...ButtonPressed, getPing, getIP)

  6. #16
    ... connecting
    Join Date
    Dec 2014
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    help me)

    Click image for larger version. 

Name:	скрин3.png 
Views:	36 
Size:	76.2 KB 
ID:	837

  7. #17
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Don't start your server with "map command" and then inject the .dll-file. After that, you can load a map (which will load the scripting engine). Otherwise you want to use functions, which are not registered yet.
    timescale 0.01

  8. #18
    ... connecting
    Join Date
    Dec 2014
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I start server
    getVelocity() work but setVelocity and getIP() and other functions kill my server.Why?

  9. #19
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Define "crash my server"... does it crash at runtime? Does it crash start? Any error message?

    When getVelocity() works but no other functions, I suspect you still have the closer-stuff in.
    timescale 0.01

  10. #20
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    Start the server without setting the map. Then inject dll. Start a map and it works

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •