_Aion_
Nothing Else
Someone can help me?
i'm trying make an new function setCreatureHealth, this function are for set Health not MaxHealth.
i made this based on setCreatureMaxHealth, but no wokrs![Frown :( :(](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
and
both no works.
Someone good in C++ can help?
i'm trying make an new function setCreatureHealth, this function are for set Health not MaxHealth.
i made this based on setCreatureMaxHealth, but no wokrs
Code:
int32_t LuaInterface::luaSetCreatureHealth(lua_State* L)//Health
uint64_t health = (uint64_t)popNumber(L);
ScriptEnviroment* env = getEnv();
if (Creature* creature = env->getCreatureByUID(popNumber(L)))
{
creature->changeHealth(health);
lua_pushboolean(L, true);
}
else
{
errorEx(getError(LUA_ERROR_CREATURE_NOT_FOUND));
lua_pushboolean(L, false);
}
return 1;
}
Code:
int32_t LuaInterface::luaSetCreatureHealth(lua_State* L)//Health
{
//setCreatureHealth(cid, health)
uint64_t health = popNumber(L);
ScriptEnviroment* env = getEnv();
if (Player* player = env->getPlayerByUID(popNumber(L)))
{
player->setCreatureHealth(health);
//lua_pushnumber(L, creature->getHealth());
lua_pushboolean(L, true);
}
else
{
errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
lua_pushboolean(L, false);
}
return 1;
}
Someone good in C++ can help?