This site has been archived and made available for preservation purposes. No edits can be made.

Results 1 to 7 of 7

Thread: [Help me] OnClientAuthenticate(const name{}, const pwd{})

  1. #1

    Question [Help me] OnClientAuthenticate(const name{}, const pwd{})

    Code :
    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:
    Code :
    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.
    Last edited by Lobzz1k; 09-03-2012 at 04:26 PM.

  2. #2
    Administrator
    Join Date
    Jun 2011
    Location
    Germany
    Posts
    1,057
    Blog Entries
    5
    Which is line 35 / 37? You'll need to show us the "Dini" include.

  3. #3
    as far as i know dini_Exists/diniVAULTCreate take only one parameter (string, which includes path/filename)

  4. #4
    if (!dini_Exists( "%s.ini", name )) -- line 35
    diniVAULTCreate( "%s.ini", name ); -- line 37

    Dini functions


    Code :
    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;
    }

  5. #5
    Quote Originally Posted by NeoPhoenix View Post
    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.

  6. #6
    does not change that parameters does not match. you have to use strformat and use the formated string as parameter

  7. #7
    Code :
    	new filePath[64];
    	strformat(filePath, sizeof(filePath), true, "%s.ini", name);
    	if (!dini_Exists(filePath))    
    	{        
    		diniVAULTCreate( filePath );        
    		return true;    
    	}
    There you go.


    I just come here to view whether there has been any progress or not, and review the wonderful progress that Recycler and the development team has made.
    My sincere thanks goes to them and to others who value my contributions the community, not to mention the ones that solely contribute.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •