I'm having a problem with a function argument getting overwritten by another value.
The problem:
ImportantBlaat[] becomes the content of Text[];
When I call the function, ImportantBlaat[] is equal to Text[].
Maybe when Text[] is changed with read_file(), ImportantBlaat[] will be changed again so it becomes equal to Text[] again?
Actually, this is what's happening.
The test plugin:
Code:
new Text[1024],Size,File[]="blaat.txt";
public plugin_init() {
format(Text,sizeof(Text),"%s","This is REALLY important!");
function(Text);
}
public function(ImportantBlaat[]) {
// Debug: ImportantBlaat[] = "This is REALLY important!"
read_file(File,0,Text,sizeof(Text),Size);
// Debug: ImportantBlaat[] = "blaat"
server_print(ImportantBlaat);
}
Contents of blaat.txt:
Output:
Desired output:
Code:
This is REALLY important!