16.04.2009, 19:08
Ok, i have this, and i cant see why it doesnt work the way i want it to:
(all the variables are daclared etc etc, i only pasted the piece of code which is relevant)
This reads from a file containing these lines:
It should print out this:
but instead, it prints this:
I have no idea why it doesn't work properly and some parts work fine
If anyone could help me i would be very grateful
Thanks
David
EDIT: Ok i found the problem, the sscanf was failing due to too many params for AddStaticVehicle.
pawn Код:
for(new id; id<TotalVehicles; id++)
{
fread(carfile, carstr);
sscanf(carstr,"p(sp,ssssssss",type,params[0],params[1],params[2],params[3],params[4],params[5],params[6],params[7]);
printf("|%s|",type);
//more stuff here (not relevant)
This reads from a file containing these lines:
Код:
CreateVehicle(400,1,2,3,4,5,6,7); CreateVehicle(400,1,2,3,4,5,6,7); AddStaticVehicle(400,1,2,3,4,5,6); AddStaticVehicleEx(400,1,2,3,4,5,6,7); NonExistantVehicleThing(400,1,2,3,4,5,6,7);
Код:
|CreateVehicle| |CreateVehicle| |AddStaticVehicle| |AddStaticVehicleEx| |NonExistantVehicleThing|
Код:
|| || |AddStaticVehicle| || |NonExistantVehicleThing|
If anyone could help me i would be very grateful
Thanks
David
EDIT: Ok i found the problem, the sscanf was failing due to too many params for AddStaticVehicle.