| Issue 317: | !slap addon | |
| 2 people starred this issue and may be notified of changes. | Back to list |
I liked it where when u slapped someone it hit them in the air a little maybe you could change it so it would be like !slap [Damage] [Amount]
Jan 5, 2012
addons/evolve/lua/ev_plugins sh_slap.lua its already there |
function ulx.whip( calling_ply, target_plys, times, dmg ) local affected_plys = {} for i=1, #target_plys do local v = target_plys[ i ] if v.whipped then ULib.tsayError( calling_ply, v:Nick() .. " is already being whipped by " .. v.whippedby, true ) elseif v:IsFrozen() then ULib.tsayError( calling_ply, v:Nick() .. " is frozen!", true ) else local dtime = 0 v.whipped = true v.whippedby = calling_ply:IsValid() and calling_ply:Nick() or "(Console)" v.whipcount = 0 v.whipamt = times timer.Create( "ulxWhip" .. v:EntIndex(), 0.5, 0, function() -- Repeat forever, we have an unhooker inside. if not v:IsValid() then timer.Remove( "ulxWhip" .. v:EntIndex() ) return end -- Gotta make sure they're still there since this is a timer. if v.whipcount == v.whipamt or not v:Alive() then v.whipped = nil v.whippedby = nil v.whipcount = nil v.whipamt = nil timer.Remove( "ulxWhip" .. v:EntIndex() ) else ULib.slap( v, dmg ) v.whipcount = v.whipcount + 1 end end ) table.insert( affected_plys, v ) end end ulx.fancyLogAdmin( calling_ply, "#A whipped #T #i times with #i damage", affected_plys, times, dmg ) end local whip = ulx.command( CATEGORY_NAME, "ulx whip", ulx.whip, "!whip" ) whip:addParam{ type=ULib.cmds.PlayersArg } whip:addParam{ type=ULib.cmds.NumArg, min=2, max=100, default=10, hint="times", ULib.cmds.optional, ULib.cmds.round } whip:addParam{ type=ULib.cmds.NumArg, min=0, default=0, hint="damage", ULib.cmds.optional, ULib.cmds.round } whip:defaultAccess( ULib.ACCESS_ADMIN ) whip:help( "Slaps target(s) x times with given damage each time." ) This would work if you had ULib with it too....