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

Problem hp and mana

vvafel

New Member
Joined
Mar 5, 2010
Messages
22
Reaction score
0
Location
Poland.
Hello,
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:
hmm odwortny skrypt, ktory ma dodawac to dodaje a ten jest ktory ma odejmowac i nie odejmuje nie wiem czemu. zadnych bledow w silniku nie wyswietlna ani nic poprostu nie reaguje. Tak ma odejmowac od max hp i many tez
 
Back
Top