• Pointshop TTT Feature (Will pay)
    11 replies, posted
Okay so with the Pointshop you can spend points on different accessories, models, hats and stuff like that, but I would like it so you could buy Traitor with points. That'd be really awesome and I would definitely pay for it. Pointshop I use: [url]http://facepunch.com/showthread.php?t=1228438[/url]
I sent you message on your profile, I don't agree with buying traitor, but I'll take the job
why not just this? [url]http://facepunch.com/showthread.php?t=1228438[/url]
[QUOTE=ziev;39109387]why not just this? [url]http://facepunch.com/showthread.php?t=1228438[/url][/QUOTE] That is what I use, I need a feature for it which makes it so people could buy traitor using those points.
Do you have a ulx command for force traitor?
Sorry i couldn't make you pay for this as it is kind of simple and i feel like someone may make you pay more than you should. I am assuming you are using ulx so add this to garrysmod/addons/ulx/lua/ulx/modules/sh/fun.lua [PHP]function ulx.traitor( calling_ply, target_plys ) for i=1, #target_plys do target_plys[ i ]:SetRole(ROLE_TRAITOR) end ulx.fancyLogAdmin( calling_ply, "#A set #T as a traitor", target_plys) SendFullStateUpdate() end local traitor = ulx.command( CATEGORY_NAME, "ulx traitor", ulx.traitor, "!traitor" ) traitor:addParam{ type=ULib.cmds.PlayersArg } traitor:defaultAccess( ULib.ACCESS_ADMIN ) traitor:help( "<user(s)> - Turns target(s) into traitors." )[/PHP] Then add to garrysmod/lua/items/(whateverfolder)/(whatevername).lua [PHP] ITEM.Name = 'Traitor Buy In' ITEM.Price = ??? ITEM.Model = 'models/props_junk/garbage_glassbottle003a.mdl' ITEM.NoPreview = true ITEM.SingleUse = true function ITEM:OnBuy(ply) ply:SetRole(ROLE_TRAITOR) SendFullStateUpdate() end[/PHP] *EDIT* i did not realise this was a bumped post but it is here for anyone that wants it. :)
[lua] ITEM.Name = 'Buy Once: Traitor' ITEM.Price = 2000 ITEM.Material = 'VGUI/ttt/sprite_traitor.vmt' ITEM.OneUse = true function ITEM:OnEquip(ply, modifications) hook.Add("TTTBeginRound", ply:UniqueID() .. "_traitor", function() if ply:GetRoleString() != "traitor" then ply:SetRole(ROLE_TRAITOR) ply:AddCredits(GetConVarNumber("ttt_credits_starting")) end if SERVER then ply:PS_TakeItem(self.ID) end hook.Remove("TTTBeginRound", ply:UniqueID() .. "_traitor") end) end function ITEM:OnHolster(ply) hook.Remove("TTTBeginRound", ply:UniqueID() .. "_traitor") end function ITEM:OnSell(ply) hook.Remove("TTTBeginRound", ply:UniqueID() .. "_traitor") end [/lua] [lua] ITEM.Name = 'Buy Once: Detective' ITEM.Price = 2000 ITEM.Material = 'VGUI/ttt/sprite_traitor.vmt' ITEM.OneUse = true function ITEM:OnEquip(ply, modifications) hook.Add("TTTBeginRound", ply:UniqueID() .. "_detective", function() if ply:GetRoleString() != "detective" then ply:SetRole(ROLE_DETECTIVE) ply:AddCredits(GetConVarNumber("ttt_credits_starting")) end if SERVER then ply:PS_TakeItem(self.ID) end hook.Remove("TTTBeginRound", ply:UniqueID() .. "_detective") end) end function ITEM:OnHolster(ply) hook.Remove("TTTBeginRound", ply:UniqueID() .. "_detective") end function ITEM:OnSell(ply) hook.Remove("TTTBeginRound", ply:UniqueID() .. "_detective") end [/lua] These would work better for you.
[QUOTE=Phoenixf129;39477264][lua] ITEM.Name = 'Buy Once: Traitor' ITEM.Price = 2000 ITEM.Material = 'VGUI/ttt/sprite_traitor.vmt' ITEM.OneUse = true function ITEM:OnEquip(ply, modifications) hook.Add("TTTBeginRound", ply:UniqueID() .. "_traitor", function() if ply:GetRoleString() != "traitor" then ply:SetRole(ROLE_TRAITOR) ply:AddCredits(GetConVarNumber("ttt_credits_starting")) end if SERVER then ply:PS_TakeItem(self.ID) end hook.Remove("TTTBeginRound", ply:UniqueID() .. "_traitor") end) end function ITEM:OnHolster(ply) hook.Remove("TTTBeginRound", ply:UniqueID() .. "_traitor") end function ITEM:OnSell(ply) hook.Remove("TTTBeginRound", ply:UniqueID() .. "_traitor") end [/lua] [lua] ITEM.Name = 'Buy Once: Detective' ITEM.Price = 2000 ITEM.Material = 'VGUI/ttt/sprite_traitor.vmt' ITEM.OneUse = true function ITEM:OnEquip(ply, modifications) hook.Add("TTTBeginRound", ply:UniqueID() .. "_detective", function() if ply:GetRoleString() != "detective" then ply:SetRole(ROLE_DETECTIVE) ply:AddCredits(GetConVarNumber("ttt_credits_starting")) end if SERVER then ply:PS_TakeItem(self.ID) end hook.Remove("TTTBeginRound", ply:UniqueID() .. "_detective") end) end function ITEM:OnHolster(ply) hook.Remove("TTTBeginRound", ply:UniqueID() .. "_detective") end function ITEM:OnSell(ply) hook.Remove("TTTBeginRound", ply:UniqueID() .. "_detective") end [/lua] These would work better for you.[/QUOTE] These are not working I add them to the pointshop but nothing shows up.
If you change [code]ITEM.OneUse = true function ITEM:OnEquip(ply, modifications)[/code] to this: [code] ITEM.SingleUse = true function ITEM:OnBuy(ply, modifications)[/code] Then it will set the buyer to traitor whenever they purchase the item and then automatically remove itself from their inventory. This way people won't have to equip it.
[QUOTE=Dviation;39509086]If you change [code]ITEM.OneUse = true function ITEM:OnEquip(ply, modifications)[/code] to this: [code] ITEM.SingleUse = true function ITEM:OnBuy(ply, modifications)[/code] it still dosnt show up
Funnygame this dose work because I helped create the detective script for my friend which he then uploaded them to the zombiemaster site. I currently have them installed on my server and they are working fine if you have any problems feel free to add me [url=http://steamcommunity.com/id/deathrowdave/]HERE[/url] and I'll help you. Regards, Dave
i tryed it with this pointshop and it dosnt show up some how [url]http://www.facepunch.com/showthread.php?t=1228438&page=26[/url] do i have to add something to a differnt file because i just added it into the addons pointshop file were all the other items are
Sorry, you need to Log In to post a reply to this thread.