Ulysses
General => Developers Corner => Topic started by: Dharmvir Sidhu 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
-
Hook -
http://wiki.garrysmod.com/page/WEAPON/PrimaryAttack (http://wiki.garrysmod.com/page/WEAPON/PrimaryAttack)
Functions
http://wiki.garrysmod.com/page/Player/SetTeam (http://wiki.garrysmod.com/page/Player/SetTeam)
and maybe
http://wiki.garrysmod.com/page/Weapon/GetPrintName (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.