constant expression ;
#1

I get the error:
Код:
error 008: must be a constant expression; assumed zero
but I don't know how to fix it. The code is:
pawn Код:
new pName[24] = text;
Anyone know how to fix?
Reply
#2

pawn Код:
strins( pName, text, 0 );
Alternatively, you could use strmid, or strcat.
Reply
#3

pawn Код:
new pName[24];
format(pName, sizeof(pName), "%s", text);
Reply
#4

Quote:
Originally Posted by jameskmonger
Посмотреть сообщение
pawn Код:
new pName[24];
format(pName, sizeof(pName), "%s", text);
You're better off using strcat to copy a string to another (which is the essential idea here). ****** mentioned it in one of his threads before that using format to copy a string isn't that great.
Reply
#5

Thanks Bakr, that helped.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)