18.04.2014, 02:00
pawn Код:
C:\Users\user\Desktop\Nova pasta\texdraw\filterscripts\TextDrawEditor1.0.pwn(3140) : error 021: symbol already defined: "StripNewLine"
C:\Users\user\Desktop\Nova pasta\texdraw\filterscripts\TextDrawEditor1.0.pwn(3155) : error 021: symbol already defined: "fcopytextfile"
C:\Users\user\Desktop\Nova pasta\texdraw\filterscripts\TextDrawEditor1.0.pwn(3208) : error 021: symbol already defined: "HexToInt"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
3 Errors.
pawn Код:
stock StripNewLine(string[])
{//3140
new len = strlen(string);
if (string[0]==0) return ;
if ((string[len - 1] == '\n') || (string[len - 1] == '\r')) {
string[len - 1] = 0;
if (string[0]==0) return ;
if ((string[len - 2] == '\n') || (string[len - 2] == '\r')) string[len - 2] = 0;
}
}
stock fcopytextfile(oldname[],newname[]) {//3155
new File:ohnd,File:nhnd;
if (!fexist(oldname)) return false;
ohnd=fopen(oldname,io_read);
nhnd=fopen(newname,io_write);
new tmpres[256];
while (fread(ohnd,tmpres)) {
StripNewLine(tmpres);
format(tmpres,sizeof(tmpres),"%s\r\n",tmpres);
fwrite(nhnd,tmpres);
}
fclose(ohnd);
fclose(nhnd);
return true;
}
stock HexToInt(string[]) {//3208
if (string[0]==0) return 0;
new i;
new cur=1;
new res=0;
for (i=strlen(string);i>0;i--) {
if (string[i-1]<58) res=res+cur*(string[i-1]-48); else res=res+cur*(string[i-1]-65+10);
cur=cur*16;
}
return res;
}