Team Spartan Cookies & Milk Forums
Release [For SF Developers] Chat Command Library - Printable Version

+- Team Spartan Cookies & Milk Forums (https://teamscm.co.uk)
+-- Forum: Garry's Mod (https://teamscm.co.uk/forum-4.html)
+--- Forum: Starfall (https://teamscm.co.uk/forum-7.html)
+--- Thread: Release [For SF Developers] Chat Command Library (/thread-1524.html)



[For SF Developers] Chat Command Library - Red The Blue Color - 09-01-2016

I just finished a Chat Lib that makes Chat commands even more basic(Including basic permission system 1-10 levels)

Credit: Superplayer for the idea and some code off his shared Big Grin

Features:

Basic Permissions System: 1-10 levels Add a player with /add PlyName RankNumber (0 removes) Access in Lua with
 SaveFile.Permissions[PlyConfusedteamID()] 
Will return number rank

Player name saving: Useful for when players aren't in the server and you still want to show their names on Starfall Screens Access in Lua with
 SaveFile.Players[PlyConfusedteamID()] 

Chat Command Registering and Running: Register chat commands easily Example:
RTBC.registerCommand(StringName, RankNumber, function(Args, Player) end StringNmae is Whats typed into chat ex: /level, Args is a Table
with everything typed after /level, Player gives player that ran command

level 1 commands can be run by level 1 and higher etc etc, level 0 are global player commands which can be ran by anyone

RTBC.registerCommand("level", 0, function(chatStr, Ply) 
local Player, Who = nil
if chatStr[1] == nil then
Player = Ply
Who = "You have"
else
Player = find.playerByName(chatStr[1])
if IsValid(Player) then
Who = Player:name().." has"
end
end

if IsValid(Player) then
if SaveFile.Permissions[PlayerConfusedteamID()] == nil then
Lvl = 0
else
Lvl = SaveFile.Permissions[PlayerConfusedteamID()]
end
bot("p",Who.." level "..Lvl.." access", colors.defualt, Ply)
end
end)

Planned Features:

Better Saving system with more modular aspects

Get it on shared or in attachment.

Please give any tips and advice on how it can be improved and where Big Grin No negative posts *cough* T-17 *cough*, please only positive.


Big Grin Happy Coding! Big Grin



RE: Chat Command Library - TheOneAndOnlyTee - 09-01-2016

should probably put "For SF Developers" somewhere so random 'people' don't ask me/you "how i ose dis".


RE: [For SF Developers] Chat Command Library - Blackhawk - 10-01-2016

Nice idea and good job, I really need to play more gmod Big Grin
And for the negative comments, they are more useful than positive ones if they are constructive.


RE: [For SF Developers] Chat Command Library - Red The Blue Color - 10-01-2016

(10-01-2016, 12:59 AM)Blackhawk Wrote: Nice idea and good job, I really need to play more gmod Big Grin
And for the negative comments, they are more useful than positive ones if they are constructive.

Thanks, and when I said negative comments I meant the asshole ones Big Grin i love constructive criticism when it's helpful.


RE: [For SF Developers] Chat Command Library - Liizzii - 11-01-2016

it's Lua, not LUA. Name, not acronym.

I've already fixed it in your main post.

Other than that looks pretty good, not sure if I'll use it myself because I have my own way of getting chat messages Smile


RE: [For SF Developers] Chat Command Library - Yuri6037 - 11-01-2016

Good job, interesting function... You just copied my idea of storing user names for later demote !
Anyways, good for new SF debs that have never touched any other language. However for me command system is highly more complexe as I use a similarity algorithm on LanAI Next. Version not even tested yet...