14.01.2012, 19:24
Hi,
I have this vehicle system:
and this loading function (made by Cameltoe):
But it doesen't load any car,it returns me "no car loaded"
Can somebody help me?
Thanks
I have this vehicle system:
PHP код:
enum cInfo
{
cModel,
Float:cLocationx,
Float:cLocationy,
Float:cLocationz,
Float:cAngle,
cColorOne,
cColorTwo,
cOwner[MAX_PLAYER_NAME],
cDescription[32],
cValue,
//cRegistration,
cOwned,
cLock,
ownedvehicle,
cAlarm,
cDestroyed[MAX_VEHICLES],
cInsurance,
cPaintJob,
cID,
};
new CarInfo[51][cInfo];
PHP код:
stock LoadCar() // You might want to make this an public so you could call it on an timer.
{
new Query[255],atext[4],ltext[4];
for(new id; id < sizeof(CarInfo); id++) // Makes an loop so all vehicles get loaded.
{
format(Query, sizeof(Query), "SELECT * FROM vehicles WHERE CarID = %d", id);
mysql_query(Query); // Querys the "Query" Variable.
mysql_store_result(); // Stores the result from Query
if(mysql_num_rows())
{
if(mysql_fetch_row(Query)) // Splits the row
{
sscanf(Query, "p<|>e<iffffiis[25]s[25]iiiiiiiii>",CarInfo[id]);
if(CarInfo[id][cAlarm] == 1)
atext="ON";
else
atext="OFF";
if(CarInfo[id][cAlarm] == 1)
ltext="ON";
else
ltext="OFF";
printf("CarInfo: %d Owner:%s, Alarm:%s, Insurance:%d Locked: %s",id,CarInfo[id][cOwner],atext,CarInfo[id][cInsurance],ltext);
}
}
else
{
print("no car loaded");
return 0;
}
}
return 1;
}
Can somebody help me?
Thanks