: error 017: undefined symbol "fdeleteline"
return SendClientMessage(playerid, COLOR_GREY, "Maximum characters limit is 128.");CMD:reportbug(playerid, params[])
{
if(sscanf(params, "s[128]", params))
return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /reportbug [text]");
if(strlen(params) > 12)
return SendClientMessage(playerid, COLOR_GREY, "Maximum characters limit is 128.");
new File: file = fopen("bugs.cfg", io_append), string[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof pName);
format(string, sizeof(string), "[%s] %s\r\n", pName, params);
fwrite(file, string);
fclose(file);
SendClientMessage(playerid, COLOR_ORANGE, "Your bug report has been saved, scripters will check it once possible.");
format(string, sizeof(string), "AdmWarn: %s has reported a bug, /bugs to view it. (Inform Zaiat about it ASAP)", pName);
SendAdminMessage(COLOR_DARKRED, 1, string);
return 1;
}
CMD:bugs(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 1)
return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
new string[128], File: file = fopen("bugs.cfg", io_read), idx=1;
SendClientMessage(playerid, COLOR_ORANGE, "[City Of Roleplay Bugs]:");
while(fread(file, string))
{
format(string, sizeof(string), "%d) %s", idx, string);
SendClientMessage(playerid, COLOR_ORANGE, string);
idx ++;
}
fclose(file);
return 1;
}
CMD:deletebug(playerid, params[])
{
new line;
if(PlayerInfo[playerid][pAdmin] < 7)
return SendClientMessage(playerid, COLOR_GREY, "You are not an authorized to use this command.");
if(sscanf(params, "i", line))
return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /deletebug [bugid]");
if(line < 1)
return SendClientMessage(playerid, COLOR_GREY, "Invalid bug id.");
new string[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof pName);
fdeleteline("bugs.cfg", line);
format(string, sizeof(string), "AdmWarn: %s has deleted bug ID %d.", pName, line);
SendAdminMessage(COLOR_DARKRED, 1, string);
return 1;
}
C:\Users\spider_net2\Desktop\MaServer\gamemodes\UGRP.pwn(87570) : error 017: undefined symbol "RPN" C:\Users\spider_net2\Desktop\MaServer\gamemodes\UGRP.pwn(87575) : error 035: argument type mismatch (argument 2) C:\Users\spider_net2\Desktop\MaServer\gamemodes\UGRP.pwn(87610) : error 017: undefined symbol "fdeleteline" C:\Users\spider_net2\Desktop\MaServer\gamemodes\UGRP.pwn(87612) : error 035: argument type mismatch (argument 2) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
C:\Users\kareem\Desktop\MaServer\gamemodes\UGRP.pwn(87594) : error 035: argument type mismatch (argument 2) C:\Users\kareem\Desktop\MaServer\gamemodes\UGRP.pwn(87629) : error 017: undefined symbol "fdeleteline" C:\Users\kareem\Desktop\MaServer\gamemodes\UGRP.pwn(87631) : error 035: argument type mismatch (argument 2) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Errors.
SendAdminMessage(COLOR_DARKRED, 1, string);
fdeleteline("bugs.cfg", line);
SendAdminMessage(COLOR_DARKRED, 1, string);
SendAdminMessage
fdeleteline(filename[], line)
{
new count, string[256], File:file, File:temp;
file= fopen(filename, io_read);
temp = fopen("tmpfile.tmp", io_write);
while (fread(file, string))
if (++count != line)
fwrite(temp, string);
fclose(file);
fclose(temp);
file= fopen(filename, io_write);
temp = fopen("tmpfile.tmp", io_read);
while (fread(temp, string))
fwrite(file, string);
fclose(file);
fclose(temp);
fremove("tmpfile.tmp");
}
|
Its this.
Код:
fdeleteline(filename[], line)
{
new count, string[256], File:file, File:temp;
file= fopen(filename, io_read);
temp = fopen("tmpfile.tmp", io_write);
while (fread(file, string))
if (++count != line)
fwrite(temp, string);
fclose(file);
fclose(temp);
file= fopen(filename, io_write);
temp = fopen("tmpfile.tmp", io_read);
while (fread(temp, string))
fwrite(file, string);
fclose(file);
fclose(temp);
fremove("tmpfile.tmp");
}
|