• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] HELP! How to Change RP name return chat remove underline OnPlayerText but return 0 ?
#1
Code:
public OnPlayerText(playerid, text[])

{

? //new AdaSays[90];

// format(AdaSays, sizeof(AdaSays), ""COL_WHITE"Says: %s", text);

// ProcessChatText(playerid, AdaSays);

? //TalkMessage(ACTION_DISTANCE, playerid, "", text);

? SEM(playerid, ""COL_RED"DEBUG: "COL_WHITE"message text example");

? new string[228];

? format(string, sizeof(string), "%s says: %s", GetRPName(playerid), text);

? CloseMessage(playerid, COLOR_WHITE, string);

? //format(string, sizeof(string), "%s says: %s", GetRPName(playerid), text);

//Log("logs/chatlogplayer.log", string);

? format(string,sizeof(string),"%s", text);

? SetPlayerChatBubble( playerid, string,0xFFFFFFFF,20.0,5500);



? return 1;

}
  Reply
#2
here is a simple code for GetRPName



stock GetRPName(playerid)

{

? ? new name[MAX_PLAYER_NAME];

? ? GetPlayerName(playerid, name, sizeof(name));

? ? strreplace(name, '_', ' ');

? ? return name;

}
  Reply
#3
Sorry sir, I already have GetRPName (playerid) stock, what I asked was why my chat results when pressing enter still appeared like:







[TIMESTAMP] Name_Lastname: Chat



so why is that, sir?
  Reply
#4
(2021-04-22, 04:48 PM)PutuSuhartawan Wrote: Sorry sir, I already have GetRPName (playerid) stock, what I asked was why my chat results when pressing enter still appeared like:



[TIMESTAMP] Name_Lastname: Chat

so why is that, sir?

Try this :

Code:
stock GetRPName(playerid)
{
? ? new name[MAX_PLAYER_NAME];
? ? GetPlayerName(playerid, name, MAX_PLAYER_NAME);
? ? for (new i; i <?MAX_PLAYER_NAME; i) {
? ? ? ? if (name[i] == '_') {
? ? ? ? ? ? name[i] = ' ';
? ? ? ? ? ? break;
? ? ? ? }
? ? }
? ? ??
? ? return name;
}
  Reply
#5
Sir, sorry before that, I already have my blade in GetRPName stock. But here I want to say the problem of bugs that occur every time I want to type in GTA SAMP. First I press T. Well then I type. And finally I press ENTER. Why do I still have an underscore bug? even though I have given return 0? so.



can this be correct, sir, the result is the final text value?



Code:
public OnPlayerText(playerid, text[])

{

return 0;

}
  Reply
#6
(2021-04-22, 10:50 AM)PutuSuhartawan Wrote:
Code:
public OnPlayerText(playerid, text[])

{

? //new AdaSays[90];

// format(AdaSays, sizeof(AdaSays), ""COL_WHITE"Says: %s", text);

// ProcessChatText(playerid, AdaSays);

? //TalkMessage(ACTION_DISTANCE, playerid, "", text);

? SEM(playerid, ""COL_RED"DEBUG: "COL_WHITE"message text example");

? new string[228];

? format(string, sizeof(string), "%s says: %s", GetRPName(playerid), text);

? CloseMessage(playerid, COLOR_WHITE, string);

? //format(string, sizeof(string), "%s says: %s", GetRPName(playerid), text);

//Log("logs/chatlogplayer.log", string);

? format(string,sizeof(string),"%s", text);

? SetPlayerChatBubble( playerid, string,0xFFFFFFFF,20.0,5500);



? return 1;

}



return 0
Using Pawn.CMD?

If you're doing so, this is the very first sign that you absolutely shouldn't utilize your all powerful P-Code knowledge in any of the scripting discussion topics.
  Reply
#7
(2021-04-22, 10:58 PM)PutuSuhartawan Wrote: Sir, sorry before that, I already have my blade in GetRPName stock. But here I want to say the problem of bugs that occur every time I want to type in GTA SAMP. First I press T. Well then I type. And finally I press ENTER. Why do I still have an underscore bug? even though I have given return 0? so.

can this be correct, sir, the result is the final text value?

Code:
public OnPlayerText(playerid, text[])
{
return 0;
}


I'm sorry I got it wrong.
Just return 0.
  Reply
#8
Steal bug in just rerun 0 sir. Please try with another sugestion: How to fix bug chat in: public OnPlayerText(playerid, text[])

{

return 0;

}
  Reply


Forum Jump: