Loading

ULX Model

  1. local t = {
  2.         "models/player/alyx.mdl",
  3.         "models/player/breen.mdl",
  4.         "models/player/barney.mdl",
  5.         "models/player/eli.mdl",
  6.         "models/player/gman_high.mdl",
  7.         "models/player/kleiner.mdl",
  8.         "models/player/monk.mdl",
  9.         "models/player/odessa.mdl",
  10.         "models/player/magnusson.mdl"
  11. }
  12.  
  13. function ulx.model( calling_ply, target_plys, model )
  14.         for k, v in next, target_plys do
  15.                 if ( !v:Alive() ) then
  16.                         ULib.tsayError( calling_ply, v:Nick() .. " is dead", true )
  17.                 else
  18.                         v:SetModel( model )
  19.                 end
  20.         end
  21.         ulx.fancyLogAdmin( calling_ply, true, "#A changed the model for #T", target_plys, model )
  22. end
  23. local model = ulx.command( "Fun", "ulx model", ulx.model, "!model" )
  24. model:addParam{ type=ULib.cmds.PlayersArg }
  25. model:addParam{ type=ULib.cmds.StringArg, hint="model", completes=t, ULib.restrictToCompletes }
  26. model:defaultAccess( ULib.ACCESS_ADMIN )
  27. model:help( "Sets your model." )

Comments