General > Developers Corner

Restrict DarkRp job class to certain ulx ranks

<< < (2/3) > >>

bender180:
never mind the last message got the effect i wanted using:


--- Code: ---if t == TEAM_BUS then
        if !self:IsSuperAdmin() or self:IsUserGroup("vip") then
            GAMEMODE:Notify( self, 1, 4, "You must be a VIP to play as this job! Donate to become VIP!")
            return false
        end
    end
--- End code ---

Well the superadmin and up part is working but vip is receiving the "You must be a VIP to play as this job! Donate to become VIP!"

Heres what my code looks like https://dl.dropbox.com/u/2418443/Capture.JPG

Racer:
the ulx group NEEDS to be EXACTLY like the name you made when you made the group, and the TEAM_W/E Needs to be the exact name in the shared.lua.

Other than that, It looks fine

Edit: Wait, nvm, I re-read the code, I see the issue:

This:

--- Code: ---if !self:IsSuperAdmin() or self:IsUserGroup("vip") then
--- End code ---

needs to be this:

--- Code: ---if !self:IsSuperAdmin() or !self:IsUserGroup("vip") then
--- End code ---

you didn't add the ! before self:IsUsergroup("VIP")

That ! means if NOT self:IsSuperAdmin(), Its easier to type ! than if not. xD

Racer:
You are welcome BTW......

bender180:

--- Quote from: Racer on March 06, 2013, 12:50:45 AM ---You are welcome BTW......

--- End quote ---

Wow how did i forget to says thanks, sorry for the length of time that has passed but thaks for the help.

pazda:
hi, that's not working for me. Nobody can be the job :/

Edit: Never mind, fixed


--- Code: ---if t == TEAM_SWORD then
        if !self:IsAdmin() and !self:IsUserGroup("donator") then
            GAMEMODE:Notify( self, 1, 4, "You must be a donator to play as this job! Donate to get it!")
            return false
        end
    end
--- End code ---

After !self:IsAdmin(), it should be an and, not an or

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version