saving string in array
#1

I dont get this to work. How to properly save a string in an array?

These doesnt work:

Код:
format(str,sizeof(str),"%s", reason);
ReportInfo[playerid][ReportedReason] = str;

//or
ReportInfo[playerid][ReportedReason] = reason;
Reply
#2

The top one will work if ReportedReason is a string and the same cell size as str.
Reply
#3

I only see this happening by formatting.
PHP код:
format(ReportInfo[playerid][ReportedReason],ReportInfo[playerid][ReportedReason],"%s"reason); 
Maybe i'm wrong but try you never know.
Reply
#4

Quote:
Originally Posted by Weponz
Посмотреть сообщение
The top one will work if ReportedReason is a string and the same cell size as str.
Thanks, i set the array to be a string and it worked.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)