UPDATE `players` SET `maglevel` = 0
UPDATE `player_skills` SET `value` = 0
I don't know exactly what you mean, but if you want to set all player skills and magic level to 0, you can do it via a SQL Query, use this for the magic level:
Code:UPDATE `players` SET `maglevel` = 0
and this one for the skills:
Code:UPDATE `player_skills` SET `value` = 0
My idea is change it ONLINE.. Querys work only with offline players..
I already make a reset function on C++.. But, thank you..![]()
void Player::resetStats()
{
experience = 0;
level = 1;
levelPercent = 0;
magLevel = 0;
magLevelPercent = 0;
mana = 100;
manaMax = 100;
manaSpent = 0;
soul = 100;
//NOT SURE ABOUT THIS CODE
for(int32_t skill = SKILL_FIST; skill < SKILL__MAGLEVEL; ++skill)
{
skills[skill][SKILL_TRIES] = 0;
skills[skill][SKILL_LEVEL] = 10;
skills[skill][SKILL_PERCENT] = 0;
}
sendStats();
}
void resetStats();
int32_t LuaInterface::luaDoPlayerResetStats(lua_State* L)
{
//doPlayerResetStats(cid)
uint32_t cid = popNumber(L);
ScriptEnviroment* env = getEnv();
Player* player = env->getPlayerByUID(cid);
if(player)
{
player->resetStats();
lua_pushboolean(L, true);
}
else
{
errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
lua_pushboolean(L, false);
}
return 1;
}