AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Very noobie (Writing to file!) (https://forums.alliedmods.net/showthread.php?t=13873)

Sodium 06-01-2005 01:00

Very noobie (Writing to file!)
 
SOLVED.
Thanks alot, v3x.

nightscreem 06-01-2005 08:21

vex pls post how maybe i need it someday

Sodium 06-01-2005 08:36

code
 
Code:

#include <amxmodx>
#include <amxmisc>

public plugin_init() {
        register_plugin("pluginname","version","v3x..prettymuch")
        register_clcmd("amx_addtext","addtext")
}

new g_FileLocation[]="moddir\locationtofile.txt"

public addtext(id,level,cid) {
       
        if(!cmd_access(id,level,cid,2))
                return PLUGIN_HANDLED
               
        new fileTxt[64]
        format(fileTxt,63,"This text will be added to the file on a new line")
       
        write_file(g_FileLocation,fileTxt,-1)
        return PLUGIN_HANDLED
}

That's the basics!


All times are GMT -4. The time now is 16:49.

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