10.12.2016, 20:32
Quote:
Make a sscanf before the strcmp to check for even more parameters, but make it optional so it doesn't have to be included.
(https://sampforum.blast.hk/showthread.php?tid=570927) So simply: Code:
new subcmd[10], subcmdval[128]; if (sscanf(params, "s[10]S()[128]", subcmd, subcmdval)) { //Return something if user doesn't put it anything for "s[10]"! } if (strcmp(subcmd, "kick", true)) { new targetid; if (sscanf(subcmdval, "u", targetid)) { //Return something if user did "/cmd kick" but didn't put any value afterwards! } // Continue what happens if id was given } |
Have you got another solution?
Thanks!