General > Developers Corner

Admin sounds, tools and other code chat.

<< < (18/31) > >>

Chironex:
Try

effectdata:SetAngle( Angle( 0, 0, 90) )

jay209015:

--- Quote from: Kyzer on April 29, 2008, 10:16:10 PM ---Try

effectdata:SetAngle( Angle( 0, 0, 90) )

--- End quote ---


Nothing happend :'(

jay209015:
I've tried all angles I could think of, it doesn't even rotate at all. It's always vertical, and rotated the same way.

Chironex:
Try moving the line SetAngle at the beginning, dunno. Also maybe try to disable SetStart and SetNormal (i don't even know what are these functions)

jay209015:
Tried and it didn't work :'(
Ok, randomly works now. Thanks. Code:

==EDIT==
Nvm, if you shoot the ground with a tool gun or any flat horizontal prop the effect rotates to follow that, same for any angle. Is there A way I can make this effect unique?


--- Code: ---local function MakeEffect( ply )
local effectdata = EffectData()
effectdata:SetAngle( Angle( 0, 0, 90 ) )
effectdata:SetOrigin( ply:GetPos() )
effectdata:SetMagnitude( 3 )
effectdata:SetScale( 2 )
effectdata:SetRadius( 5 )
util.Effect( "selection_indicator", effectdata, true, true )
end
function AdminJoin( ply)
if ( !ply:IsAdmin() ) then return end
timer.Simple( 3, game.ConsoleCommand, "ulx playsound admin.mp3 \n")
timer.Simple( 5, game.ConsoleCommand, "ulx csay admin " ..ply:Nick().. " has connected \n")
timer.Create( "Admin" ..ply:SteamID( ), 1, 0, MakeEffect, ply )
function PlyDisconnected( ply )
if ply:IsValid() then
timer.Destroy( "Admin" ..ply:SteamID( ) )
end
end
hook.Add( "PlayerDisconnected" , "PlyDisconnected" , PlyDisconnected )
end
hook.Add( "PlayerInitialSpawn", "AdminJoin", AdminJoin )
concommand.Add( "Ajoin", AdminJoin )
function AdminWrite( ply )
content = file.Read( "Umotd/admins.txt" )
contentp = file.Read( "Umotd/players.txt" )
if ply:IsUserGroup("admin") || ply:IsUserGroup("superadmin") then
if string.find( content, ply:Nick(), 1, true ) then
content = content
else
content = string.gsub( content, "</div></div></body>", "<li>" ..ply:Nick().. "</div></div></body>" )
file.Write( "Umotd/admins.txt", content )
end
else
if string.find( contentp, ply:Nick(), 1, true ) then
contentp = contentp
else
contentp = string.gsub( contentp, "</div></div></body>", "<li>" ..ply:Nick().. "</div></div></body>" )
file.Write( "Umotd/players.txt", contentp )
end
end
end
hook.Add( "PlayerSpawn", "AdminWrite", AdminWrite )
--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version