Untitled
Anonymous
c_cpp
09/06/2022 8:18 PM
616 B
19
Indexable
// luascript.cpp
int32_t LuaInterface::luaGetPlayerByName(lua_State* L)
{
//getPlayerByName(name)
ScriptEnviroment* env = getEnv();
if(Player* player = g_game.getPlayerByName(popString(L)))
lua_pushnumber(L, env->addThing(player));
else
lua_pushnil(L);
return 1;
}
//getPlayerByName(name)
lua_register(m_luaState, "getPlayerByName", LuaInterface::luaGetPlayerByName);
// luascript.h
static int32_t luaGetPlayerByName(lua_State* L);Editor is loading...