• Multi usergroup DarkRP command
    7 replies, posted
[CODE] local function ccSENTSPawn(ply, cmd, args) if GetConVarNumber("adminsents") == 1 then if (!ply:IsUserGroup("owner")) then Notify(ply, 1, 2, string.format(LANGUAGE.need_admin, "gm_spawnsent")) return end end CCSpawnSENT(ply, cmd, args) DB.Log(ply:SteamName().." ("..ply:SteamID()..") spawned SENT "..args[1] ) end concommand.Add("gm_spawnsent", ccSENTSPawn) [/CODE] When I add if (!ply:IsUserGroup("co-owner")) then Under if (!ply:IsUserGroup("owner")) then it allows anoyone to spawn them help? Note: darkrp
[CODE] local function ccSENTSPawn(ply, cmd, args) if GetConVarNumber("adminsents") == 1 then if (!ply:IsUserGroup("owner") or !ply:IsUserGroup("co-owner") then -- Just a simple or statement Notify(ply, 1, 2, string.format(LANGUAGE.need_admin, "gm_spawnsent")) return end end CCSpawnSENT(ply, cmd, args) DB.Log(ply:SteamName().." ("..ply:SteamID()..") spawned SENT "..args[1] ) end concommand.Add("gm_spawnsent", ccSENTSPawn) [/CODE]
Thank you very much XD [editline]5th March 2012[/editline] people can still spawn weapons if they arent on that usergroup
[lua] local function ccSENTSPawn(ply, cmd, args) if GetConVarNumber("adminsents") == 1 then if (!ply:IsUserGroup("owner") or !ply:IsUserGroup("co-owner")) then -- Just a simple or statement -- Missed out a bracket - Doh Notify(ply, 1, 2, string.format(LANGUAGE.need_admin, "gm_spawnsent")) return end end CCSpawnSENT(ply, cmd, args) DB.Log(ply:SteamName().." ("..ply:SteamID()..") spawned SENT "..args[1] ) end concommand.Add("gm_spawnsent", ccSENTSPawn) [/lua]
Ok thank you now can i just implement if (!ply:IsUserGroup("owner") or !ply:IsUserGroup("co-owner")) then into any command i want? [editline]5th March 2012[/editline] Still didnt work :( [editline]5th March 2012[/editline] If it means anythign im using ULX
How are you using it? Show the code.
I used it like this :S [QUOTE]local function ccSENTSPawn(ply, cmd, args) if GetConVarNumber("adminsents") == 1 then if (!ply:IsUserGroup("owner") or !ply:IsUserGroup("co-owner")) then -- Just a simple or statement-- Missed out a bracket - Doh Notify(ply, 1, 2, string.format(LANGUAGE.need_admin, "gm_spawnsent")) return end end CCSpawnSENT(ply, cmd, args) DB.Log(ply:SteamName().." ("..ply:SteamID()..") spawned SENT "..args[1] ) end concommand.Add("gm_spawnsent", ccSENTSPawn)[/QUOTE]
Place that in [lua] tags.
Sorry, you need to Log In to post a reply to this thread.