Raised This Month: $51 Target: $400
 12% 

Help with write_file


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BeeFighter
Member
Join Date: Feb 2012
Old 03-08-2012 , 08:14   Help with write_file
Reply With Quote #1

so i've been doing some tests heres my code

PHP Code:
public Log(iPlayer)
{
    new 
iMessage[100]
    
formatex(iMessagecharsmax(iMessage), "[This is a log]")
    
write_file("addons/amxmodx/logtest.txt"iMessage)

This logs as [This is a log][This is a log][This is a log][This is a log]

Is there any way it would log like?
[This is a log]
[This is a log]
[This is a log]

Thanks in advanced
BeeFighter is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 03-08-2012 , 08:16   Re: Help with write_file
Reply With Quote #2

Try adding ^n at the end of your string.

If it's for logging purpose, you might wanna check the log_to_file() native.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
BeeFighter
Member
Join Date: Feb 2012
Old 03-08-2012 , 08:20   Re: Help with write_file
Reply With Quote #3

Thanks<3
BeeFighter is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-08-2012 , 17:45   Re: Help with write_file
Reply With Quote #4

Also keep in mind that if you ever have several write_file()'s in a row or loop then you should consider the fopen(), fputs(), fclose() system. It doesn't seem like you would need it for this one function but it's something to keep in mind.
__________________
fysiks is online now
Reply



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 01:49.


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