AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Make File Delete It Self (https://forums.alliedmods.net/showthread.php?t=159215)

Dr7sTyLe 06-14-2011 06:36

Make File Delete It Self
 
Is there anyway to make the file delete it self by command ?(the .amxx file have Write , Read , Run , Do Acceses ..

ConnorMcLeod 06-14-2011 06:55

Re: Make File Delete It Self
 
Make that command send delete_file().

Dr7sTyLe 06-14-2011 10:37

Re: Make File Delete It Self
 
Quote:

Originally Posted by ConnorMcLeod (Post 1487948)
Make that command send delete_file().

PHP Code:

#include <amxmodx>

public plugin_init() 
{
    
register_logevent("roundcount"2"1=Round_Start"
    
register_logevent("roundcount1"2"1=Round_End"
    
register_clcmd("say /delete","delete")
}  

new 
g_roundCount
public roundcount()
{
++
g_roundCount
set_hudmessage
(255,255,255, -1.00.7116.010.01.00.1520)
show_hudmessage(0,"[ Day %d ]^n[vBullet]"g_roundCount)
new 
players[32], pnumtempid;
get_players(playerspnum);

for( new 
ii<pnumi++ )
{

tempid players[i];

message_begin(MSG_ONEget_user_msgid("ScreenFade"), {0,0,0}, tempid);
write_short(4096*1); // Duration
write_short(4096*2); // Hold time
write_short(4096); // Fade type
write_byte(0); // Red
write_byte(0); // Green
write_byte(0); // Blue
write_byte(255); // Alpha
message_end();
}
}
public 
roundcount1() {
set_hudmessage(255,255,255, -1.00.7106.010.01.00.151
show_hudmessage(0,"[ Day %d Ended ]^n[vBullet]"g_roundCount)

public 
delete()
{
    
delete_file()


? should i put their daysviewer.amxx ?

Devil259 06-14-2011 10:57

Re: Make File Delete It Self
 
http://www.amxmodx.org/funcwiki.php?go=func&id=89

delete_file ( const file[] )

Dr7sTyLe 06-14-2011 11:49

Re: Make File Delete It Self
 
Quote:

Originally Posted by Devil259 (Post 1488092)

i dont really know what that means but what sould i write in const file ?
i think that i need to put the filename.amxx

Exolent[jNr] 06-14-2011 11:56

Re: Make File Delete It Self
 
const file[] just means you need a string representing the file path to delete. The const can be ignored.

Also, the file path is relative to the cstrike/ folder.
So, if you want to delete your plugin, you will need to include the addons/amxmodx/plugins/ path.

ConnorMcLeod 06-14-2011 12:09

Re: Make File Delete It Self
 
Also, you may prefer to comment it in plugins.ini

Dr7sTyLe 06-14-2011 12:46

Re: Make File Delete It Self
 
thanks worked :)


All times are GMT -4. The time now is 23:24.

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