need help with strings
#1

Hi , i just started programming a SAMP server like two days ago.

I have a question , a noob question.

How can i output a string in SendClientMessage

Код:
CMD:shout( playerid, params[ ] )
{
new text[64];

if (sscanf(params, "s[64]", text))
  return SendClientMessage( playerid, -1, "Usage: /shout <text>");
        
  GameTextForAll(text, 2500, 5);
    new string[ 256 ];
    format(string, sizeof(string), ""COL_GREEN"Shout Out Sent:",text);
    SendClientMessage(playerid, -1 ,string);
    
return 1;
}
If i type "/shout test" in CMD

The GameTextForAll() works but not the SendClientMessage as it output is "Shout Out Sent : " (it should be Shout Out Sent : test).
(color green is defined COL_GREEN)


What's my problem?

Thanks if you can help me.

Have a nice day.
Reply
#2

pawn Код:
new string[128]; //128 cells are enough.
format(string, sizeof(string), "COL_GREEN",Shout Out Sent: %s",text); //You forgot the %s string parser.
SendClientMessage(playerid, -1 ,string);
Reply
#3

Thank You Logitech90
+1 rep
Reply
#4

No problem.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)