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

Compiling two problems c++

Mikix95

New Member
Joined
Oct 9, 2009
Messages
5
Reaction score
1
first problem:

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 :/
 
Back
Top