doPlayerSetSpecialDescription(cid, (getPlayerSex(cid) == 0 and ".\nShe" or ".\nHe") .. " is on Ascension # " .. new .. ".")
You keep trying to set the NAME of the player, you can't do this.
You need to set THE DESCRIPTION.
Code:You see John. (Level 8). He is a knight. He is on Asension # 1.
But description function fails, look;
Player doesn't have description, then you use function to set his description, you set description to 'JDB #1', then after a while you set description to 'JDB #2', but function instead of over-write description, adds the content, so the output is: 'JDB #1JDB #2', got it?
That's how I did it on my server, don't know why the function isn't working for you.
int32_t LuaInterface::luaDoPlayerSetNameDescription(lua_State* L)
{
//doPlayerSetNameDescription(cid, description)
std::string description = popString(L);
ScriptEnviroment* env = getEnv();
if(Player* player = env->getPlayerByUID(popNumber(L)))
{
player->nameDescription [B][COLOR="red"]+=[/COLOR] [/B] description;
lua_pushboolean(L, true);
}
else
{
errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
lua_pushboolean(L, false);
}
return 1;
}