I've tested some of them for my server and all of the seems to be bugged, the first one I tried, if you bought detective when you're going to be a traitor, you could see all the traitors. The second one didn't give credits etc. Does anyone have a working code? Thank you.
Try this:
[code]ITEM.Name = 'Traitor'
ITEM.Price = 3000
ITEM.Material = 'vgui/ttt/sprite_traitor.vmt'
ITEM.SingleUse = true
function ITEM:OnEquip( ply, modifications )
if ply:GetRoleString() ~= "traitor" then
if ( GetRoundState() ~= ROUND_ACTIVE ) then
ply:ChatPrint( "It is not an active round" )
return false
else
ply:SetRole( ROLE_TRAITOR )
ply:AddCredits( GetConVarNumber( "ttt_credits_starting" ) )
end
end
--ply:PS_TakeItem( self.ID )
end[/code]
Got a good one for detective too, that was the most broken one for us.
deDEreat with coding but wouldnt this work?
ITEM.Name = 'Detective'
ITEM.Price = 3000
ITEM.Material = 'VGUI/ttt/sprite_ detective.vmt'
ITEM.SingleUse = true
function ITEM:OnEquip( ply, modifications )
if ply:GetRoleString() ~= "detective" then
if ( GetRoundState() ~= ROUND_ACTIVE ) then
ply:ChatPrint( "It is not an active round" )
return false
else
ply:SetRole( ROLE_Detective )
ply:AddCredits( GetConVarNumber( "ttt_credits_starting" ) )
end
end
--ply:PS_TakeItem( self.ID )
end
[editline]7th April 2014[/editline]
Lol first word was im not but autocorrect mucked it up
[editline]7th April 2014[/editline]
Also in VGUI/ttt/sprite_detective.vmt remove the extra space in front of detective
Lowercase VGUI; that's been changed with the update.
sprite_detective, where can I find that? Testing the codes now. Thank you guys.
Tested them now, they do not work. [url]http://imgur.com/9OL6Gml[/url] Is the message I get when I buy them.
[QUOTE=Sjokomelk;44480902]sprite_detective, where can I find that? Testing the codes now. Thank you guys.
Tested them now, they do not work. [url]http://imgur.com/9OL6Gml[/url] Is the message I get when I buy them.[/QUOTE]
ply:SetRole( ROLE_Detective )
should be
ply:SetRole( ROLE_DETECTIVE )
[QUOTE=AnonTakesOver;44481340]ply:SetRole( ROLE_Detective )
should be
ply:SetRole( ROLE_DETECTIVE )[/QUOTE]
It didn't work for the traitor code either so something must be wrong.
I have a ulx forcenr command at my server is it possible to use that? I can type ulx forcenr "name" "role" in console, but I wonder if pointshop can do the same.
[QUOTE=Sjokomelk;44500263]I have a ulx forcenr command at my server is it possible to use that? I can type ulx forcenr "name" "role" in console, but I wonder if pointshop can do the same.[/QUOTE]
You could run a ULX command through pointshop, but it's pointless when SetRole already exists
Sorry, you need to Log In to post a reply to this thread.