Hey guys, I have a really dumb question but would just like to know how to do it :l
if any of you can help i'd be really more than happy.
Basically I want to add 2 steam ids to the same job; this is the job
[code]
TEAM_Test = DarkRP.createJob("test", {
color = Color(250, 0, 160, 100),
model = "models/player/assassin.mdl",
description = [[test]],
weapons = {"weapon_fists", "m9k_mp9", "m9k_mossberg590", "lockpick"},
command = "test",
max = 2
salary = 1000,
admin = 0,
vote = false,
hasLicense = true,
customCheck = function(ply) return ply:SteamID() == "STEAM_0:1:69420test" end,
CustomCheckFailMsg = "You need be cool to become this job."
})
[/code]
You see at the end in the CustomCheck line I want to make it for more than a steam id, how can I do so?
Once again, I know this is a dumb question but I tried searching on the web but with no results.
Help will really be appreciated!
[code]
customCheck = function(ply) return ply:SteamID() == "STEAM_0:1:69420test" or ply:SteamID() == "idhere" end,
CustomCheckFailMsg = "You need be cool to become this job."
[/code]
Come on bra
thanks a bunch log404, I wanted to try something like this but I really wasn't sure xD
Thanks again man
Edit: basically what I wanted to do is make 2 players able to become this job (even in the same time) in the darkrp server, will this suffice?
[QUOTE=Divize;45196927]thanks a bunch log404, I wanted to try something like this but I really wasn't sure xD
Thanks again man[/QUOTE]
Np bro
[QUOTE=log404;45196930]Np bro[/QUOTE]
Edit: basically what I wanted to do is make 2 players able to become this job (even in the same time) in the darkrp server, will this suffice?
Because I saw you wrote "or", which would mean that it will only work for 1 of those 2 steam ids?
or am I retarded and dumb? c:
[QUOTE=Divize;45196941]Edit: basically what I wanted to do is make 2 players able to become this job (even in the same time) in the darkrp server, will this suffice?
Because I saw you wrote "or", which would mean that it will only work for 1 of those 2 steam ids?
or am I retarded and dumb? c:[/QUOTE]
the or is just adding like if you this or if then allow it
A much simpler way of doing things:
[lua]
local steamIDFilter = {
["steamIDHere1"] = true,
["steamIDHere2"] = true,
}
TEAM_TEST = DarkRP.createJob("Test Job", {
color = Color(250, 0, 160, 100),
model = "models/player/assassin.mdl",
description = [[test]],
weapons = {"weapon_fists", "m9k_mp9", "m9k_mossberg590", "lockpick"},
command = "test",
max = table.Count(steamIDFilter),
salary = 1000,
admin = 0,
vote = false,
hasLicense = true,
customCheck = function(ply) return steamIDFilter[ply:SteamID()] end,
CustomCheckFailMsg = "You need be cool to become this job."
})
[/lua]
[QUOTE=brandonj4;45197032]A much simpler way of doing things:
[lua]
local steamIDFilter = {
["steamIDHere1"] = true,
["steamIDHere2"] = true,
}
TEAM_TEST = DarkRP.createJob("Test Job", {
color = Color(250, 0, 160, 100),
model = "models/player/assassin.mdl",
description = [[test]],
weapons = {"weapon_fists", "m9k_mp9", "m9k_mossberg590", "lockpick"},
command = "test",
max = table.Count(steamIDFilter),
salary = 1000,
admin = 0,
vote = false,
hasLicense = true,
customCheck = function(ply) return steamIDFilter[ply:SteamID()] end,
CustomCheckFailMsg = "You need be cool to become this job."
})
[/lua][/QUOTE]
Its the same thing ...
[QUOTE=log404;45197067]Its the same thing ...[/QUOTE]
your one is fucking retarded and messy so no it's not
[QUOTE=log404;45197067]Its the same thing ...[/QUOTE]
Have fun writing 99 lines of:
[lua]
ply:SteamID() == "this" or ply:SteamID() == "thisStuff" or ply:SteamID() == "annoying"
[/lua]
[QUOTE=brandonj4;45197096]Have fun writing 99 lines of:
[lua]
ply:SteamID() == "this" or ply:SteamID() == "thisStuff" or ply:SteamID() == "annoying"
[/lua][/QUOTE]
he said he wanted to add 2 steam ids stop being a nuisance about it about it
[QUOTE=log404;45197108]he said he wanted to add 2 steam ids stop being a nuisance about it about it[/QUOTE]
I wouldn't exactly classify providing easily superior code as being "a nuisance about it".
Remember: Planning for scalability and not needing it is better than planning on having 1 or 2 uses, and needing 400.
[QUOTE=log404;45197108]he said he wanted to add 2 steam ids stop being a nuisance about it about it[/QUOTE]
Don't be an ass, all I'm doing is giving an easier way of doing things if he wants to add another SteamID later on.
Sorry, you need to Log In to post a reply to this thread.