DarkRP custom job only available when an admin is online
6 replies, posted
Hey, I was wondering how to setup a custom job for DarkRP that you can only become when an admin is online.
Thanks,
Kalayah
Just use a custom check to see if there are admins online and return false if there isn't.
on customcheck function create local variable = 0, loop through the players, use the statement check to check if any of them are admins, if they are, then increase the variable by 1. another statement, check if variable is higher than 0, then return true - else, return false
[CODE]
customCheck = function( ply )
for _,v in pairs(player.GetAll())
if v:IsAdmin() then
return true
end
end
return false
end
[/CODE]
[QUOTE=Milkshaker;52594459][CODE]
customCheck = function( ply )
for _,v in pairs(player.GetAll())
if v:IsAdmin() then
return true
end
end
return false
end
[/CODE][/QUOTE]
I wanted to reply the exact same but when I tested it it didn't seem to work.
[QUOTE=Milkshaker;52594459][CODE]
customCheck = function( ply )
for _,v in pairs(player.GetAll())
if v:IsAdmin() then
return true
end
end
return false
end
[/CODE][/QUOTE]
Yep thats perfect
[QUOTE=GalaxyBeatzz;52595299]I wanted to reply the exact same but when I tested it it didn't seem to work.[/QUOTE]
If you show us what you tried, we can probably fix it
Sorry, you need to Log In to post a reply to this thread.