Quote:
Originally Posted by mineralo
pawn Код:
OnPlayerCommandText(playerid,cmdtext); { new cmd[256],idx,tmp[256]; cmd = strtok(cmdtext,idx); if(!strcmp(cmd,"/help",true)) { tmp = strtok(cmdtext,idx); if(!strcmp(tmp,"cmds",true)) { //your codes } return 1; } return 1; }
|
A lot of waste of memory here! 2 strings with size of 256, when the limit is 128.
Strcmp as a command processor (Basically, it is not even a command processor) and strtok are slow.
You should return 0 at the end of the callback.