glaube dieses führt eine cfg aus - keine txt... vielleicht nen anfang...
Code:
/* Includes */
#include <plugin>
#include <adminlib>
/* Global Variables */
new g_Version[] = "0.8";
/* Function Declarations */
forward AdminConfig(HLCommand,HLData,HLUserName,UserIndex);
forward RestartTimer(Timer,Repeat,HLUser,HLParam);
/* Event Handlers */
public plugin_init() {
plugin_registerinfo("...","...",g_Version);
plugin_registercmd("admin_war","AdminConfig",ACCESS_CONFIG,"...");
return PLUGIN_CONTINUE;
}
public RestartTimer(Timer,Repeat,HLUser,HLParam) {
setstrvar("sv_restartround","1");
}
/* Command Handlers */
public AdminConfig(HLCommand,HLData,HLUserName,UserIndex) {
new Data[MAX_DATA_LENGTH];
new UserName[MAX_NAME_LENGTH];
convert_string(HLData,Data,MAX_DATA_LENGTH);
convert_string(HLUserName,UserName,MAX_NAME_LENGTH);
if(fileexists(Data) == 0) {
strcat(Data,".cfg",MAX_DATA_LENGTH);
}
if(fileexists(Data) == 1) {
say_command(UserName,"admin_war",Data);
snprintf(Data,MAX_DATA_LENGTH,"exec %s",Data);
exec(Data);
set_timer("RestartTimer",1,2);
setstrvar("sv_restartround","1");
selfmessage("Success.");
} else {
selfmessage("File not found:");
selfmessage(Data);
}
return PLUGIN_HANDLED;
}