SA-MP Forums Archive
[Ajuda] Erro no formato - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Erro no formato (/showthread.php?tid=373874)



Erro no formato - CJoao - 31.08.2012

Devia de guarda tudo certinho mas

pawn Код:
format(var, 32, "CarModel=%d\n", DynamicCars[idx][CarModel]);fwrite(hFile, var);
format(var, 32, "CarX=%f\n",DynamicCars[idx][CarX]);fwrite(hFile, var);
format(var, 32, "CarY=%f\n", DynamicCars[idx][CarY]);fwrite(hFile, var);
format(var, 32, "CarZ=%f\n",DynamicCars[idx][CarZ]);fwrite(hFile, var);
format(var, 32, "CarAngle=%f\n", DynamicCars[idx][CarAngle]);fwrite(hFile, var);
format(var, 32, "CarColor1=%d\n",DynamicCars[idx][CarColor1]);fwrite(hFile, var);
format(var, 32, "CarColor2=%d\n", DynamicCars[idx][CarColor2]);fwrite(hFile, var);
format(var, 32, "FactionCar=%d\n",DynamicCars[idx][FactionCar]);fwrite(hFile, var);
format(var, 32, "CarType=%d\n", DynamicCars[idx][CarType]);fwrite(hFile, var);
format(var, 32, "cOwner=%d\n",DynamicCars[idx][cOwner]);fwrite(hFile, var);
format(var, 32, "cValue=%d\n",DynamicCars[idx][cValue]);fwrite(hFile, var);
format(var, 32, "cLock=%d\n",DynamicCars[idx][cLock]);fwrite(hFile, var);
format(var, 32, "cGold=%d\n",DynamicCars[idx][cGold]);fwrite(hFile, var);
format(var, 32, "cFuel=%f\n",DynamicCars[idx][cFuel]);fwrite(hFile, var);
format(var, 32, "cHealth=%f\n",DynamicCars[idx][cHealth]);fwrite(hFile, var);
Grava assim:

Exmplo
pawn Код:
CarModel=56 // isto certo devia ficar 256
CarX=644.38342 // certo
CarY=-566.01348 // certo
CarZ=15.84822 // certo
CarAngle=297.78631 // certo
CarColor1=  // devia ficar 0
CarColor2= // 0
FactionCar=25 // 0
CarType= // 0
cOwner= // 0
cValue= // 0
cLock= // 0
cGold= // 0
cFuel=0.00000 // certo
cHealth=1000.00000 // certo



Respuesta: Erro no formato - Truck - 31.08.2012

wtf ? O que nгo esta certo?

Veja:
pawn Код:
format(var, 32, "CarX=%f\n",DynamicCars[idx][CarX]);fwrite(hFile, var);
Esse \n Faz com que pule uma linha, e se vocк quiser deixar espaзo entre o '=' e o 'valor', apenas coloque o espaзo entre = e %.


Re: Respuesta: Erro no formato - CJoao - 01.09.2012

Quote:
Originally Posted by Truck
Посмотреть сообщение
wtf ? O que nгo esta certo?

Veja:
pawn Код:
format(var, 32, "CarX=%f\n",DynamicCars[idx][CarX]);fwrite(hFile, var);
Esse \n Faz com que pule uma linha, e se vocк quiser deixar espaзo entre o '=' e o 'valor', apenas coloque o espaзo entre = e %.
Nгo percebeu

pawn Код:
CarModel=56   <---------- isto devia tar 562 e ta 52
CarX=644.38342
CarY=-566.01348
CarZ=15.84822
CarAngle=297.78631
CarColor1=  
CarColor2=
FactionCar=25      <-------- devia tar 255 e ta 25
CarType=
cOwner=
cValue=  <---------- Supostamente devia tar  cValue=0 mas nao ta a gravar direito nгo intendo porque
cLock=
cGold=
cFuel=0.00000
cHealth=1000.00000
Algum campos ficarem sem numero quando devia e alguns ficao trocados ja percebeu?


Re: Erro no formato - CJoao - 01.09.2012

Alguem me ajuda?


Re: Erro no formato - CJoao - 01.09.2012

Alguem me ajuda? Por favor tou a precisar disso urgentemente


Re: Erro no formato - hard_dalzot - 01.09.2012

Vocк definiu o valor 0 para eles?

pawn Код:
DynamicCars[idx][CarColor1] = 0;
DynamicCars[idx][CarColor2] = 0;
DynamicCars[idx][FactionCar] = 255;      <-------- devia tar 255 e ta 25
DynamicCars[idx][CarType] = 0;
DynamicCars[idx][cOwner] = 0;
DynamicCars[idx][cValue] = 0; <---------- Supostamente devia tar  cValue=0 mas nao ta a gravar direito nгo intendo porque
DynamicCars[idx][cLock] = 0;
DynamicCars[idx][cGold] = 0;
Se tiver feito isso eu nгo sei o que pode ser mas tenta verificar se estб definido certinho


Re: Erro no formato - paulor - 01.09.2012

pawn Код:
format(var, 32, "CarModel=%d\r\n", DynamicCars[idx][CarModel]);fwrite(hFile, var);
format(var, 32, "CarX=%f\r\n",DynamicCars[idx][CarX]);fwrite(hFile, var);
format(var, 32, "CarY=%f\r\n", DynamicCars[idx][CarY]);fwrite(hFile, var);
format(var, 32, "CarZ=%f\r\n",DynamicCars[idx][CarZ]);fwrite(hFile, var);
format(var, 32, "CarAngle=%f\r\n", DynamicCars[idx][CarAngle]);fwrite(hFile, var);
format(var, 32, "CarColor1=%d\r\n",DynamicCars[idx][CarColor1]);fwrite(hFile, var);
format(var, 32, "CarColor2=%d\r\n", DynamicCars[idx][CarColor2]);fwrite(hFile, var);
format(var, 32, "FactionCar=%d\r\n",DynamicCars[idx][FactionCar]);fwrite(hFile, var);
format(var, 32, "CarType=%d\r\n", DynamicCars[idx][CarType]);fwrite(hFile, var);
format(var, 32, "cOwner=%d\r\n",DynamicCars[idx][cOwner]);fwrite(hFile, var);
format(var, 32, "cValue=%d\r\n",DynamicCars[idx][cValue]);fwrite(hFile, var);
format(var, 32, "cLock=%d\r\n",DynamicCars[idx][cLock]);fwrite(hFile, var);
format(var, 32, "cGold=%d\r\n",DynamicCars[idx][cGold]);fwrite(hFile, var);
format(var, 32, "cFuel=%f\r\n",DynamicCars[idx][cFuel]);fwrite(hFile, var);
format(var, 32, "cHealth=%f\r\n",DynamicCars[idx][cHealth]);fwrite(hFile, var);