ULX

Author Topic: StatueMod V2  (Read 13305 times)

0 Members and 1 Guest are viewing this topic.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6213
  • Karma: 394
  • Project Lead
Re: StatueMod V2
« Reply #15 on: March 25, 2011, 09:06:06 PM »
Promised and delivered.  Sorry for the delay.  I adjusted it as I seen fit.

Code: [Select]
-- ULX Statue by Team DarkRP
function ulx.cc_goldstatue( ply, plys )
for _, v in pairs( plys ) do
if not v:Alive() then
ULib.tsay( ply, v:Nick() .. " is dead!", true )
return
end
if v.ragdoll then
ULib.tsay( ply, v:Nick() .. " is a ragdoll.", true )
return
end
if v:InVehicle() then
local vehicle = v:GetParent()
v:ExitVehicle()
end

v:Lock()
v:DisallowSpawning( true )
v:SetMaterial( "models/shiny" )
v:SetColor( 165, 145, 65, 255 )
v:ConCommand( "play physics/metal/metal_box_impact_bullet1.wav" )
ulx.setNoDie( v, true )
ulx.fancyLogAdmin( ply, "#A turned #T into a gold statue", plys )
end
end
local statue = ulx.command( "Fun", "ulx goldstatue", ulx.cc_goldstatue, "!goldstatue" )
statue:addParam{ type=ULib.cmds.PlayersArg, hint="<user(s)>" }
statue:defaultAccess( ULib.ACCESS_ADMIN )
statue:help( "Turns players into a golden statue." )

function ulx.cc_bronzestatue( ply, plys )
for _, v in pairs( plys ) do
if not v:Alive() then
ULib.tsay( ply, v:Nick() .. " is dead!", true )
return
end
if v.ragdoll then
ULib.tsay( ply, v:Nick() .. " is a ragdoll.", true )
return
end
if v:InVehicle() then
local vehicle = v:GetParent()
v:ExitVehicle()
end

v:Lock()
v:DisallowSpawning( true )
v:SetMaterial( "models/shiny" )
v:SetColor( 109, 67, 45, 255 )
v:ConCommand( "play physics/metal/metal_box_impact_bullet3.wav" )
ulx.setNoDie( v, true )
ulx.fancyLogAdmin( ply, "#A turned #T into a bronze statue", plys )
end
end
local bstatue = ulx.command( "Fun", "ulx bronzestatue", ulx.cc_bronzestatue, "!bronzestatue" )
bstatue:addParam{ type=ULib.cmds.PlayersArg, hint="<user(s)>" }
bstatue:defaultAccess( ULib.ACCESS_ADMIN )
bstatue:help( "Turns players into a bronze statue." )

function ulx.cc_silverstatue( ply, plys )
for _, v in pairs( plys ) do
if not v:Alive() then
ULib.tsay( ply, v:Nick() .. " is dead!", true )
return
end
if v.ragdoll then
ULib.tsay( ply, v:Nick() .. " is a ragdoll.", true )
return
end
if v:InVehicle() then
local vehicle = v:GetParent()
v:ExitVehicle()
end

v:Lock()
v:DisallowSpawning( true )
v:SetMaterial( "models/shiny" )
v:SetColor( 130, 128, 120, 255 )
v:ConCommand( "play physics/metal/metal_box_impact_bullet2.wav" )
ulx.setNoDie( v, true )
ulx.fancyLogAdmin( ply, "#A turned #T into a silver statue", plys )
end
end
local sstatue = ulx.command( "Fun", "ulx silvertatue", ulx.cc_silverstatue, "!silverstatue" )
sstatue:addParam{ type=ULib.cmds.PlayersArg, hint="<user(s)>" }
sstatue:defaultAccess( ULib.ACCESS_ADMIN )
sstatue:help( "Turns players into a silve statue." )

function ulx.cc_unstatue( ply, plys )
for _, v in pairs( plys ) do
if v:InVehicle() then
local vehicle = v:GetParent()
v:ExitVehicle()
end

v:UnLock()
v:DisallowSpawning( false )
v:SetMaterial( "" )
v:SetColor( 255, 255, 255, 255 )
v:ConCommand( "play player/suit_sprint.wav" )
ulx.setNoDie( v, false )
ulx.fancyLogAdmin( ply, "#A unstatued #T", plys )
end
end
local unstatue = ulx.command( "Fun", "ulx unstatue", ulx.cc_unstatue, "!unstatue" )
unstatue:addParam{ type=ULib.cmds.PlayersArg, hint="<user(s)>" }
unstatue:defaultAccess( ULib.ACCESS_ADMIN )
unstatue:help( "Unstatues a player." )


You have your log function inside a loop. ;)
Experiencing God's grace one day at a time.

Offline Aaron113

  • Hero Member
  • *****
  • Posts: 803
  • Karma: 102
Re: StatueMod V2
« Reply #16 on: March 26, 2011, 06:52:08 AM »
Fix'd ;D

Offline Zegyn

  • Newbie
  • *
  • Posts: 10
  • Karma: 1
Re: StatueMod V2
« Reply #17 on: April 03, 2011, 07:39:38 AM »
Thanks! I will upload it today or tomorrow (not sure) and I will also add you two into the credits.

Offline Zegyn

  • Newbie
  • *
  • Posts: 10
  • Karma: 1
Re: StatueMod V2
« Reply #18 on: April 05, 2011, 09:29:16 AM »
I have uploaded it now. I hope it works  :-\