ULX

Author Topic: Weapon restrictions - Possible or not?  (Read 17380 times)

0 Members and 1 Guest are viewing this topic.

Tim

  • Guest
Re: Weapon restrictions - Possible or not?
« Reply #15 on: August 21, 2007, 02:08:10 PM »
They don't take any time at all, is the email here http://forums.ulyssesmod.net/index.php?action=profile;u=767 correct? Also, did you check spam?

I had set my email to private accidently, so I cannot see it. The address is geoff1505@yahoo.com if you wouldn't mind checking

Also kyzer, after looking over it again I see thats just what I did :P

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6213
  • Karma: 394
  • Project Lead
Re: Weapon restrictions - Possible or not?
« Reply #16 on: August 21, 2007, 02:26:13 PM »
Hmm, alright Tim. I went ahead and activated your account for you.
Experiencing God's grace one day at a time.

Offline rockonkenshin

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: Weapon restrictions - Possible or not?
« Reply #17 on: August 21, 2007, 02:29:55 PM »
Thank you very much! I don't know why it didn't get to me, I made sure to check my spam box too. Thats wierd.

Anyway, Thanks again ;D



Offline Typo001

  • Newbie
  • *
  • Posts: 14
  • Karma: 0
    • My (Personal) Site
Re: Weapon restrictions - Possible or not?
« Reply #18 on: April 06, 2008, 08:02:09 PM »
Well it works for me, but when I check teams in TAB, it is showing all yellow. The teams still work, it just will not showing. I will post my uteams txt and lua files.

TXT
Code: [Select]
"Out"
{
"teams"
{
"1"
{
"name" "Owner"
"group" "superadmin"
"armor" "2000"
"hp" "2000"
"weapons"
{
"1" "weapon_physgun"
"2" "gmod_tool"
"3" "gmod_camera"
"4" "weapon_physcannon"
"5" "weapon_crowbar"
"6" "weapon_pistol"
"7" "weapon_shotgun"
"8" "weapon_smg1"
"9" "weapon_crossbow"
"10" "weapon_357"
"11" "weapon_ar2"
"12" "weapon_frag"
"13" "weapon_annabelle"
"14" "weapon_slam"
"15" "item_ar2_grenade"
"16" "item_ml_grenade"
}
"color"
{
"a" "255"
"B" "255"
"g" "255"
"r" "255"
}
"plytable"
{
"1" "SprintSpeed:1000"
"2" "WalkSpeed:500"
}
}
"2"
{
"name" "HIGHLY Respected"
"group" "admin"
"armor" "1000"
"hp" "1000"
"weapons"
{
"1" "weapon_physgun"
"2" "gmod_tool"
"3" "gmod_camera"
"4" "weapon_physcannon"
"5" "weapon_crowbar"
"6" "weapon_pistol"
"7" "weapon_shotgun"
"8" "weapon_smg1"
"9" "weapon_crossbow"
"10" "weapon_357"
"11" "weapon_ar2"
"12" "weapon_frag"
}
"color"
{
"a" "255"
"B" "0"
"g" "240"
"r" "222"
}
}
"3"
{
"name" "Moderator Member"
"group" "moderator"
"armor" "500"
"hp" "500"
"weapons"
{
"1" "weapon_physgun"
"2" "gmod_tool"
"3" "gmod_camera"
"4" "weapon_physcannon"
"5" "weapon_crowbar"
"6" "weapon_pistol"
"7" "weapon_shotgun"
"8" "weapon_smg1"
}
"color"
{
"a" "255"
"B" "50"
"g" "50"
"r" "255"
}
}
"4"
{
"name" "Members"
"group" "operator"
"armor" "0"
"hp" "150"
"weapons"
{
"1" "weapon_physgun"
"2" "gmod_tool"
"3" "gmod_camera"
"4" "weapon_physcannon"
"5" "weapon_crowbar"
"6" "weapon_pistol"
}
"color"
{
"a" "255"
"B" "254"
"g" "172"
"r" "61"
}
}
"5"
{
"name" "N00b"
"group" "n00b"
"armor" "0"
"hp" "50"
"color"
{
"a" "255"
"B" "127"
"g" "127"
"r" "127"
}
"weapons"
{
"1" "weapon_physcannon"
"2" "gmod_camera"
}
}
"6"
{
"name" "Guest"
"group" "user"
"weapons"
{
"1" "weapon_physgun"
"2" "gmod_tool"
"3" "gmod_camera"
}
"color"
{
"a" "255"
"B" "138"
"g" "0"
"r" "135"
}
}
}
"gamemodes"
{
"1" "Sandbox"
"2" "Spacebuild2"
}
}
I do not think it is this since the teams are working

Lua
Code: [Select]
if not SERVER then return end

UTeam = {}

UTeam.BASETEAMINDEX = 20

UTeam.CONFIG = "UTeam.txt"

if not file.Exists( UTeam.CONFIG ) then
Msg( "[UTeam Error] UTeam config file missing.\n" )
return
end
local t = util.KeyValuesToTable( file.Read( UTeam.CONFIG ) )

if not t.teams then
Msg( "[UTeam Error] UTeam config teams table missing.\n" )
return
end
UTeam.teams = {}
for k,v in pairs( t.teams ) do
UTeam.teams[tonumber(k)]=v
end

if not t.gamemodes then
Msg( "[UTeam Error] UTeam config gamemodes table missing.\n" )
return
end
UTeam.gamemodes = t.gamemodes

function UTeam.checkGamemode()
for _,v in pairs( UTeam.gamemodes ) do
if string.lower(GAMEMODE.Name) == string.lower(v) then return true end
end
hook.Remove( "PlayerSpawn", "UTeamSetTeam" )
hook.Remove( "PlayerInitialSpawn", "UTeamSetupTeams" )
return false
end

function UTeam.setTeam( ply )
if not UTeam.checkGamemode() then return end

for k,v in ipairs( UTeam.teams ) do
if ply:IsUserGroup( v.group ) then
ply:SetTeam( UTeam.BASETEAMINDEX + k )
if v.hp then ply:SetHealth( v.hp ) end
if v.armor then ply:SetArmor( v.armor ) end
if v.model then timer.Simple( 0.1, ply.SetModel, ply, player_manager.TranslatePlayerModel( v.model ) )end
if v.weapons then
timer.Simple( 0.1, function(ply, v)
ply:StripWeapons()
for _,v in pairs(v.weapons) do
ply:Give( v )
end
ply:SelectWeapon(v.weapons[1])
end, ply, v)
end
if v.plytable then
timer.Simple( 0.1, function(ply, v)
for _,v in pairs(v.plytable) do
k = string.sub( v, 1, string.find( v, ":" ) - 1 )
v = string.sub( v, string.find( v, ":" ) + 1 )
ply:GetTable()[k] = tonumber(v) or v
end
end, ply, v)
end
break
end
end
end
hook.Add( "PlayerSpawn", "UTeamSetTeam", UTeam.setTeam )
Thanks.

Edit: Ok well it will not let me do any admin things (like !menu), but the HP and things work.
« Last Edit: April 06, 2008, 08:22:53 PM by Typo001 »

Offline Chironex

  • Full Member
  • ***
  • Posts: 197
  • Karma: 11
  • Formerly known as Kyzer
Re: Weapon restrictions - Possible or not?
« Reply #19 on: April 07, 2008, 03:16:05 AM »
Try moving the weapon part at the end of each groups

Offline Typo001

  • Newbie
  • *
  • Posts: 14
  • Karma: 0
    • My (Personal) Site
Re: Weapon restrictions - Possible or not?
« Reply #20 on: April 07, 2008, 12:18:42 PM »
Well I can do admin things again, but still getting everyone as yellow, and does not show the team you are on. Does it affect that I am using a deticated server? Or maybe it is because I am putting slam under superadmin? That is the only things I can thing of. I will try it with getting rid of the slam and see what happens.

Edit:
It is still giving me yellow, I am still going to try a listen server, but it might take some time becuase I keep getting a invalid steam user ID ticket while starting the server.
« Last Edit: April 07, 2008, 12:42:02 PM by Typo001 »

Offline johnlukeg

  • Newbie
  • *
  • Posts: 27
  • Karma: -1
Re: Weapon restrictions - Possible or not?
« Reply #21 on: April 07, 2008, 08:00:15 PM »
I'm getting the exact same problem as Typo, any idea how to fix this?

Offline Bounty_Bam

  • Newbie
  • *
  • Posts: 24
  • Karma: 0
Re: UTeam - Set teams based on usergroup.
« Reply #22 on: December 10, 2009, 10:30:53 AM »
What a coincidence.. I was about to ask how do I add weapon management to UTeam..

I've seen the code around here, if I remember correctly isn't it

Code: [Select]
"1"
{
"name" "Owner of [BS]"
"group" "superadmin"
"armor" "1000"
"hp" "1000"
"color"
{
"a" "255"
"B" "0"
"g" "179"
"r" "21"
}
"plytable"
{
"1" "SprintSpeed:1000"
"2" "WalkSpeed:500"
}
"model" "police"
}
"weapons"
            {
            "weapon_pistol"
            }
}


EDIT: Found it:
http://forums.ulyssesmod.net/index.php/topic,1171.msg5586.html#msg5586
« Last Edit: December 10, 2009, 11:01:48 AM by Bounty_Bam »

Offline Bounty_Bam

  • Newbie
  • *
  • Posts: 24
  • Karma: 0
Re: Weapon restrictions - Possible or not?
« Reply #23 on: December 13, 2009, 06:17:37 AM »
What have I done wrong here? I have 15 year olds running round with RPGs O.O

Code: [Select]
      "6"
      {
         "name"      "Member"
         "group"      "member"
         "armor"      ""
         "hp"      "100"
         "model"      "male16"
         "color"
         {
            "a"      "255"
            "B"      "255"
            "g"      "146"
            "r"      "86"
         }
         "weapons"
            {
            "1"   "weapon_physgun"
            "2"     "weapon_phycannon"
            "3"   "gmod_tool"
            "4"   "gmod_camera"
         }
      }

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Weapon restrictions - Possible or not?
« Reply #24 on: December 13, 2009, 10:23:48 AM »
Without knowing what errors your getting in console (always provide server console lua errors when reporting bugs), it's near impossible to tell why it's not working for you.

However, I do remember reading this looking over the posts of this topic. You do have model before weapons.

It seems that if in UTeam.txt you set the players model BEFORE you put it what weapons they get, uteam.lua gets some load error:

RUN ERROR
File: autorun/UTeam.lua
Path: autorun
autorun/UTeam.lua:21 table index is nil
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Weapon restrictions - Possible or not?
« Reply #25 on: December 13, 2009, 10:47:05 AM »
The problem with using player loadout restriction to restrict weapons on a build server is simply this...

Advanced Dupe > RPG... everyone has this saved on their machine.

If you are looking a more permanent solution Id dig a little deeper and go with a script that blocks the entity from even being spawned or existing on the server at all. Or there is the playerequip > player pickup hooks.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Weapon restrictions - Possible or not?
« Reply #26 on: December 13, 2009, 12:52:50 PM »
ULib/ULX SVN + URestrict
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Bounty_Bam

  • Newbie
  • *
  • Posts: 24
  • Karma: 0
Re: Weapon restrictions - Possible or not?
« Reply #27 on: December 13, 2009, 04:26:09 PM »
Without knowing what errors your getting in console (always provide server console lua errors when reporting bugs), it's near impossible to tell why it's not working for you.

However, I do remember reading this looking over the posts of this topic. You do have model before weapons.

I though having "model" there was ok, as Kyzer laid it out the same. There are no lua errors, the models work fine, the HP/Amour work fine..

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Weapon restrictions - Possible or not?
« Reply #28 on: December 13, 2009, 09:29:52 PM »
Yeah, you should be able to set it up in any order you want as it's creating a table with keys and values. Having model before weapons shouldn't effect anything.

Offline Bounty_Bam

  • Newbie
  • *
  • Posts: 24
  • Karma: 0
Re: Weapon restrictions - Possible or not?
« Reply #29 on: December 14, 2009, 05:17:53 AM »
Not to worry, I looked into URestrict, and jobs a good'un. And I really approve of the new GUI =]