open.mp forum
[Pawn] HELP! How to Change RP name return chat remove underline OnPlayerText but return 0 ? - Printable Version

+ open.mp forum (https://forum.open.mp)
-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3)
--- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10)
--- Thread: [Pawn] HELP! How to Change RP name return chat remove underline OnPlayerText but return 0 ? (/showthread.php?tid=1932)



HELP! How to Change RP name return chat remove underline OnPlayerText but return 0 ? - PutuSuhartawan - 2021-04-22

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;

}



RE: HELP! How to Change RP name return chat remove underline name tag OnPlayerText ? - Ambarita - 2021-04-22

here is a simple code for GetRPName



stock GetRPName(playerid)

{

? ? new name[MAX_PLAYER_NAME];

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

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

? ? return name;

}


RE: HELP! How to Change RP name return chat remove underline name tag OnPlayerText ? - PutuSuhartawan - 2021-04-22

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?


RE: HELP! How to Change RP name return cphat remove underline name tag OnPlayerText ? - Radical - 2021-04-22

(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;
}



RE: HELP! How to Change RP name return chat remove underline name tag OnPlayerText ? - PutuSuhartawan - 2021-04-22

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;

}



RE: HELP! How to Change RP name return chat remove underline OnPlayerText but return 0 ? - Pinch - 2021-04-22

(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


RE: HELP! How to Change RP name return chat remove underline OnPlayerText but return 0 ? - Radical - 2021-04-22

(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.


RE: HELP! How to Change RP name return chat remove underline OnPlayerText but return 0 ? - PutuSuhartawan - 2021-05-28

Steal bug in just rerun 0 sir. Please try with another sugestion: How to fix bug chat in: public OnPlayerText(playerid, text[])

{

return 0;

}