Whats wrong ?
#1

Hey so i am getting this error

Код:
: error 022: must be lvalue (non-constant)
The line
Код:
Date = GetDate();
GetDate();
Код:
stock GetDate()
{
   new String[64];

   new t1, t2, t3, d1, d2, d3;

   format(String, sizeof(String), "%02d/%02d/%02d %02d:%02d:%02d", t3, t2, t1, d1, d2, d3);

   return String;
}
Reply
#2

Quote:
Originally Posted by Saurik
Посмотреть сообщение
Hey so i am getting this error

Код:
: error 022: must be lvalue (non-constant)
The line
Код:
Date = GetDate();
GetDate();
Код:
stock GetDate()
{
   new String[64];

   new t1, t2, t3, d1, d2, d3;

   format(String, sizeof(String), "%02d/%02d/%02d %02d:%02d:%02d", t3, t2, t1, d1, d2, d3);

   return String;
}
I'm really not sure but isn't "GetDate"

Getdate

No capital for second word?
Reply
#3

pawn Код:
new Date[64];

Date = GetDate();
Works fine for me.

Quote:
Originally Posted by Jay.
Посмотреть сообщение
I'm really not sure but isn't "GetDate"

Getdate

No capital for second word?
Isn't getdate(...), he created another func.
Reply
#4

Date is a Int, but GetDate() is returning a string...
Therefore you need to use: new Date[64];
Then format the Date String using the GetDate Function

(Guess someone beat me to it, but still needs to formatted, Date = GetDate simply won't work)
Reply
#5

I already used new date [64];

i have that


@ jay no
Reply
#6

It seemed to work for me when I added a string array to the end of date.

pawn Код:
new date[64];
date = GetDate();

stock GetDate()
{
   new String[64];

   new t1, t2, t3, d1, d2, d3;

   format(String, sizeof(String), "%02d/%02d/%02d %02d:%02d:%02d", t3, t2, t1, d1, d2, d3);

   return String;
}
Reply
#7

pawn Код:
new date[64];
format(date,sizeof(date),GetDate());
Reply
#8

Quote:
Originally Posted by Toni
Посмотреть сообщение
It seemed to work for me when I added a string array to the end of date.

pawn Код:
new date[64];
date = GetDate();

stock GetDate()
{
   new String[64];

   new t1, t2, t3, d1, d2, d3;

   format(String, sizeof(String), "%02d/%02d/%02d %02d:%02d:%02d", t3, t2, t1, d1, d2, d3);

   return String;
}
My apologizes, that might work
Код:
Date = GetDate();
Reply
#9

Quote:
Originally Posted by Amit_B
Посмотреть сообщение
pawn Код:
new date[64];
format(date,sizeof(date),GetDate());
error 035: argument type mismatch (argument 1)
Reply
#10

Quote:
Originally Posted by Saurik
Посмотреть сообщение
error 035: argument type mismatch (argument 1)
><
try to replace the variable name from "date" to "datestring"
if it isn't works, try to replace its size to 65
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)