1. i do this Vec = {}.
then i fill it Vec[1] = { X = 2, Y = 3, Z = 5}
How can i retrive X for instance?
2. How can i give a client overlays? Like stunstick effects etc.
thanks guys.
Lol thank you Maker in advance :D
1.
[lua]local Vec = {}
Vec[1] = {X=2, Y=3, Z=5}
print(Vec[1].X)
print(Vec[1]["X"]) -- Same thing[/lua]
Just to let you know, there is a Vector object in Garrysmod Lua.
[url]http://wiki.garrysmod.com/?title=Vector[/url]
Vector was just an example im gonna use it to do more complex things, but thanks this makes thing ALOT simpler lol
By overlays i mean this
ClientCommand(Client, "r_screenoverlay debug/yuv.vmt");
^ Sourcemod up there lol , yes im trying to learn lua now and ur a great helper :D.
[QUOTE=samantha/\;21719720]Vector was just an example im gonna use it to do more complex things, but thanks this makes thing ALOT simpler lol
By overlays i mean this
ClientCommand(Client, "r_screenoverlay debug/yuv.vmt");
^ Sourcemod up there lol , yes im trying to learn lua now and ur a great helper :D.[/QUOTE]
[lua]RunConsoleCommand("r_screenoverlay","debug/yuv.vmt")[/lua]
or
[lua]function PlayaOn(ply)
ply:ConCommand("r_screenoverlay debug/yuv.vmt")
end
concommand.Add("+overlay", PlayaOn)
function PlayaOff(ply)
ply:ConCommand("r_screenoverlay debug/yuv.vmt")
end
concommand.Add("-overlay", PlayaOff)
[/lua]
but that is flagged as a cheat command i think :D, so i think we need to deflag it, heres a sourcemod exapmle if u'd like
[Code]
SetCommandFlags("r_screenoverlay", (GetCommandFlags("r_screenoverlay") - FCVAR_CHEAT));[/Code]
You could just use pp_screenoverlay or whatever it is, the one inside the post processing menu in the Q menu.
[QUOTE=samantha/\;21739538]but that is flagged as a cheat command i think :D, so i think we need to deflag it, heres a sourcemod exapmle if u'd like
[Code]
SetCommandFlags("r_screenoverlay", (GetCommandFlags("r_screenoverlay") - FCVAR_CHEAT));[/Code][/QUOTE]
You would need, Cvar2.
[url]http://www.facepunch.com/showthread.php?t=729841[/url]
[lua]
require("cvar2")
cvar2.SetFlags("r_screenoverlay", cvar2.GetFlags("r_screenoverlay") - FCVAR_CLIENTCMD_CAN_EXECUTE)[/lua]
Sorry, you need to Log In to post a reply to this thread.