General > Developers Corner

Traitor infector weapon

(1/1)

Dharmvir Sidhu:
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

JamminR:
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.


Navigation

[0] Message Index

Go to full version