SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 25/02/2010, 12:02 AM   #1
ÄitisOnHuora
Big Clucker
 
Join Date: Aug 2009
Posts: 179
Reputation: 0
Default Where does this character come from!?

pawn Code:
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?
ÄitisOnHuora is offline  
Old 25/02/2010, 12:26 AM   #2
Pandalink
Little Clucker
 
Pandalink's Avatar
 
Join Date: Aug 2007
Posts: 38
Reputation: 0
Default Re: Where does this character come from!?

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?
Pandalink is offline  
Old 25/02/2010, 03:58 AM   #3
ÄitisOnHuora
Big Clucker
 
Join Date: Aug 2009
Posts: 179
Reputation: 0
Default Re: Where does this character come from!?

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.
ÄitisOnHuora is offline  
Old 25/02/2010, 04:30 AM   #4
Joe Staff
High-roller
 
Joe Staff's Avatar
 
Join Date: Aug 2007
Posts: 2,811
Reputation: 330
Default Re: Where does this character come from!?

You should use text[1], instead of text at
format(string, sizeof(string), "%s( %s ))", sendername, text);
__________________
Evil triumphs when good men do nothing.
Joe Staff is offline  
Old 25/02/2010, 01:57 PM   #5
ÄitisOnHuora
Big Clucker
 
Join Date: Aug 2009
Posts: 179
Reputation: 0
Default Re: Where does this character come from!?

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!
ÄitisOnHuora is offline  
Old 25/02/2010, 01:59 PM   #6
Torran
High-roller
 
Join Date: Jan 2010
Posts: 1,794
Reputation: 1
Default Re: Where does this character come from!?

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]
Torran is offline  
Old 25/02/2010, 02:02 PM   #7
Finn
High-roller
 
Join Date: Jan 2008
Posts: 1,689
Reputation: 306
Default Re: Where does this character come from!?

pawn Code:
if(text[0] == '(')
{
  ...
  format(string, sizeof(string), "%s:(( %s ))", sendername, text[1]);
  ...
}
__________________
Finn is offline  
Old 25/02/2010, 02:03 PM   #8
Torran
High-roller
 
Join Date: Jan 2010
Posts: 1,794
Reputation: 1
Default Re: Where does this character come from!?

Quote:
Originally Posted by Finn
pawn Code:
if(text[0] == '(')
{
  ...
  format(string, sizeof(string), "%s:(( %s ))", sendername, text[1]);
  ...
}
Hes already done that if you read his post,
Torran is offline  
Old 25/02/2010, 02:05 PM   #9
Finn
High-roller
 
Join Date: Jan 2008
Posts: 1,689
Reputation: 306
Default Re: Where does this character come from!?

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.
__________________
Finn is offline  
Old 25/02/2010, 02:30 PM   #10
ÄitisOnHuora
Big Clucker
 
Join Date: Aug 2009
Posts: 179
Reputation: 0
Default Re: Where does this character come from!?

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!
ÄitisOnHuora is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What GTA character are you? Guedes747 Everything and Nothing 65 22/05/2010 08:29 AM
Character Limit - Help me, sir! Daniel_June Help Archive 13 27/01/2010 08:26 PM
Help with character spawn stud4125 Help Archive 4 25/07/2009 09:55 PM
can`t see character laser50 Help Archive 1 10/04/2009 10:23 PM
My first 3D character Moustafa Everything and Nothing 0 23/03/2009 07:01 PM


All times are GMT. The time now is 03:16 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.