Raised This Month: $ Target: $400
 0% 

wont save to file...


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
bwgrubbs1
Senior Member
Join Date: Sep 2006
Old 06-30-2007 , 23:06   wont save to file...
Reply With Quote #1

For some reason this won't write a file...
From amx_climb_timer.

Got any ideas ?

Code:
public read_button_locs() {     for( new i = 0 ; i < 3; ++i ) {         start_loc[i] = 0         stop_loc[i]  = 0         }         new pathname[128]     get_cvar_string("amx_climbtimer_path",pathname,127)             new mapname[64]     get_mapname(mapname,63)         new filename[128]         format(filename, 127, "%s/%s.txt", pathname, mapname)             if( file_exists(filename) ) {         new number[192], line = 0, txtsize = 0         for( new i = 0 ; i < 3; i++ ) {             if( (line=read_file(filename,line,number,191,txtsize))!=0 )                   start_loc[i] = str_to_num( number )             else {                             locs_set = 0                 return PLUGIN_HANDLED             }         }         for( new i = 0 ; i < 3; i++ ) {             if( (line=read_file(filename,line,number,191,txtsize))!=0 )                   stop_loc[i] = str_to_num( number )             else {                             locs_set = 0                 return PLUGIN_HANDLED             }         }                 locs_set = 1     }     else {         locs_set = 0     }     return PLUGIN_HANDLED }

Code:
public save_button_locs( id ) {         if( start_loc[0] == 0 && start_loc[1] == 0 && start_loc[2] == 0 ) {         client_print(id,print_chat,"[%s] Can't save locs! Start loc are not set.", ct_pluginname )         return PLUGIN_HANDLED     }     if( stop_loc[0] == 0 && stop_loc[1] == 0 && stop_loc[2] == 0 ) {         client_print(id,print_chat,"[%s] Can't save locs! Stop loc are not set.", ct_pluginname )         return PLUGIN_HANDLED     }         new pathname[128]     get_cvar_string("amx_climbtimer_path",pathname,127)             new mapname[64]     get_mapname(mapname,63)         new filename[128]         format(filename, 127, "%s/%s.txt", pathname, mapname)             if( file_exists(filename) )           delete_file(filename)         for( new i = 0 ; i < 3; i++ ) {         new number[192]         num_to_str(start_loc[i],number,191)         write_file(filename, number)             }             for( new i = 0 ; i < 3; i++ ) {         new number[192]         num_to_str(stop_loc[i],number,191)         write_file(filename, number)             }         client_print(id,print_chat,"[%s] Start and stop loc are saved.", ct_pluginname )         set_user_gravity(id, 1.0)     client_print(id,print_chat,"[%s] Your gravity has been set to normal.", ct_pluginname )     return PLUGIN_HANDLED }
bwgrubbs1 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 21:25.


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