first problem:
c++ function:
in script:
Fishing Skill found in the code for the letter "6" as a skill does not responding as skill in this script, because when I try to bring up the Rat with 29 fishingu, and I set (getPlayerSkill (cid, 6)> = 30) in the script, it still makes Rat skipping this function. According to me it's something in the engine is not so, but I looked through everything and nothing helps. :/
second problem:
I search code "doPlayerRemoveSkill". Function is to act like doPlayerAddSkillTry(cid,skillid,tries), but has removed skill. Alone, I could not do it :/
c++ function:
PHP:
int LuaScriptInterface::luaGetPlayerSkill(lua_State *L)
{
//getPlayerSkill(uid,skillid)
uint32_t skillid = popNumber(L);
uint32_t cid = popNumber(L);
ScriptEnviroment* env = getScriptEnv();
const Player* player = env->getPlayerByUID(cid);
if(player){
if(skillid <= SKILL_LAST){
uint32_t value = player->skills[skillid][SKILL_LEVEL];
lua_pushnumber(L, value);
}
else{
reportErrorFunc("No valid skillId");
lua_pushnumber(L, LUA_ERROR);
}
}
else{
reportErrorFunc(getErrorDesc(LUA_ERROR_PLAYER_NOT_FOUND));
lua_pushnumber(L, LUA_ERROR);
}
return 1;
}
in script:
Code:
if (getPlayerSkill(cid,6) >= 30) then
Fishing Skill found in the code for the letter "6" as a skill does not responding as skill in this script, because when I try to bring up the Rat with 29 fishingu, and I set (getPlayerSkill (cid, 6)> = 30) in the script, it still makes Rat skipping this function. According to me it's something in the engine is not so, but I looked through everything and nothing helps. :/
second problem:
I search code "doPlayerRemoveSkill". Function is to act like doPlayerAddSkillTry(cid,skillid,tries), but has removed skill. Alone, I could not do it :/