A little problem with a string
#1

Hi.

I've got a small problem, I'm trying to fix it using some ways, no one works. Well, it's a command which sets variable's string with params. It's same like setting LastPlayerText with text in OnPlayerText. It looks like:

pawn Код:
new var[128];

var = ...;
What should I put in "..." (it's a string)? With a number it would be strval(params), but I've got a problem with characters (for example, var should be "winner") - could anyone help?
Reply
#2

format( var, 128, "%s", strval( params ) );

Or what do you want ?
Reply
#3

pawn Код:
new Var[128];
format(Var,sizeof(Var),"Winner");
//Or
strins(Var, "Winner", sizeof(Var));
Reply
#4

Hm, no one did this right how I wanted, but costel gave me a way how to do it (just 'params', not strval(params), it's not a number), so I will give reputation to him.
Reply
#5

format(var, 128, "%s", ("None"));

Ex:
format(var, 128, "%s", text);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)