AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Why my pluggin dont create file .ini? (https://forums.alliedmods.net/showthread.php?t=233787)

Bugg 01-20-2014 08:10

Why my pluggin dont create file .ini?
 
Im used this to create a file if dont exists..

Is something wrong?

PHP Code:

public plugin_init() 

    
    
load()
   


PHP Code:

load() {
    
    
Players TrieCreate()

    
    new 
ConfigDir[64]
  
    
    
get_configsdir(ConfigDircharsmax(ConfigDir))
    
    
format(ConfigDircharsmax(ConfigDir), "%s/players.ini"ConfigDir
    
    if(!
file_exists(ConfigDir)) {
        
        
create_file(ConfigDir)
        
        return
        
    } 

PHP Code:

create_file(ConfigDir[]) {
    
    new 
File fopen(ConfigDir"wt")
    
    
fprintf(File"; :Example^"^n^n^n;Enjoy")
    
    fclose(File)
    



pokemonmaster 01-20-2014 10:45

Re: Why my pluggin dont create file .ini?
 
I'm not sure but according to this i belive that fopen doesn't have a "t" mode, try removing it.

YamiKaitou 01-20-2014 10:59

Re: Why my pluggin dont create file .ini?
 
Quote:

Originally Posted by pokemonmaster (Post 2088533)
I'm not sure but according to this i belive that fopen doesn't have a "t" mode, try removing it.

https://web.archive.org/web/20120725...?go=func&id=92
t is valid for AMXX


All times are GMT -4. The time now is 10:06.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.