On mobile right now, so my help is limited.
One thing I noticed is the char functions need to be char[]. They must return a variable, not a const, meaning anything with quotes or brackets. You also cant initialize arrays with a non constant. It must first be declared, then set. Here is a working example:
Code:
#include <sourcemod>
public void OnPluginStart() {
char w[32];
w = f();
PrintToServer(w);
}
char[] f() {
char w[] = "whatever";
return w;
}
Might be better to instead pass the string as a function parameter by ref instead of returning it. Example:
Code:
#include <sourcemod>
public void OnPluginStart() {
char w[32]
f(w, sizeof(w));
PrintToServer(w);
}
void f(char[] w, int size) {
strcopy(w, size, "whatever");
}
Sourcepawn also does not allow string comparisons with ==. Use StrEqual or do someString[0] == '\0' to check if string is empty.
__________________