2021-04-22, 10:50 AM
(This post was last modified: 2021-04-22, 10:59 PM by PutuSuhartawan.)
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;
}
here is a simple code for GetRPName
stock GetRPName(playerid)
{
? ? new name[MAX_PLAYER_NAME];
? ? GetPlayerName(playerid, name, sizeof(name));
? ? strreplace(name, '_', ' ');
? ? return name;
}
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?
2021-04-22, 05:12 PM
(This post was last modified: 2021-04-22, 05:13 PM by Radical.)
(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;
}
2021-04-22, 10:58 PM
(This post was last modified: 2021-04-22, 11:02 PM by PutuSuhartawan.)
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;
}
Location: Belgrade, Serbia
(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.
2021-04-22, 11:49 PM
(This post was last modified: 2021-04-22, 11:50 PM by Radical.)
(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.
Steal bug in just rerun 0 sir. Please try with another sugestion: How to fix bug chat in: public OnPlayerText(playerid, text[])
{
return 0;
}
|