How can i remove the "_" from the name in the chat?
#1

Well the title say it all, Where in the script can i find how to remove it? And how can I also apply the "talking" annimation when you say something?
Reply
#2

Talking Animation, put this code in OnPlayerText
pawn Код:
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
  {
    ApplyAnimation(playerid, "MISC", "Idle_Chat_02", 4.1, 0, 1, 1, 1, 1);
  }
To remove the _
Paste this stock out of a callback
pawn Код:
stock strreplace(string[], find, replace)
{
    for(new i=0; string[i]; i++)
    {
        if(string[i] == find)
        {
            string[i] = replace;
        }
    }
}
Then in OnPlayerText again
pawn Код:
new name[24];
GetPlayerName(playerid, name, sizeof(name));
strreplace(name, '_', ' ');
Reply
#3

I didnt quite understand the part with the callback, Could you explain little more how to do it?
Reply
#4

stock RPTEXT(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
for(new i = 0; i < MAX_PLAYER_NAME; i++)
{
if(name[i] == '_') name[i] = ' ';
}
return name;
}

eg
pawn Код:
new string[128];
format(string, sizeof(string), "%s",RPN(playerid));
SendClientMessage(playerid, -1, string);
Reply
#5

I found this, is it right?
pawn Код:
stock GetPlayerNameEx(playerid)
{
    new string[24];
    GetPlayerName(playerid,string,24);
    new str[24];
    strmid(str,string,0,strlen(string),24);
    for(new i = 0; i < MAX_PLAYER_NAME; i++)
    {
        if (str[i] == '_') str[i] = ' ';
    }
    return str;
}
Reply
#6

help please
Reply
#7

When i talk in the chat and the annimation stops it dosnt "clear" the annimation, it stops and then the player's hands is just still, even when you walk. Can i fix this with
pawn Код:
ClearAnimations(playerid);
?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)