Where does this character come from!? -
ДitisOnHuora - 24.02.2010
pawn Код:
public OnPlayerText(playerid, text[])
{
if(text[0] == '(')
{
new string[128];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s:(( %s ))", sendername, text);
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
}
return 0;
}
If i do for example:
(hello!
It gives me this:
Name_Name( ( hello! ))
Instead it should be like this:
Name_Name( hello! ))
Wtf, where that extra "(" comes from?
Re: Where does this character come from!? -
Pandalink - 24.02.2010
I'm no scripter, but isn't it just taking the entire input and placing it within the (( )) in the string?
The entire input being "(hello" would mean the "(" got put inside also, no?
Re: Where does this character come from!? -
ДitisOnHuora - 25.02.2010
Quote:
Originally Posted by Panda
I'm no scripter, but isn't it just taking the entire input and placing it within the (( )) in the string?
The entire input being "(hello" would mean the "(" got put inside also, no?
|
When you start a message with "(" yes.
Re: Where does this character come from!? -
Joe Staff - 25.02.2010
You should use text[1], instead of text at
format(string, sizeof(string), "%s
( %s ))", sendername, text);
Re: Where does this character come from!? -
ДitisOnHuora - 25.02.2010
Quote:
Originally Posted by Joe Staff
You should use text[1], instead of text at
format(string, sizeof(string), "%s ( %s ))", sendername, text);
|
I tried, text[1]. Now it is like this:
Name_Name: (hello!
Re: Where does this character come from!? -
Torran - 25.02.2010
Try
text[2]
And it does the ( because your getting the text from the player,
And players text contains ( so thats why you see it,
But yeah try
text[2]
Re: Where does this character come from!? -
Finn - 25.02.2010
pawn Код:
if(text[0] == '(')
{
...
format(string, sizeof(string), "%s:(( %s ))", sendername, text[1]);
...
}
Re: Where does this character come from!? -
Torran - 25.02.2010
Quote:
Originally Posted by Finn
pawn Код:
if(text[0] == '(') { ... format(string, sizeof(string), "%s:(( %s ))", sendername, text[1]); ... }
|
Hes already done that if you read his post,
Re: Where does this character come from!? -
Finn - 25.02.2010
Quote:
Originally Posted by Torran
Hes already done that if you read his post,
|
I think he put text[1] in every place.
Even in this line:
if(text[0] == '(')
Which is why it doesn't work.
Re: Where does this character come from!? -
ДitisOnHuora - 25.02.2010
Quote:
Originally Posted by Torran
Try text[2]
And it does the ( because your getting the text from the player,
And players text contains ( so thats why you see it,
But yeah try text[2]
|
Still same effect:
Name_Name: ( hello!
Re: Where does this character come from!? -
Torran - 25.02.2010
Show your code now youve changed it
Re: Where does this character come from!? -
ДitisOnHuora - 25.02.2010
Quote:
Originally Posted by Finn
pawn Код:
if(text[0] == '(') { ... format(string, sizeof(string), "%s:(( %s ))", sendername, text[1]); ... }
|
That works like a dream, thank you!
Torran: Thanks for trying to help!
Re: Where does this character come from!? -
Razvann - 25.02.2010
Quote:
Originally Posted by ДitisOnHuora
Quote:
Originally Posted by Finn
pawn Код:
if(text[0] == '(') { ... format(string, sizeof(string), "%s:(( %s ))", sendername, text[1]); ... }
|
That works like a dream, thank you!
Torran: Thanks for trying to help!
|
pawn Код:
if(text[0] == '(')
{
...
format(string, sizeof(string), "%s:( %s ))", sendername, text[1]);
...
}
Try
.
Re: Where does this character come from!? -
Torran - 25.02.2010
Why quote a text where he says hes fixed it using the exact same code youve posted?
But when someone else posted the code