Load cars from database error
#1

Hello.
When i compile this:
PHP код:
forward ToLoadCars(playerid);
public 
ToLoadCars(playerid);
{
new 
num_fields2,num_rows2;
cache_get_data(num_rows2,num_fields2,dbhandle);
if(
num_rows2==1)
{
for(new 
0sizeof(cInfo); i++)
{
cInfo[i][db_id] = cache_get_field_content_int(0,"id",dbhandle);
}
else
{
return 
1;
}

i get this error:
error 021: symbol already defined: "cache_get_data"

?? where does it come from
Reply
#2

Quote:
Originally Posted by justjamie
Посмотреть сообщение
Hello.
When i compile this:
PHP код:
forward ToLoadCars(playerid);
public 
ToLoadCars(playerid);
{
new 
num_fields2,num_rows2;
cache_get_data(num_rows2,num_fields2,dbhandle);
if(
num_rows2==1)
{
for(new 
0sizeof(cInfo); i++)
{
cInfo[i][db_id] = cache_get_field_content_int(0,"id",dbhandle);
}
else
{
return 
1;
}

i get this error:
error 021: symbol already defined: "cache_get_data"

?? where does it come from
ok i changed this:
PHP код:
public ToLoadCars(playerid); 
to this:
PHP код:
public ToLoadCars(playerid
Now i get a fuckton of errors.
What did i do wrong?
It will compile perfectly when i remove this code.
Reply
#3

Код:
public ToLoadCars(playerid);
Semicolons cannot be used at the end of a public function.

EDIT: You found out about that. Anyway, you're missing a closed bracket } too.
Reply
#4

Show the errors and show the exact lines in which you get a specified error in.
Reply
#5

Quote:
Originally Posted by justjamie
Посмотреть сообщение
Hello.
When i compile this:
PHP код:
forward ToLoadCars(playerid);
public 
ToLoadCars(playerid);
{
new 
num_fields2,num_rows2;
cache_get_data(num_rows2,num_fields2,dbhandle);
if(
num_rows2==1)
{
for(new 
0sizeof(cInfo); i++)
{
cInfo[i][db_id] = cache_get_field_content_int(0,"id",dbhandle);
}
else
{
return 
1;
}

i get this error:
error 021: symbol already defined: "cache_get_data"

?? where does it come from
Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Код:
public ToLoadCars(playerid);
Semicolons cannot be used at the end of a public function.

EDIT: You found out about that. Anyway, you're missing a closed bracket } too.
welp i see it XD.

my bad

saved my day <3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)