Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hook.Add("PlayerSay", "MoneySystemChatCommands", function(ply, text, teamc, alive)
- local chat_string = string.Explode(" ", text);
- for k, v in pairs( chatcommands ) do
- if( chat_string[1] == k ) then
- table.remove(chat_string, 1);
- v(ply, chat_string);
- return "";
- end
- if( string.find(k, chat_string[1]) != nil ) then
- local start, endp, word = string.find(k, chat_string[1]);
- if( endp - (start - 1) > 2 ) then
- ply:ChatPrint("Unbekannter Befehl! Meintest du '"..tostring( k ).."'?");
- return "";
- end
- end
- end
- return text;
- end)
- function ChatCommand(strCommand, Func)
- if( !strCommand || !Func ) then return; end
- for k, v in pairs( chatcommands ) do
- if( strCommand == k ) then
- return;
- end
- end
- chatcommands[ tostring( strCommand ) ] = Func;
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement