Author Topic: Traitor infector weapon  (Read 1405 times)

0 Members and 1 Guest are viewing this topic.

Offline Dharmvir Sidhu

  • Newbie
  • *
  • Posts: 18
  • Karma: 1
    • OMENS Gaming
Traitor infector weapon
« on: January 28, 2015, 05:52:32 PM »
So i've seen some weapons on some servers that you can buy from the t-shop and when you shoot them, they become a traitor as well. (I guess sort of like the zombie infector, but the person becomes a traitor instead of a zombie) However, I can't find an item like this anywhere, can someone show me where it is, or direct me as to how I could create it?

Thanks,
Dharmvir

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Traitor infector weapon
« Reply #1 on: January 28, 2015, 08:24:17 PM »
Hook -
http://wiki.garrysmod.com/page/WEAPON/PrimaryAttack

Functions
http://wiki.garrysmod.com/page/Player/SetTeam
and maybe
http://wiki.garrysmod.com/page/Weapon/GetPrintName

(Sorry if you were wanting code examples, but, I'm tired lately)
Basically, on primary attack hook, if (weapon) = <your choice> then SetTeam(whatever traitor team name is)
And, by the way, though I don't play much Gmod and even less of it's gamemodes lately, whoever thought of the idea originally was pretty creative, I like the idea.


"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming