Hi, I was wondering if someone can code something or show me what to do to edit the propspec.lua so the punch-o-meter in ttt can be infinite to specified groups?
I've seen it on some servers as a VIP or being part of the staff benefit.
Can anyone help me with this?
Replace the last function with:
[code]
function PROPSPEC.Recharge(ply)
local pr = ply.propspec
if pr.retime < CurTime() then
pr.punches = math.min(pr.punches + 1, pr.max)
ply:SetNWFloat("specpunches", pr.punches / pr.max)
if ply:IsUserGroup("donator") then
pr.retime = CurTime()
else
pr.retime = CurTime() + propspec_retime:GetFloat()
end
end
end
[/code]
Something like this should be fine:
[lua]
local exempt = {
"donator",
"vip",
"admin"
}
local propspec_retime = CreateConVar("ttt_spec_prop_rechargetime", "1")
function PROPSPEC.Recharge(ply)
local pr = ply.propspec
if pr.retime < CurTime() then
pr.punches = math.min(pr.punches + 1, pr.max)
ply:SetNWFloat("specpunches", pr.punches / pr.max)
pr.retime = CurTime() + propspec_retime:GetFloat()
end
if table.HasValue( exempt, ply:GetNWString( "usergroup" ) ) then pr.retime = CurTime() end
end
[/lua]
Replace the final function in propspec.lua with this, add any group names you want to the table, like I've done (don't forget your commas).
Bear in mind this might be a tad irritating to players.
The second script will probably be better for you if you intend to add multiple user groups.
[QUOTE=WitheredPyre;44552569]The second script will probably be better for you if you intend to add multiple user groups.[/QUOTE]
All he has to do is
or ply:IsUserGroup("usergroup")
:P
[QUOTE=Sm63;44552713]All he has to do is
or ply:IsUserGroup("usergroup")
:P[/QUOTE]
if you want to get technical all you have to do is
pr.retime = CurTime() + (ply:IsUserGroup("donator") and 0 or propspec_retime:GetFloat())
Thank you guys! <3
Sorry, you need to Log In to post a reply to this thread.