Where does this character come from!?
#1

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?
Reply
#2

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?
Reply
#3

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.
Reply
#4

You should use text[1], instead of text at
format(string, sizeof(string), "%s( %s ))", sendername, text);
Reply
#5

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!
Reply
#6

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]
Reply
#7

pawn Код:
if(text[0] == '(')
{
  ...
  format(string, sizeof(string), "%s:(( %s ))", sendername, text[1]);
  ...
}
Reply
#8

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,
Reply
#9

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.
Reply
#10

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!
Reply
#11

Show your code now youve changed it
Reply
#12

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!
Reply
#13

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 .
Reply
#14

Why quote a text where he says hes fixed it using the exact same code youve posted?
But when someone else posted the code
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)