Weird thing with enums? Or am i just blind?
#1

Hello,

I am having a tag mismatch error but i cant find it probably because im kind of blind lol.
My enum:
pawn Код:
enum ClubCars
{
    ExpireDate,
    vehicleModel
}
new ClubVehicles[MAX_CLUBCARS][ClubCars];
This is the function i am using:
pawn Код:
public ClubCarTimer()
{
    new Query[128], rows, fields, i = 0;
    format(Query, sizeof(Query), "SELECT * FROM ClubCars");
    mysql_function_query( Handle, Query, false, "", "" );
    cache_get_data( rows, fields, Handle);
   
    while(rows > i < MAX_CLUBCARS)
    {
        ClubVehicles[i][ExpireDate] = cache_get_row_float(i, 0);
    }
    return 1;
}
What is wrong?
The tag mis match is on this line:
Код:
		ClubVehicles[i][ExpireDate] = cache_get_row_float(i, 0);
Reply
#2

When you get the float you must to put "Float:" before ExpireDate, like this:

Код:
enum ClubCars
{
    Float:ExpireDate,
    vehicleModel
}
new ClubVehicles[MAX_CLUBCARS][ClubCars];
Reply
#3

Код:
cache_get_row_float(row, idx, connectionHandle = 1);
Reply
#4

Okay what the pedrino said was true sort of.. I needed to use int. But what do i use to get dates? Not cache_get_row_int right? Is there a function that can get a varchar? By the way the dates will be stored Like this: 1-8-13
Reply
#5

(rows > i < MAX_CLUBCARS) .. wtf is this possible..

lol is this for real i < rows && i<MAX_CLUBCARS? Hmm I guess its supose to be like that
Reply
#6

varchar is a string. So use cache_get_row().
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)