AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   deleting file (https://forums.alliedmods.net/showthread.php?t=188118)

hyphen 06-22-2012 13:17

deleting file
 
Want to clear all banned file ie: listip.cfg & banned.cfg by one admin command. Tried with following code but didn't work.

PHP Code:

if(!cmd_access(idlevelcid1))
    return 
PLUGIN_HANDLED

new file fopen("listip.cfg""wt")
if(
file)
{
    
fwrite_blocks (file""1BLOCK_CHAR)
}
fclose(file


Arkshine 06-22-2012 13:41

Re: deleting file
 
Just delete the file. It should be re-created. If not, simply delete + recreate it yourself.

hyphen 06-22-2012 15:04

Re: deleting file
 
Oh LOL. I just removed register_concmd() line from plugin_init(), so delete_file() didn't work.


All times are GMT -4. The time now is 06:19.

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