• Expected <eof> near 'elseif'
    10 replies, posted
Code: elseif ply:GetCount( "props" ) >= 100 and ply:IsUserGroup("custom") then ply:ChatPrint("You've hit the Prop Limit") return false elseif ply:GetCount( "props" ) >= 50 and !ply:IsUserGroup("admin") then do if GetConVarNumber("sbox_maxprops") <= 140 then RunConsoleCommand("sbox_maxprops",140) end end hook.Add( "PlayerSpawnProp", "PropLimit", function(ply) if ply:GetCount( "props" ) >= GetConVarNumber("sbox_maxprops") and ply:IsUserGroup("superadmin") then RunConsoleCommand("sbox_maxprops", GetConVarNumber("sbox_maxprops") + 20)  return false elseif ply:GetCount( "props" ) >= 0 and ply:IsUserGroup("tmod") then ply:ChatPrint("You've hit the Prop Limit") return false elseif ply:GetCount( "props" ) >= 0 and ply:IsUserGroup("mod") then ply:ChatPrint("You've hit the Prop Limit") return false elseif ply:GetCount( "props" ) >= 0 and ply:IsUserGroup("seniormod") then ply:ChatPrint("You've hit the Prop Limit") return false elseif ply:GetCount( "props" ) >= 60 and ply:IsUserGroup("eliteadmin") then ply:ChatPrint("You've hit the Prop Limit") return false elseif ply:GetCount( "props" ) >= 60 and ply:IsUserGroup("headadmin") then ply:ChatPrint("You've hit the Prop Limit") return false elseif ply:GetCount( "props" ) >= 60 and ply:IsUserGroup("staffmanager") then ply:ChatPrint("You've hit the Prop Limit") return false elseif ply:GetCount( "props" ) >= 60 and ply:IsUserGroup("servermanager") then ply:ChatPrint("You've hit the Prop Limit") return false elseif ply:GetCount( "props" ) >= 60 and ply:IsUserGroup("coowner") then ply:ChatPrint("You've hit the Prop Limit") return false elseif ply:GetCount( "props" ) >= 60 and ply:IsUserGroup("owner") then ply:ChatPrint("You've hit the Prop Limit") return false elseif ply:GetCount( "props" ) >= 0 and !ply:IsUserGroup("user") then ply:ChatPrint("You've hit the Prop Limit") return false elseif ply:GetCount( "props" ) >= 0 and !ply:IsUserGroup("noaccess") then ply:ChatPrint("You've hit the Prop Limit") return false elseif ply:GetCount( "props" ) >= 0 and !ply:IsUserGroup("prime") then ply:ChatPrint("You've hit the Prop Limit") return false elseif ply:GetCount( "props" ) >= 0 and !ply:IsUserGroup("primeplus") then ply:ChatPrint("You've hit the Prop Limit") return false end end)
If that is the whole code then you clearly don't know what you are doing
Woah, what the hell is that?! Elseifs are embedded within if statements, for a start, but really, you need to read some introductory tutorials if you want to write code, as the foundations are extremely important and there are some prerequisites you need for most stuff.
He probably just copypasted a code from another addon and has clearly no idea how to code at all, expecting us to spoonfeed him code
This is just...uh...what the hell is that?
I got it from another facepunch post, on how to make prop limit for certain ranks.
https://www.youtube.com/watch?v=c1mQ3mpdiJU&list=PLyQg3m0a5UivaAXEfVDngKYp9jyNSTIo_ Learn lua instead of us spoonfeeding you it.
That video didn't help a bit.
Watch the entire series and learn Lua instead of begging us to code it for you. Don't be lazy.
Well, that sort of attitude isn't going to get you anywhere. Lua's one of the easiest languages to learn. if some_var == 15 then --execute commands here end The elseif you're trying to use isn't necessary, at least in that snippet, although the presumably competent writer of the original code must've used an if somewhere before it, so you should copy the code from the first if to the end. Just read this to get a handle on Lua and if statements. Honestly, I've not coded in it for years, but I'm fairly sure my syntax is correct. Still, you're better off reading this easy to digest document on how it works, starting with baby steps before trying to accomplish something more complicated: Lua If Statements
Thanks Dan The Man, Really helped.
Sorry, you need to Log In to post a reply to this thread.