open.mp forum
[Library] command-guess - Printable Version

+- open.mp forum (https://forum.open.mp)
+-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3)
+--- Forum: Releases (https://forum.open.mp/forumdisplay.php?fid=13)
+---- Forum: Libraries (https://forum.open.mp/forumdisplay.php?fid=31)
+---- Thread: [Library] command-guess (/showthread.php?tid=1701)



command-guess - Tama - 2021-02-23

command-guess

A guesser command who uses levenshtein distance algoritm written in pawn.
Now it's support ZCMD-like command processor!

Maybe if you want this to?support more command processor, just make an issue on my github?and i'll figure it out.


Usage:

PHP Code:
#include <a_samp> #include <izcmd> #include <command-guess> main() { ? ? print("Script loaded"); } public OnPlayerCommandPerformed(playerid, cmdtext[], success) { ? ? if (!success) { ? ? ? ? new ? ? ? ? ? ? guessCmd[32]; ? ? ? ? CommandGuess(guessCmd, cmdtext); ? ? ? ? SendClientMessageEx(playerid, -1, "{FF0000}ERROR:{FFFFFF} \"%s\" is not found, did you mean \"%s\"?", cmdtext, guessCmd); ? ? ? ? return 1; ? ? } ? ? return 1; }

Downloads:
GitHub Release


RE: command-guess - Freaksken - 2021-02-23

Wow, that's a clever use. Reminds me of command line tools that suggest corrections.