01.07.2012, 21:54
Because of a bug in CallLocalFunction, you can't pass empty strings. Therefore, ZCMD passes "\1" instead of an empty string.
A macro is provided to check if the params are empty:
Alternatively, you could make a macro and add it on the top of all commands:
A macro is provided to check if the params are empty:
pawn Код:
// WRONG:
is (!strlen(params)) {
// no params..
}
// CORRECT:
is (isnull(params)) {
// no params..
}
pawn Код:
#define NULL_PARAMS(); \
if (!isnull(params)){}else{params[0]='\0';}
// Usage:
CMD:blabla(playerid, params[]) {
NULL_PARAMS();
// code..
}
CMD:blabla(playerid, params[]) {
NULL_PARAMS();
// code..
}
CMD:blabla(playerid, params[]) {
NULL_PARAMS();
// code..
}