Author Topic: New weapon changing group  (Read 1379 times)

0 Members and 1 Guest are viewing this topic.

Offline machond

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
New weapon changing group
« on: December 11, 2016, 09:25:06 AM »
Hi,
i want write a custom weapon, buy i dont know how do a part of code about adding ply to group when use a weapon.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: New weapon changing group
« Reply #1 on: December 11, 2016, 10:08:51 AM »
SWEP:PrimaryAttack
Inside your swep primary (and/or SWEP:SecondaryAttack), do your group change.
If making it compatible without requiring ULib, you can use Player:SetUserGroup, and if you have ULib installed, it will see the player group changed and adjust accordingly.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming