ID 0 bug
#8

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:
pawn Код:
// WRONG:
is (!strlen(params)) {
    // no params..
}
// CORRECT:
is (isnull(params)) {
    // no params..
}
Alternatively, you could make a macro and add it on the top of all commands:
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..
}
Reply


Messages In This Thread
ID 0 bug - by RedFusion - 01.07.2012, 13:04
Re: ID 0 bug - by LaGrande - 01.07.2012, 13:30
Re: ID 0 bug - by RedFusion - 01.07.2012, 14:30
Re: ID 0 bug - by Aprezt - 01.07.2012, 14:33
Re: ID 0 bug - by RedFusion - 01.07.2012, 15:39
Re: ID 0 bug - by LaGrande - 01.07.2012, 15:54
Re: ID 0 bug - by RedFusion - 01.07.2012, 16:46
Re: ID 0 bug - by Slice - 01.07.2012, 21:54
Re: ID 0 bug - by RedFusion - 01.07.2012, 21:58
Re: ID 0 bug - by Slice - 01.07.2012, 21:59

Forum Jump:


Users browsing this thread: 1 Guest(s)