Ulysses
General => Off-Topic => Topic started by: Golden-Death on July 06, 2007, 03:13:17 PM
-
Noob posts:
Hey guys, what's wrong with my code?
for i,1 maxplayers do
curtime = myvariable
end
Lua expert posts:
Dude, that's terrible. Do it like this:
For i,1 MaxPayers do
CurTime = MySuperTable[i] = 2 * (const*5)
return loop false;
end;
Another expert posts:
You guys are so stupid, watch and learn, noobs.
GDPTLastPos = {}
GDPTLastPart = {}
GDPTParticle = {}
GDParticleTimes = 0.02
for k,v in pairs(player.GetAll()) do
GDPTLastPos[v] = Vector(0,0,0)
GDPTLastPart[v] = 0
GDPTParticle[v] = nil
end
function GDDecipher(ply, command, argv, args)
if #argv < 1 then
ULib.tsay( ply, ulx.LOW_ARGS )
return
end
local matpassed = nil
if argv == "fire" then matpassed = "gd_fire" end
if argv == "bluefire" then matpassed = "gd_blueflame" end
if argv == "plasmablue" then matpassed = "gd_plasmablue" end
if argv == "plasmared" then matpassed = "gd_plasmared" end
if argv == "plasmagreen" then matpassed = "gd_plasmagreen" end
if argv == "plasmateal" then argvpassed = "gd_plasmateal" end
if argv == "plasmapurple" then matpassed = "gd_plasmapurple" end
if argv == "bloodblue" then matpassed = "gd_bloodblue" end
if argv == "bloodred" then matpassed = "gd_bloodred" end
if argv == "bloodgreen" then matpassed = "gd_bloodgreen" end
if argv == "bloodteal" then matpassed = "gd_bloodteal" end
if argv == "bloodpurple" then matpassed = "gd_bloodpurple" end
if argv == "ring" then matpassed = "gd_ring" end
if argv == "whiteshine" then matpassed = "gd_whitelight" end
if argv == "striderball" then matpassed = "gd_strider" end
if argv == "beam" then matpassed = "gd_beam" end
if argv == "flash" then matpassed = "gd_flash" end
if argv == "plasmarainbow" then matpassed = "gd_plasmaall" end
if argv == "bloodrainbow" then matpassed = "gd_bloodall" end
if argv == "light" then matpassed = "gd_light" end
if argv == "none" then GDParticle[ply] = nil end
GDParticle[ply] = matpassed
end
function GDParticleDraw()
for k,v in pairs(player.GetAll()) do
Msg(GDPTParticle[v])
if GDParticle[v] == nil then return;end
if GDPTLastPos[v] ~= v:GetPos() then
if GDPTLastPart[v] + GDParticleTimes < CurTime() then
local effectdata = EffectData()
effectdata:SetStart(v:GetPos())
effectdata:SetOrigin(v:GetPos())
effectdata:SetScale( 1 )
util.Effect( GDPTParticle[v], effectdata )
GDPTLastPos[v] = v:GetPos()
GDPTLastPart[v] = CurTime()
end
end
end
end
hook.Add( "Think", "GD Part Think", GDParticleDraw )
ulx.concommand( "trail", GDDecipher, "<choice> - Gives you a particle trail.", ULib.ACCESS_ALL )
ulx.concommand( "trailhelp", GDHelp, "- Displays all valid particles you can use.", ULib.ACCESS_ALL )
Noob replies:
Um.. what?
-
The perfect example. http://forums.facepunchstudios.com/showthread.php?t=370703 (http://forums.facepunchstudios.com/showthread.php?t=370703)
-
Haha, thats perfect.