Weird thing with enums? Or am i just blind? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Weird thing with enums? Or am i just blind? (
/showthread.php?tid=455195)
Weird thing with enums? Or am i just blind? -
thimo - 31.07.2013
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);
Re: Weird thing with enums? Or am i just blind? -
Th3_P4dr1n0 - 31.07.2013
When you get the float you must to put "Float:" before ExpireDate, like this:
Код:
enum ClubCars
{
Float:ExpireDate,
vehicleModel
}
new ClubVehicles[MAX_CLUBCARS][ClubCars];
Re: Weird thing with enums? Or am i just blind? -
wumpyc - 31.07.2013
Код:
cache_get_row_float(row, idx, connectionHandle = 1);
Re: Weird thing with enums? Or am i just blind? -
thimo - 31.07.2013
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
Re: Weird thing with enums? Or am i just blind? -
jamesbond007 - 31.07.2013
(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
Re: Weird thing with enums? Or am i just blind? -
Scenario - 31.07.2013
varchar is a string. So use cache_get_row().