General > Developers Corner
Restrict DarkRp job class to certain ulx ranks
bender180:
Basically what i want to do is make it so you have to be in a certain group to become a job in darkrp.
I've tried using the method falco posted on the google code page for the project Ive tried editing the player.lua for darkrp nothing is working.
Is there anyone who knows how i can do this?
JamminR:
http://forums.ulyssesmod.net/index.php/topic,5532.msg25265.html#msg25265
bender180:
--- Quote from: JamminR on January 25, 2013, 11:30:42 PM ---http://forums.ulyssesmod.net/index.php/topic,5532.msg25265.html#msg25265
--- End quote ---
Ive tried that method it doesnt seem to work.
Racer:
I can't believe I am able to help on here but go to: "gamemodes\darkrp\gamemode\server" and edit the file, "player.lua"
Hit ctrl + F and Search for "meta:ChangeTeam"
Once there, Do something like this:
--- Code: ---if t == TEAM_ADMIN then
if self:IsUserGroup("testgrouphere") then
GAMEMODE:Notify( self, 1, 4, "You are not the proper group for this job!")
return false
end
end
--- End code ---
Or if you want it to be admin AND a certain group:
--- Code: ---if t == TEAM_ADMIN then
if !self:IsAdmin() or !self:IsUserGroup("testgrouphere") then
GAMEMODE:Notify( self, 1, 4, "You are not the proper group for this job!")
return false
end
end
--- End code ---
So final code should look like this:
--- Code: ---function meta:ChangeTeam(t, force)
if t == TEAM_ADMIN then
if !self:IsAdmin() or self:IsUserGroup("sergant") then
umsg.Start("Problem", self)
umsg.End()
return false
end
end
--- End code ---
(SS: http://puu.sh/1SYQa ) *My setup is more advanced, It responds back with a colorful Error =D*
bender180:
if i did this:
--- Code: ---if t == TEAM_BUS then
if !self:IsUserGroup("vip") or self:CheckGroup("superadmin") then
GAMEMODE:Notify( self, 1, 4, "You must be a VIP to play as this job! Donate to become VIP!")
umsg.Start("Problem", self)
umsg.End()
return false
end
end
--- End code ---
Would it still work? I want it to be a vip only job but then i want it so all the groups superadmin and up get it.
Navigation
[0] Message Index
[#] Next page
Go to full version