SA-MP Forums Archive
Problem | file Functions - 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: Problem | file Functions (/showthread.php?tid=325915)



Problem | file Functions - Dan_S - 15.03.2012

Hello samp forum !,
my name is Dan and i have problem .

So I started a register System for my mode
and i scripting system System With include file
Now I have a problem with taking Password
I did like this:

PHP код:
        new File:gPass fopen(file(playerid), io_read);
        
fread(gPass"Password"); 
and :

PHP код:
if(!strcmp(inputtext,fread(gPass"Password"), true)) 
But I get ERROR :

PHP код:
C:\Users\Intel\Desktop\MyServer\gamemodes\NewMode.pwn(237) : error 035argument type mismatch (argument 2
I start with the file and I do not see the problem?
Plese Help me !


AW: Problem | file Functions - BigETI - 15.03.2012

This is actually not a SA:MP bug.
Post here your problem: http://forum.sa-mp.com/forumdisplay.php?f=12

Anyways fread will not return a string. You have to loop through your whole file by using
pawn Код:
while(fread(file, buffer))
{
    //Compare here the buffer array with your constant string.
}