strlen(str[]) doesn't work :/
#5

Quote:
Originally Posted by Goldkiller
Do you think the len of BanInfoIP can be longer than it's maximum len / size?
BanInfoIP hat 16 cells,hence the string can't be longer than 16.
That 'Server Unkown Command' show's up because there must be some kind of crash.
pawn Код:
new
    BanInfoIp[16];
if(strlen( params ) >= 16) {
    return SendClientMessage(playerid,red,"[SERVER]: Command too long...");
}else if (sscanf(params, "s",BanInfoIp)) {
    return SendClientMessage(playerid, red, "[SERVER]: Naudojimas: \"/baninfo [ip]\"");
}
No, i dont think that string can be longer than 16, but if i write more SERVER: Unknown command shows up, as you said it shows up for some kind of crash, oh that crash, totally crashing my server.

This works for command where i need to write something in one string.
But what abbout commands like:
/kick [id] [reason] ?
How to check that [rason] wouldn't be longer than i writed in new Reason[56] ?
Do everything like in /baninfo ? with strlen(params) (knowing that first going ID, not string) ?
Reply


Messages In This Thread
strlen(str[]) doesn't work :/ - by Dreftas - 28.06.2009, 08:05
Re: strlen(str[]) doesn't work :/ - by illay - 28.06.2009, 08:40
Re: strlen(str[]) doesn't work :/ - by Dreftas - 28.06.2009, 08:46
Re: strlen(str[]) doesn't work :/ - by Goldkiller - 28.06.2009, 09:01
Re: strlen(str[]) doesn't work :/ - by Dreftas - 28.06.2009, 09:09
Re: strlen(str[]) doesn't work :/ - by woot - 28.06.2009, 09:12
Re: strlen(str[]) doesn't work :/ - by Dreftas - 28.06.2009, 09:14

Forum Jump:


Users browsing this thread: 1 Guest(s)