Warning... - 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)
+--- Thread: Warning... (
/showthread.php?tid=488683)
Warning... -
Smokkr - 18.01.2014
Ok. here's one code for reading .txt files in-game:
pawn Код:
CMD:read(playerid,params[])
{
new tmp[60],store[256],string[158];
if (sscanf(params, "s[60]",tmp)) return SendClientMessage(playerid, -1, "Usage: /Read TextFile (include .txt)");
new File:file = fopen(tmp,io_read);
while(fread(file,store))
{
format(string,sizeof(string),"%s",file); //problem line - 277
SendClientMessage(playerid,-1,string);
}
return 1;
}
So on that line 277 (the problem line) shows a warning: C:\Users\*****\Desktop\Untitled.pwn(277) : warning 213: tag mismatch
where is the problem??
Re: Warning... -
gtascripterultimate - 19.01.2014
Quote:
Originally Posted by Smokkr
Ok. here's one code for reading .txt files in-game:
pawn Код:
CMD:read(playerid,params[]) { new tmp[60],store[256],string[158]; if (sscanf(params, "s[60]",tmp)) return SendClientMessage(playerid, -1, "Usage: /Read TextFile (include .txt)"); new File:file = fopen(tmp,io_read); while(fread(file,store)) { format(string,sizeof(string),"%s",file); //problem line - 277 SendClientMessage(playerid,-1,string); } return 1; }
So on that line 277 (the problem line) shows a warning: C:\Users\*****\Desktop\Untitled.pwn(277) : warning 213: tag mismatch
where is the problem??
|
Try this:
Код:
CMD:read(playerid,params[])
{
new tmp[60],store[256],string[158];
if (sscanf(params, "s[60]",tmp)) return SendClientMessage(playerid, -1, "Usage: /Read TextFile (include .txt)");
new file:file = fopen(tmp,io_read);
while(fread(file,store))
{
format(string,sizeof(string),"%s",file); //problem line - 277
SendClientMessage(playerid,-1,string);
}
return 1;
}