1
Scripting SA-MP [Pawn center] / Re : Problème chargement
« le: 04 Novembre 2013, 19:11:59 »
Ce code consiste à chargé des intérieurs (qui son tous dans le même fichier) pour ensuite les sauvegardé dans des variables. Et j'ai remarqué que dès le premier FLOAT ce charge la fonction crash tout. Si je met un PRINTF après le premier FLOAT la console crash complétement 'SCRIPT' = le nom du fichier en #define
Code: [Sélectionner]
public chargerScriptInt()
{
printf("Okei1");
if(fexist(SCRIPT)) // Si le fichier existe.
{
printf("Okei2");
new File:intFiles = fopen(SCRIPT, io_read); // On l'ouvre
printf("Okei3");
new intstring[512];
printf("Okei4");
static Field[32][64];
printf("Okei5");
while(fread(intFiles, intstring, sizeof(intstring)))
{
printf("Okei6");
if(split2(intstring, Field, '|') == 10)
{
Info_Interieur[interieursCharges][pX] = floatstr(Field[0]);
// ICI SA CRASH SI JE MET UN PRINTF ET SI JE LAISSE COMME SA LA FONCTION CRASH
Info_Interieur[interieursCharges][pY] = floatstr(Field[1]);
Info_Interieur[interieursCharges][pZ] = floatstr(Field[2]);
Info_Interieur[interieursCharges][preA] = floatstr(Field[3]);
Info_Interieur[interieursCharges][pInt] = strval(Field[4]);
format(Info_Interieur[interieursCharges][info], MAX_PLAYER_NAME*3, "%s", Field[5]);
interieursCharges++;
printf("Interieur chargé : %f %f %f",Info_Interieur[interieursCharges][pX],Info_Interieur[interieursCharges][pY],Info_Interieur[interieursCharges][pZ]);
}
}
}
fclose(intFiles);
}