• 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!

Sprawdzanie docelowego miejsca teleportu

Dubler

PHP, LUA, C++
Joined
Aug 3, 2009
Messages
268
Reaction score
11
Location
Poland
w lua chyba takiej komendy nie ma, mógłby ktoś mi maznąć w c++ :$
najfajniej by było żeby dało by rade do getThingFromPos dodać tabliczke dest czy coś koło tego. Próbowałem namierzyć jakoś funkcje addThing() i do niej dodać ale nie moge jej znaleść.

przy okazji może jest jakiś poradnik o strukturze trunka bo składnie w cpp ogarniam ale budowy tego silnika już nie

jak mogę użyć klasy np z teleport.cpp w luascript.cpp?
 
Last edited:
PHP:
int32_t LuaInterface::luaGetItemDestination(lua_State* L)
{
	//getItemDestination(uid)
	ScriptEnviroment* env = getEnv();
	
    if (Item* item = env->getItemByUID(popNumber(L))
	{
		if(Teleport* teleport = item->getTeleport())
			pushPosition(teleport->getDestination());
		else
		{
			errorEx("Target item is not a teleport.");
			lua_pushboolean(L, false);
		}
	}
	else
	{
		errorEx(getError(LUA_ERROR_ITEM_NOT_FOUND));
		lua_pushboolean(L, false);
	}
	return 1;
}
Tutaj jest ciało funkcji, z resztą sobie raczej sam poradzisz. Nie sprawdzane, ale powinno hulać.
 
dzięki, drobne błędy składnowie. Działa, do zamknięcia ;)
 
Last edited:
Back
Top