• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved PvP system

Syryniss

Member
Joined
Feb 13, 2014
Messages
206
Reaction score
20
Hi. I found a topic with pvp system (LINK) which I really wanted to add to my 0.3.6pl1 server. It says that firstly I need to add function in luascript.cpp as in this thread (LINK), but I don't know exactly where to add it. I tried by myself, but I'm reciving error while compiling :
Code:
2951 C:\...\luascript.cpp no `int32_t LuaScriptInterface::luaGetPlayerSecureMode(lua_State*)' member function declared in class `LuaScriptInterface'

I know I'm probably doing some stupid mistake, so it would be really nice, if someone could help me. Thanks!
 
static int32_t luaGetPlayerSecureMode(lua_State* L);
static int32_t luaGetPlayerFightMode(lua_State* L);

Try add that just search the same static
 
If you mean changing this:
Code:
int32_t LuaScriptInterface::luaGetPlayerSecureMode(lua_State* L)
to this:
Code:
static int32_t luaGetPlayerSecureMode(lua_State* L);
unfortunately it doesn't work, error:
Code:
1236 C:\...\luascript.cpp expected unqualified-id before '{' token
I also removed ";" at the end, resulting in diffrent errors :/
 
no change, add
If you mean changing this:
Code:
int32_t LuaScriptInterface::luaGetPlayerSecureMode(lua_State* L)
to this:
Code:
static int32_t luaGetPlayerSecureMode(lua_State* L);
unfortunately it doesn't work, error:
Code:
1236 C:\...\luascript.cpp expected unqualified-id before '{' token
I also removed ";" at the end, resulting in diffrent errors :/

oh sorry, open luascript.h and add

Code:
static int32_t luaGetPlayerSecureMode(lua_State* L);
static int32_t luaGetPlayerFightMode(lua_State* L);

just search the same static ing32_ blablablab and paste on the same site
 
Umm, sorry for misunderstanding your first post. Now everything works. May I ask you one more thing? After changing what files I should rebuild project instead of just compiling it? Anyway, thank you very much for help.

@update
The pvp system wasn't working, I couldn't damage or target any player with or without secure mode. I needed to add "== 0" to every getPlayerSecureMode line, and now it's all working so far.
 
Last edited:
Back
Top