30.01.2015, 04:52
Hello. I just got stuck to this problem.
I created a gamemode which is seperated into modules(like southclaw's scavenge & survive). But command part doesn't work.
In the core file(which loaded first), I scripted like this
and second file, which loaded later, is scripted like this
and the error comes out
I understand this error, but I can't figure out how to solve this. What I want is to use cmd variable in first file in second file. Is this possible Thanks
I created a gamemode which is seperated into modules(like southclaw's scavenge & survive). But command part doesn't work.
In the core file(which loaded first), I scripted like this
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { new cmd[32], params[128]; sscanf(cmdtext, "s[32]s[128]", cmd, params); #if defined cmd_OnPlayerCommandText return cmd_OnPlayerCommandText(playerid, cmdtext[]); #else return 1; #endif } #if defined _ALS_OnPlayerCommandText #undef OnPlayerCommandText #else #define _ALS_OnPlayerCommandText #endif #define OnPlayerCommandText cmd_OnPlayerCommandText #if defined cmd_OnPlayerCommandText forward cmd_OnPlayerCommandText(playerid, cmdtext[]); #endif
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if(!strcmp(cmd, "/ahelp", true)) { return 1; } #if defined admin_OnPlayerCommandText return admin_OnPlayerCommandText(playerid, cmdtext); #else return 1; #endif } #if defined _ALS_OnPlayerCommandText #undef OnPlayerCommandText #else #define _ALS_OnPlayerCommandText #endif #define OnPlayerCommandText admin_OnPlayerCommandText #if defined admin_OnPlayerCommandText forward admin_OnPlayerCommandText(playerid, cmdtext[]); #endif
Код:
error 017: undefined symbol "cmd"