• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Compiling Help to add ping functions on 0.4

dawnking

Member
Joined
Jun 23, 2016
Messages
176
Reaction score
22
I want to add this check ping functions to make scripts...
Like if all players ping are high, kick everybody to save players

But i got some problems that idk how to fix

I'm using this sources: https://github.com/Fir3element/tfs04full
(base)

I've just edited this 2 files
all parts i edited i've put:
Code:
// getOtsysTime() + getPlayerPing(cid) + doPlayerSendPing(cid) [CREDITS: Shyzoul and Nothxbye]
code
// end

luascript.cpp
http://hastebin.com/umodedehuy.go

luascript.h
http://hastebin.com/xonixeluqe.cpp

And this error:
Code:
In file included from player.h:33:0,
                 from luascript.cpp:26:
protocolgame.h: In static member function ‘static int32_t LuaInterface::luaPlayerSendPing(lua_State*)’:
protocolgame.h:205:8: error: ‘void ProtocolGame::sendPing()’ is private
   void sendPing();
        ^
luascript.cpp:10175:20: error: within this context
   client->sendPing();
                    ^

Idk why this error too
The
Code:
static int32_t luaPlayerSendPing(lua_State* L);


Is in:
Code:
class LuaInterface
{
   public:
 
You can't reference something out of a static context if the reference is of static context

the error is saying it can't access it due to the private modifier
 
You can't reference something out of a static context if the reference is of static context

the error is saying it can't access it due to the private modifier

I'm sorry, i don't know about sources edits, i just trying to add this old code that was here on forum, but don't have anymore...
I don't understand

The
Code:
       // getOtsysTime() + getPlayerPing(cid) + doPlayerSendPing(cid) [CREDITS: Shyzoul and Nothxbye]
        static int32_t luaPlayerSendPing(lua_State* L);
        static int32_t luaPlayerGetLastPing(lua_State* L);
        static int32_t luaPlayerGetLastPong(lua_State* L);
        // end

Is in:
Code:
class LuaInterface
{
   public:

Like you can see:
http://hastebin.com/xonixeluqe.cpp
 
I'm sorry, i don't know about sources edits, i just trying to add this old code that was here on forum, but don't have anymore...
I don't understand

The
Code:
       // getOtsysTime() + getPlayerPing(cid) + doPlayerSendPing(cid) [CREDITS: Shyzoul and Nothxbye]
        static int32_t luaPlayerSendPing(lua_State* L);
        static int32_t luaPlayerGetLastPing(lua_State* L);
        static int32_t luaPlayerGetLastPong(lua_State* L);
        // end

Is in:
Code:
class LuaInterface
{
   public:

Like you can see:
http://hastebin.com/xonixeluqe.cpp
in protocolgame.h put
Code:
void sendPing();
from private: into public:
 
Last edited:
Back
Top