06.02.2010, 11:34
Hello guys, i need help with my script
Here is some ligne that i have create
Here is the result
But i don't know what is wrong :/
Thank you
Here is some ligne that i have create
Код:
#define MAX_DATTE_AUTOSECU (3) // Datte auto secu forward SaveAutoSecu(); forward LoadAutoSecu();
Код:
new Datte[MAX_VEHICLES][MAX_DATTE_AUTOSECU]; // Datte autosecu
Код:
if(strcmp(cmd, "/autosecuriter", true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
new year, month, day;
getdate(year, month, day);
Datte[carid][1] = day;
Datte[carid][2] = month;
Datte[carid][3] = year;
}
else
{
SendClientMessage(playerid, COLOR_WHITE,"Ce vehicule ne vous appartient pas !");
}
return 1;
}
return 1;
}
Код:
public SaveAutoSecu()
{
new idx;
new File: file2;
idx = 1;
while (idx < sizeof(CarInfo))
{
new coordsstring[256];
format(coordsstring, sizeof(coordsstring), "%i,%i,%i,\n",
Datte[idx][1],
Datte[idx][2],
Datte[idx][3],
if(idx == 1)
{
file2 = fopen("AutoSecu.cfg", io_write);
}
else
{
file2 = fopen("AutoSecu.cfg", io_append);
}
fwrite(file2, coordsstring);
idx++;
fclose(file2);
}
return 1;
}
Код:
public LoadAutoSecu()
{
new arrCoords[13][64];
new strFromFile2[256];
new File: file = fopen("AutoSecu.cfg", io_read);
if (file)
{
new idx = 1;
while (idx < sizeof(CarInfo))
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, ',');
Datte[idx][1] = strval(arrCoords[0]);
Datte[idx][2] = strval(arrCoords[1]);
Datte[idx][3] = strval(arrCoords[2]);
idx++;
}
}
return 1;
}
Код:
C:\Documents and Settings\Propriйtaire\Bureau\serveur samp\LARP\Bon serv\gamemodes\CDC7.pwn(29238) : error 032: array index out of bounds (variable "Datte") C:\Documents and Settings\Propriйtaire\Bureau\serveur samp\LARP\Bon serv\gamemodes\CDC7.pwn(52845 -- 52848) : error 032: array index out of bounds (variable "Datte") C:\Documents and Settings\Propriйtaire\Bureau\serveur samp\LARP\Bon serv\gamemodes\CDC7.pwn(52845 -- 52849) : error 029: invalid expression, assumed zero C:\Documents and Settings\Propriйtaire\Bureau\serveur samp\LARP\Bon serv\gamemodes\CDC7.pwn(52849 -- 52850) : error 029: invalid expression, assumed zero C:\Documents and Settings\Propriйtaire\Bureau\serveur samp\LARP\Bon serv\gamemodes\CDC7.pwn(52849 -- 52850) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors.
Thank you

