Error... - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Error... (
/showthread.php?tid=189602)
Error... -
Whizion - 12.11.2010
error 027: invalid character constant
So this is the first time i see this error and i don't know how to fix it:
pawn Код:
public Log(string[], filename[], player)
{
new h,mi;
gettime(h,mi);
new File:hFile;
new entry[256];
new year, month, day;
getdate(year, month, day);
if(player == 0)
{
format(entry, sizeof(entry), "XRPG\Logs\Global\%s",filename); // Here's the error.
hFile = fopen(entry, io_append);
format(entry, sizeof(entry), "[%02d/%02d/%02d @ %02d:%02d] %s\r\n",day,month,year,h,mi,string);
fwrite(hFile, entry);
fclose(hFile);
}
else
{
format(entry, sizeof(entry), "XRPG\Logs\Player\%s",filename); // And here's the error.
hFile = fopen(entry, io_append);
format(entry, sizeof(entry), "[%02d/%02d/%02d @ %02d:%02d] %s\r\n",day,month,year,h,mi,string);
fwrite(hFile, entry);
fclose(hFile);
}
return 1;
}
Please help, thank you.
Respuesta: Error... -
TheChaoz - 12.11.2010
change the '\' with '/'
Re: Respuesta: Error... -
LarzI - 12.11.2010
Quote:
Originally Posted by the_chaoz
change the '\' with '/'
|
Or add one additional '\'
Re: Respuesta: Error... -
Whizion - 12.11.2010
Quote:
Originally Posted by the_chaoz
change the '\' with '/'
|
I did, and it compiled the same.
Quote:
Originally Posted by LarzI
Or add one additional '\'
|
Where?
Re: Respuesta: Error... -
The_Moddler - 12.11.2010
Quote:
Originally Posted by Whizion
I did, and it compiled the same.
|
You didn't.
pawn Код:
stock Log(string[], filename[], player = 0)
{
new h,mi;
gettime(h,mi);
new File:hFile;
new entry[256];
new year, month, day;
getdate(year, month, day);
if(player == 0)
{
format(entry, sizeof(entry), "XRPG/Logs/Global/%s", filename);
hFile = fopen(entry, io_append);
format(entry, sizeof(entry), "[%02d/%02d/%02d @ %02d:%02d] %s\r\n",day,month,year,h,mi,string);
fwrite(hFile, entry);
fclose(hFile);
}
else
{
format(entry, sizeof(entry), "XRPG/Logs/Player/%s",filename);
hFile = fopen(entry, io_append);
format(entry, sizeof(entry), "[%02d/%02d/%02d @ %02d:%02d] %s\r\n",day,month,year,h,mi,string);
fwrite(hFile, entry);
fclose(hFile);
}
return 1;
}
Re: Error... -
Whizion - 12.11.2010
Thanks, it works.