what did you mean?
Pls help me with run libcod on windows.
Try this in your _menus.gsc
Now in game type this in your console:PHP Code:
onMenuResponse()
{
for(;;)
{
self waittill("menuresponse", menu, response);
//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));
}
/openscriptmenu -1 libcodtest
/openscriptmenu -1 libcodtest2
Error:Unknown Function.if(response == "libcodtest")
{
self iprintln("Velocity: " + self getVelocity());
}
if(response == "libcodtest2")
{
self setVelocity((0,0,1000));
}
If i put
And use in game console: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);
}
/openscriptmenu -1 libcodtest or /openscriptmenu -1 libcodtest2
Nothing happens
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)
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
I start server
getVelocity() work but setVelocity and getIP() and other functions kill my server.Why?
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
Start the server without setting the map. Then inject dll. Start a map and it works