View Full Version : [Help me] OnClientAuthenticate(const name{}, const pwd{})
Lobzz1k
09-03-2012, 04:24 PM
public OnClientAuthenticate(const name{}, const pwd{})
{
if (!dini_Exists( "%s.ini", name ))
{
diniVAULTCreate( "%s.ini", name );
return true;
}
else
{
return false;
}
}
when i compile it:
base.pwn(35) : warning 202: number of arguments does not match definition
base.pwn(37) : warning 202: number of arguments does not match definition
I am used Dini include.
And when i started this function (enter to server), its just creating file %s.ini.
foxtacles
09-03-2012, 04:43 PM
Which is line 35 / 37? You'll need to show us the "Dini" include.
NeoPhoenix
09-03-2012, 04:58 PM
as far as i know dini_Exists/diniVAULTCreate take only one parameter (string, which includes path/filename)
Lobzz1k
09-03-2012, 05:22 PM
if (!dini_Exists( "%s.ini", name )) -- line 35
diniVAULTCreate( "%s.ini", name ); -- line 37
Dini functions
stock dini_Exists(filename[]) {
return fexist(filename);
}
stock diniVAULTCreate(filename[]) {
if (fexist(filename)) return false;
new File:fhnd;
fhnd=fopen(filename,io_write);
if (fhnd) {
fclose(fhnd);
return true;
}
return false;
}
Lobzz1k
09-03-2012, 05:23 PM
as far as i know dini_Exists/diniVAULTCreate take only one parameter (string, which includes path/filename)
I know, %s is definition and name fill this definition.
NeoPhoenix
09-03-2012, 05:39 PM
does not change that parameters does not match. you have to use strformat and use the formated string as parameter
Aeronix
10-19-2012, 01:42 AM
new filePath[64];
strformat(filePath, sizeof(filePath), true, "%s.ini", name);
if (!dini_Exists(filePath))
{
diniVAULTCreate( filePath );
return true;
}
There you go.
Powered by vBulletin® Version 4.2.1 Copyright © 2023 vBulletin Solutions, Inc. All rights reserved.