Raised This Month: $ Target: $400
 0% 

Write_file makes an empty line


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ramono
Veteran Member
Join Date: Nov 2005
Location: Netherlands
Old 03-04-2006 , 08:28   Write_file makes an empty line
Reply With Quote #1

Code:
#include <amxmodx> new path[62] public plugin_init() {     register_plugin("Writefiletry","1.00","NL)Ramon(NL")     set_task(10.0,"deletefile") } public deletefile(){     new mapname[32]     get_mapname(mapname,31)     format(path,61,"addons/amxmodx/configs/maps/%s.cfg",mapname)     if (file_exists(path))         {         delete_file(path)     }     set_task(0.5,"setfile") } public setfile(){     new x_start[32]     format("x_start",31,"x_start %d",get_cvar_num("x_start"))     write_file(path, x_start,0)         new y_start[32]     format("y_start",31,"y_start %d",get_cvar_num("y_start"))     write_file(path, y_start,1)         new z_start[32]     format("z_start",31,"z_start %d",get_cvar_num("z_start"))     write_file (path, z_start,2) }

It compiles normal, but when i use it it writes an empty line!
__________________
Um, hi.
Ramono is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 03-04-2006 , 08:33  
Reply With Quote #2

everything like
Code:
format("x_start",31,"x_start %d",get_cvar_num("x_start"))
should be
Code:
format(x_start,31,"x_start %d",get_cvar_num("x_start"))
(No quotes around variable.)
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
Ramono
Veteran Member
Join Date: Nov 2005
Location: Netherlands
Old 03-04-2006 , 08:37  
Reply With Quote #3

Quote:
Originally Posted by Suicid3
everything like
Code:
format("x_start",31,"x_start %d",get_cvar_num("x_start"))
should be
Code:
format(x_start,31,"x_start %d",get_cvar_num("x_start"))
(No quotes around variable.)
Rofl, this kept me buzy like 3 hours....
Thanks, +k (when i can again)
__________________
Um, hi.
Ramono is offline
Reply


Thread Tools
Display Modes

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 20:15.


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