Raised This Month: $ Target: $400
 0% 

File Writing....:O


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
mysticssjgoku4
Veteran Member
Join Date: Jan 2005
Location: Chicago Heights, IL
Old 07-13-2006 , 05:53   File Writing....:O
Reply With Quote #1

The below code reports "Found" but doesn't write the extra line to the file.
No error reported, nothing.
but if it doesn't find the map in the file, it does create the lines as defined in after "if(iFound == 0)".
IT doesn't add the extra snippet lines after the server print though.
Any clue?
Thanks

Code:
            new file_handle = fopen(g_file_path,"rt+")                         new iFound = 0             new temp_string[128]                         while(!feof(file_handle))             {                 new buffer[128]                 fgets(file_handle,buffer,sizeof(buffer))                 if(containi(buffer,g_map_name) != -1)                 {                     iFound = 1                     server_print("Found!")                     format(temp_string,sizeof(temp_string),"^n[Ent] %s %i %i %i %i^n",gName,origin[0],origin[1],origin[2],angle)                     fprintf(file_handle,temp_string)                     break;                 }             }                         if(iFound == 0)             {                 format(temp_string,sizeof(temp_string),"^n[%s]^n[Ent] %s %i %i %i %i^n[/%s]^n",g_map_name,gName,origin[0],origin[1],origin[2],angle,g_map_name)                 fprintf(file_handle,temp_string)             }                         client_print(id,print_console,"[Ent Spawner] Entity %s was saved to file!",gName)             fclose(file_handle)
__________________

mysticssjgoku4 is offline
Send a message via AIM to mysticssjgoku4 Send a message via MSN to mysticssjgoku4
 



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 07:56.


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