Hello,
I have a problem I do not know why this skrpyt:
not deducted hp and mana player
what is wrong?
I have a engine Devland 8.0 and the source I found:
may need to change something here?
Please help Vvafel
I have a problem I do not know why this skrpyt:
Code:
function onCastSpell(cid, var)
if getPlayerVocation(cid) == 2 then
doPlayerSetVocation(cid,0)
doPlayerAddHealthMax(cid,-(getPlayerLevel(cid)*15))
doPlayerAddManaMax(cid,-(getPlayerLevel(cid)*10))
elseif getPlayerVocation(cid) == 3 then
doPlayerSetVocation(cid,0)
doPlayerAddHealthMax(cid,-(getPlayerLevel(cid)*15))
doPlayerAddManaMax(cid,-(getPlayerLevel(cid)*15))
end
end
not deducted hp and mana player
what is wrong?
I have a engine Devland 8.0 and the source I found:
Code:
#ifdef __CHANGE_MAX__
int LuaScriptInterface::luaDoPlayerAddHealthMax(lua_State *L)
{
//doPlayerAddHealthMax(uid,health)
int32_t healthChange = (int32_t)popNumber(L);
uint32_t cid = popNumber(L);
ScriptEnviroment* env = getScriptEnv();
Player* player = env->getPlayerByUID(cid);
if(player){
if(healthChange >= 0){
player->changeHealthMax(healthChange);
}
lua_pushnumber(L, LUA_NO_ERROR);
}
else{
reportErrorFunc(getErrorDesc(LUA_ERROR_PLAYER_NOT_FOUND));
lua_pushnumber(L, LUA_ERROR);
}
return 1;
}
may need to change something here?
Please help Vvafel
Last edited: