Raised This Month: $ Target: $400
 0% 

Very noobie (Writing to file!)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Sodium
Member
Join Date: Oct 2004
Old 06-01-2005 , 08:36   code
Reply With Quote #3

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!
Sodium is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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