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

DoPlayerRemoveSkillTry(cid, skill, count) HELP

pietru11

New Member
Joined
Jul 21, 2008
Messages
3
Reaction score
0
What should I do to make function DoPlayerAddSkillTry removing skills instead of adding?
Code:
int32_t LuaScriptInterface::luaDoPlayerAddSkillTry(lua_State* L)
{
	//doPlayerAddSkillTry(uid, skillid, n)
	int32_t n = popNumber(L), skillid = popNumber(L);

	ScriptEnviroment* env = getScriptEnv();
	if(Player* player = env->getPlayerByUID(popNumber(L)))
	{
		player->addSkillAdvance((skills_t)skillid, n);
		lua_pushboolean(L, true);
	}
	else
	{
		reportErrorFunc(getErrorDesc(LUA_ERROR_PLAYER_NOT_FOUND));
		lua_pushboolean(L, false);
	}
	return 1;
}
 
Back
Top