Advertisement
KimonK

Untitled

Dec 11th, 2020
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. hook.Add( "DarkRPFinishedLoading", "ML::ULX", function()
  2. local CATEGORY_NAME = "F3 Management";
  3. function ulx.setCredits( calling_ply, target_ply, amount )
  4. if( type( amount ) != "number" ) then
  5. calling_ply:ChatPrint( "Invalid amount! Only a number." );
  6. return;
  7. end
  8.  
  9. ML:SetCredits( target_ply, amount );
  10. ulx.fancyLogAdmin( calling_ply, "#A set #Ts credits to #i", target_ply, amount );
  11. end
  12. //local setCredits = ulx.command( CATEGORY_NAME, "ulx setcredits", ulx.setCredits, "!setcredits" )
  13. setCredits:addParam{ type=ULib.cmds.PlayerArg };
  14. setCredits:addParam{ type=ULib.cmds.NumArg, hint="credits" };
  15. setCredits:defaultAccess( ULib.ACCESS_ADMIN );
  16. setCredits:help( "Sets the F3 credits of a user." );
  17.  
  18. function ulx.addCredits( calling_ply, target_ply, amount )
  19. if( type( amount ) != "number" ) then
  20. calling_ply:ChatPrint( "Invalid amount! Only a number." );
  21. return;
  22. end
  23.  
  24. ML:AddCredits( target_ply, amount );
  25. ulx.fancyLogAdmin( calling_ply, "#A gave #T #i credits", target_ply, amount );
  26. end
  27. local addCredits = ulx.command( CATEGORY_NAME, "ulx addcredits", ulx.addCredits, "!addcredits" )
  28. addCredits:addParam{ type=ULib.cmds.PlayerArg };
  29. addCredits:addParam{ type=ULib.cmds.NumArg, hint="credits" };
  30. addCredits:defaultAccess( ULib.ACCESS_ADMIN );
  31. addCredits:help( "Add to the F3 credits of a user(you can use negative amounts like -100)." );
  32.  
  33. function ulx.getCredits( calling_ply, target_ply )
  34. calling_ply:ChatPrint( target_ply:Nick() .. " has " .. ( target_ply.Credits or 0 ) .. " credits." );
  35. end
  36. //local getCredits = ulx.command( CATEGORY_NAME, "ulx getcredits", ulx.getCredits, "!getcredits" )
  37. getCredits:addParam{ type=ULib.cmds.PlayerArg };
  38. getCredits:defaultAccess( ULib.ACCESS_ADMIN );
  39. getCredits:help( "Shows a users F3 credit amount." );
  40.  
  41. function ulx.resetAll( calling_ply, target_ply )
  42. ML:Reset( target_ply );
  43. ulx.fancyLogAdmin( calling_ply, "#A reset #Ts F3", target_ply );
  44. end
  45. local resetAll = ulx.command( CATEGORY_NAME, "ulx resetall", ulx.resetAll, "!resetall" )
  46. resetAll:addParam{ type=ULib.cmds.PlayerArg };
  47. resetAll:defaultAccess( ULib.ACCESS_ADMIN );
  48. resetAll:help( "Resets a users loadout, credits and owned items." );
  49. end );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement