aberos
New Member
- Joined
- Feb 26, 2014
- Messages
- 17
- Reaction score
- 0
good people, I want a "pos" in doSummonMonster to Summon be in creating a desired "pos", I did it here, plus the summon is still not creating the desired "pos", then I want to know what you want I'm doing wrong .
////////////
//doSummonMonster(cid, name, pos)
lua_register(m_luaState,"doSummonMonster",LuaScriptInterface::luaDoSummonMonster);
////////////
int32_tLuaScriptInterface::luaDoSummonMonster(lua_State* L){
//doSummonMonster(cid, name, pos)
PositionEx pos;
popPosition(L, pos);
std::string name = popString(L);
ScriptEnviroment* env = getEnv();
Creature* creature = env->getCreatureByUID(popNumber(L));
if(!creature)
{
errorEx(getError(LUA_ERROR_CREATURE_NOT_FOUND));
lua_pushboolean(L,false);
return1;
}
lua_pushnumber(L, g_game.placeSummon(creature, name));
return1;}
////////////
//doSummonMonster(cid, name, pos)
lua_register(m_luaState,"doSummonMonster",LuaScriptInterface::luaDoSummonMonster);
////////////
int32_tLuaScriptInterface::luaDoSummonMonster(lua_State* L){
//doSummonMonster(cid, name, pos)
PositionEx pos;
popPosition(L, pos);
std::string name = popString(L);
ScriptEnviroment* env = getEnv();
Creature* creature = env->getCreatureByUID(popNumber(L));
if(!creature)
{
errorEx(getError(LUA_ERROR_CREATURE_NOT_FOUND));
lua_pushboolean(L,false);
return1;
}
lua_pushnumber(L, g_game.placeSummon(creature, name));
return1;}