So i asked about this not too long ago, and someone recommended URS. This worked great, but it didn't get everything that i wanted. I need a way to change the limit for things such as wheel, thrusters, and different wiremod limits for the different ULX ranks too. So i have tried this command to put in lua/autorun and it doesn't seem to work:
do
[CODE] if GetConVarNumber("sbox_maxthrusters") <= 5 then
RunConsoleCommand("sbox_maxthrusters",5)
end
end
hook.Add( "PlayerSpawnThruster", "ThrusterLimit", function(ply)
if ply:GetCount( "thrusters" ) >= GetConVarNumber("sbox_maxthrusters") and ply:IsUserGroup("Owner") then
RunConsoleCommand("sbox_maxthrusters", GetConVarNumber("sbox_maxthrusters") + 200)
ply:ChatPrint("You've hit the Thruster Limit, But we can add more props!")
return false
elseif ply:GetCount( "thrusters" ) >= 5 and ply:IsUserGroup("Owner") then
ply:ChatPrint("You've hit the Thruser Limit")
return false
elseif ply:GetCount( "thrusters" ) >= 3 and ply:IsUserGroup("admin") then
ply:ChatPrint("You've hit the Thruser Limit")
return false
elseif ply:GetCount( "thrusters" ) >= 1 and ply:IsUserGroup("VIP") then
ply:ChatPrint("You've hit the Thruster Limit")
return false
elseif ply:GetCount( "thrusers" ) >= 0 and !ply:IsUserGroup("admin") then
ply:ChatPrint("You've hit the Thruser Limit")
return false
end
end)[/CODE]
what DOES work is if it's above 5, then it will change it down to 5... But that is 1 universal number... I tried editing URS to work with Thrusters/Wheels/Balloons ETC, however I now feel as though those things are not the same process as props... How can i set a limit so i can build epic things, but new players cant spam???
Put the file in lua/autorun/server
Sorry for the bump, but i have put this aside and worked on other things, and i have come back to this a started playing around with it. So it does work with props and the prop limit, but i jsut feel like i dont have the letters right for thrusters. here are all the different possibilitys
-thruster
-thrusters
-Thruster
-Thrusters
and instead of testing each one, which could take forever, i was wondering if someone knew how i would letter the tools and such to work too. I wanted to get balloons, thruster, hoverballs, etc.
Can anyone help?
You should be localizing the counts and usergroups at the beginning instead of doing different calls in each statement. You can use the CanTool hook for tools.
I dont want to completely remove access from that tool, but instead, provide different limits for how many items can be placed with taht tool with the different groups.
Then record a variable on the player and increase it with each tool use. Then proceed to check if they've hit the limit for that group.
Sorry, you need to Log In to post a reply to this thread.