Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ranks = {}
- ranks["VIP"] = 75000
- ranks["Silver VIP"] = 250000
- ranks["Gold VIP"] = 500000
- ranks["Diamond VIP"] = 5000000
- ranks["Platinum VIP"] = 15000000
- local rankNames = {}
- for k, v in pairs( ranks ) do
- table.insert( rankNames, k )
- end
- function ulx.setvip( calling_ply, target_ply, rank, giveMoney )
- if !table.HasValue( rankNames, rank ) then
- calling_ply:ChatPrint("Invalid Rank")
- return false
- end
- if target_ply:GetUserGroup() == rank then
- calling_ply:ChatPrint("User already has " .. rank)
- return false
- end
- local userInfo = ULib.ucl.authed[ target_ply:UniqueID() ]
- local id = target_ply:SteamID()
- if giveMoney then
- target_ply:addMoney( ranks[rank] )
- end
- ULib.ucl.addUser( id, userInfo.allow, userInfo.deny, rank )
- if FAdmin != nil then
- FAdmin.Access.PlayerSetGroup( target_ply, rank )
- end
- ulx.fancyLogAdmin( calling_ply, "#A gave #T #s", target_ply, rank )
- end
- local setvip = ulx.command( CATEGORY_NAME, "ulx setvip", ulx.setvip, "!setvip" )
- setvip:addParam{ type=ULib.cmds.PlayerArg }
- setvip:addParam{ type=ULib.cmds.StringArg, hint="VIP Rank", completes=rankNames }
- setvip:addParam{ type=ULib.cmds.BoolArg, hint="Give Money?", ULib.cmds.optional }
- setvip:defaultAccess( ULib.ACCESS_ADMIN )
- setvip:help( "Sets targets rank to a vip rank." )
- function ulx.removevip( calling_ply, target_ply )
- local rank = target_ply:GetUserGroup()
- if !table.HasValue( rankNames, rank ) then
- calling_ply:ChatPrint("User does not have a VIP rank")
- return false
- end
- ULib.ucl.removeUser( target_ply:UniqueID() )
- if FAdmin != nil then
- FAdmin.Access.PlayerSetGroup( target_ply, "user" )
- end
- ulx.fancyLogAdmin( calling_ply, "#A removed #T's #s", target_ply, rank )
- end
- local removevip = ulx.command( CATEGORY_NAME, "ulx removevip", ulx.removevip, "!removevip" )
- removevip:addParam{ type=ULib.cmds.PlayerArg }
- removevip:defaultAccess( ULib.ACCESS_ADMIN )
- removevip:help( "Removes targets rank if they are vip." )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement