Raised This Month: $ Target: $400
 0% 

File write and Debug mode


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kangaroo
Member
Join Date: Jul 2007
Location: Toulon, France
Old 07-17-2007 , 08:51   File write and Debug mode
Reply With Quote #1

Hi all,

I want to store frags and deaths in a file and later read this information.

But when i want to use the read_file and write_file the server say me i need to use the debug mode for my plugins.
I actually write in folder "addons/amxmodx/logs/funsteam"

Is it a way to write file without use the debug mode ?
Because i think the plugins is faster in normal mode than debug mode.

My function :
PHP Code:
public SauveH(id)
{
 if (
get_cvar_num("amx_ApacheHistorique")==1
 {
  new 
text[33]
  new 
logfile[128]
 
  
format(text28"%04d %04d"PreT[id], PreM[id])
  
stock_replace_all(Steam[id], 31":""_")
  
format(logfile,127,"%s/%s.txt",LogPath,Steam[id])
  if(
file_exists(logfile)) delete_file(logfile)  // Bug Verygame
  
write_file(logfiletext0)
 }

Thanks.
Kangaroo is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 07-17-2007 , 14:39   Re: File write and Debug mode
Reply With Quote #2

The server is probably telling you to run the plugin in debug mode because there is an error. If you turn on debug mode, then you can see exactly which line of code is causing the error.

I'm guessing stock_replace_all() is causing an error, the rest looks ok.
stupok is offline
Kangaroo
Member
Join Date: Jul 2007
Location: Toulon, France
Old 07-18-2007 , 06:40   Re: File write and Debug mode
Reply With Quote #3

Thansk for your reply.

Yes the Add debug message came because there is an error.
Now there is no error, but the file is not create or update is there is no debug on line in plugins.ini
If i put debug it's ok !

Why is it necessary to be in debug mode to write file ?
Kangaroo is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 07-18-2007 , 07:11   Re: File write and Debug mode
Reply With Quote #4

Is not necessary but in you'r plugin is a mistake! Post the whole code , to help ya.
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Kangaroo
Member
Join Date: Jul 2007
Location: Toulon, France
Old 07-18-2007 , 08:01   Re: File write and Debug mode
Reply With Quote #5

Here the code.

Any comment for optimize is welcome

Edit : I'll post it because it is toobig for one message.

Last edited by Kangaroo; 07-18-2007 at 08:40. Reason: File too big for post.
Kangaroo is offline
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 07-18-2007 , 08:35   Re: File write and Debug mode
Reply With Quote #6

upload it or use [pawn] tag
__________________
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
Kangaroo
Member
Join Date: Jul 2007
Location: Toulon, France
Old 07-18-2007 , 08:42   Re: File write and Debug mode
Reply With Quote #7

In attachement the source.

This plugins was write initialy for amx and i'll try to port it to amxx
Attached Files
File Type: sma Get Plugin or Get Source (FunApacheX.sma - 797 views - 33.8 KB)
Kangaroo is offline
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 21:29.


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