AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   File write and Debug mode (https://forums.alliedmods.net/showthread.php?t=58025)

Kangaroo 07-17-2007 08:51

File write and Debug mode
 
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.

stupok 07-17-2007 14:39

Re: File write and Debug mode
 
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.

Kangaroo 07-18-2007 06:40

Re: File write and Debug mode
 
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 ?

Alka 07-18-2007 07:11

Re: File write and Debug mode
 
Is not necessary but in you'r plugin is a mistake! Post the whole code , to help ya.

Kangaroo 07-18-2007 08:01

Re: File write and Debug mode
 
Here the code.

Any comment for optimize is welcome :)

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

Greenberet 07-18-2007 08:35

Re: File write and Debug mode
 
upload it or use [pawn] tag

Kangaroo 07-18-2007 08:42

Re: File write and Debug mode
 
1 Attachment(s)
In attachement the source.

This plugins was write initialy for amx and i'll try to port it to amxx


All times are GMT -4. The time now is 21:29.

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