SA-MP Forums Archive
Problem!! - 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!! (/showthread.php?tid=612545)



Problem!! - Micko123 - 19.07.2016

PHP код:
error 035argument type mismatch (argument 1
I have 26 of those

This is the line
PHP код:
UpisiLog(LOG_REGISTERstring); 
This is for saving logs. What is the problem??


Re: Problem!! - Sjn - 19.07.2016

Show the function, your first argument LOG_REGISTER isn't matching it's type. You probably have it as an integer in the function but you're trying to pass a string in it.


Re: Problem!! - Micko123 - 19.07.2016

PHP код:
stock UpisiLog(fajl[], string[])
{
    new 
unos[256];
    new 
satminutsekunddanmesecgodina;
    
gettime(satminutsekund);
    
getdate(godinamesecdan);
    
format(unos256"[%d/%d/%d - %d:%d:%d] %s\r\n"danmesecgodinasatminutsekundstring);
    new 
File:hFile;
    
hFile fopen(fajlio_append);
    
fwrite(hFileunos);
    
fclose(hFile);
    return 
1;

That is UpisiLog (WriteLog) function. What do you need??


Re: Problem!! - Stinged - 19.07.2016

When you ask for help and it's about a non-native function, post the function.

EDIT: Show your definition of LOG_REGISTER.


Re: Problem!! - Micko123 - 19.07.2016

PHP код:
#define LOG_REGISTER                    "Logovi/Registracija.txt" 



Re: Problem!! - UltraScripter - 19.07.2016

Show us how you used upisilog!


Re: Problem!! - Micko123 - 19.07.2016

When player register on server it create string and string is sent to admins and it should be saved to log Registracija.txt.


Re: Problem!! - FuNkYTheGreat - 19.07.2016

im not confirmed but just try it.
Код:
stock UpisiLog(fajl[],LOG_REGISTER[], string[])
{
    new unos[256];
    new sat, minut, sekund, dan, mesec, godina;
    gettime(sat, minut, sekund);
    getdate(godina, mesec, dan);
    format(unos, 256, "[%d/%d/%d - %d:%d:%d] %s\r\n", dan, mesec, godina, sat, minut, sekund, string);
    new File:hFile;
    hFile = fopen(fajl, io_append);
    fwrite(hFile, unos);
    fclose(hFile);
    return 1;
}



Re: Problem!! - Micko123 - 19.07.2016

Quote:
Originally Posted by FuNkYTheGreat
Посмотреть сообщение
im not confirmed but just try it.
Код:
stock UpisiLog(fajl[],LOG_REGISTER[], string[])
{
    new unos[256];
    new sat, minut, sekund, dan, mesec, godina;
    gettime(sat, minut, sekund);
    getdate(godina, mesec, dan);
    format(unos, 256, "[%d/%d/%d - %d:%d:%d] %s\r\n", dan, mesec, godina, sat, minut, sekund, string);
    new File:hFile;
    hFile = fopen(fajl, io_append);
    fwrite(hFile, unos);
    fclose(hFile);
    return 1;
}
Nope it won't work because UpisiLog(WriteLog) is not only for register. it is for login, anti-cheat, kick...


Re: Problem!! - Stinged - 19.07.2016

Your function and your define should be working fine.
Are you using your function with another file path? Is it working?