Not sure if this would be doing too much, but how about a medic console as well, where a player can type /medic and the medic can go to his console and find the location of the injured player similar to /911.
Also, could we have /911 work so it doesn't require you to be injured? Often people want to use it when they're been broken in to and can't because they haven't been hurt yet.
Hey, Falco, main.lua near line 1145 in the BuyAmmo function, shouldn't there be a return in:
[lua] if args ~= "rifle" and args ~= "shotgun" and args ~= "pistol" then
Notify(ply, 1, 4, string.format(LANGUAGE.unavailable, "ammo"))
end[/lua]
Right now, if you type an argument of, let's say rilfe, you'll get the messages:
"This ammo is unavailable"
"You have bought a rilfe for $0".
[editline]12:24AM[/editline]
Also, one more thing, you might want to consider trimming spaces when you are capturing the length of strings for RPNames and custom jobs. For example, trying something like
[lua] local len = string.len(args:gsub("^%s*", ""))[/lua]
Hey, Falco, if you don't mind one more annoyance, I have also found a minor bug in FPP (redundant messages). When you turn on the Whitelist, and you attempt to spawn a large prop not on the white list, you get 2 messages, "Your prop is ghosted because it is too big. Interract with it to unghost it.", and "The model of this entity is not in the white list!"
-Broke my automerge-
hey everbody today i wanted to use darkrp in my server with custom jobs and all tested in create multiplayer latest svn everthing works but the moment i put it in my server it keeps giving this error
[code]
ERROR: GAMEMODE:'EntityRemoved' Failed: gamemodes/DarkRP/gamemode/sv_gamemode_functions.lua:83: bad argument #1 to 'pairs' (table expected, got nil)
[/code]
not once but all the time. And when i look at the line in notepad its just fine. i'm using exsto as a admin system mayby thats it?
Something I've been working on:
[media]http://www.youtube.com/watch?v=EcH7RNGTKks[/media]
That's pretty nice Drakehawke. You might want to save the door information too (you probably already thought of that).
I can't decide whether or not to have something similar in SeriousRP because sometimes you do need to lose the positions of props.
How are you setting the owner if someone doesn't reconnect after the server crash? do those props just not respawn?
[QUOTE=ph:lxyz;23599387]That's pretty nice Drakehawke. You might want to save the door information too (you probably already thought of that).
I can't decide whether or not to have something similar in SeriousRP because sometimes you do need to lose the positions of props.
How are you setting the owner if someone doesn't reconnect after the server crash? do those props just not respawn?[/QUOTE]
I haven't done it for props, I wasn't really up to figuring out how to get information about constraints and stuff, when there's something that can do pretty much the same thing, Adv Dupe. Also, I've noticed that Adv Dupe lags the server slightly when someone saves a very large contraption/building, so I don't think this would be very efficient writing information on every prop and constraint to a file every 30 seconds.
How it works is every 30 seconds it gets information about the entities I specify, puts it in a table, encodes it with GLON then writes it into a .txt on the server, then after the 300 second timer is up it cycles through the table of previous entities, and if the entities class is one of the entities that has an owner, it starts another loop through player.GetAll(), if the SteamID that was recorded in the previous table as the owner of that entity, matches one in player.GetAll() it creates the entity and sets the owner to that player.
I'd post the code but it's not really finished yet, I've only tried it with one player (me) on a listen server, gonna put it on my dedicated one later and see if it all works.
[editline]11:16PM[/editline]
Door information would be a good idea, but what if someone rejoins before the player who owns the door, and buys it?
I guess I'd have to set all the previously owned doors as unownable, then set them as owned when the 300 seconds is up, if the players rejoined.
And then there's doors with mutliple owners.
It would be possible, but it'd probably need quite a bit of work and I'm working on a lot of other stuff at the moment, maybe in the future I'll consider it.
I was thinking maybe blank everyone's screens on restore until the props are back in-place (or disable movement and put a message on-screen about "recovering game")
[QUOTE=ph:lxyz;23601101]I was thinking maybe blank everyone's screens on restore until the props are back in-place (or disable movement and put a message on-screen about "recovering game")[/QUOTE]
Doesn't solve the problem of getting/writing all the prop/constraint info to a file every 30 seconds.
Just put it on my dedicated server, it works, for some reason the timer on the HUD won't show though, but the main part of it works.
Hit a glitch involving entity limits, if you get your past two money printers restored it doesn't recognise them in the limits if you want to buy more.
Got an idea of getting around it, shall fix it in the morning.
snip
I running DarkRP server on linux. Where can I find all account saves or how can I make server to save everything to Data folder ?
[QUOTE=Drakehawke;23596300]Something I've been working on:
[media]http://www.youtube.com/watch?v=EcH7RNGTKks[/media][/QUOTE]
Any possibility your going to release this?
[QUOTE=Erne456;23616839]I running DarkRP server on linux. Where can I find all account saves or how can I make server to save everything to Data folder ?[/QUOTE]
I think it's the same on linux, the file sv.db in your garrysmod/garrysmod directory.
[editline]06:11PM[/editline]
[QUOTE=mishappp;23617022]Any possibility your going to release this?[/QUOTE]
When it's properly finished.
Thanx, I found. Good mod.
util.lua lines 27-31:
[lua]
for k, v in pairs(ents) do
if v:IsPlayer() then
filter:AddPlayer(v)
end
end
[/lua]
Why not use:
[lua]
for k, v in pairs(player.GetAll()) do
filter:AddPlayer(v)
end
[/lua]
- Nevermind I won't insult you with my questions when I could just learn to do it myself.-
Thanks again Falco on the lua website. It just helped me figure out my problem.
[url=http://code.google.com/p/darkrp/source/browse/trunk/gamemode/showteamtabs.lua#650]showteamtabs.lua:650[/url]
[lua] for k,v in pairs(DarkRPEntities) do
if not v.allowed or (type(v.allowed) == "table" and table.HasValue(v.allowed, LocalPlayer():Team())) then
local cmdname = string.gsub(v.ent, " ", "_")
if tobool(GetConVarNumber("disable"..cmdname)) then return end
local price = GetConVarNumber(cmdname.."_price")
if price == 0 then
price = v.price
end
AddEntIcon(v.model, "Buy a " .. v.name .." " .. CUR .. price, v.cmd)
end
end[/lua]
Shouldn't you be breaking, not returning? Returning will end the function that builds the entire Entities tab.
Also, in practice, it does break the Entities tab when you have something disabled.
Someone once suggested having local voice chat that doesn't penetrate walls or buildings, I have a theory as to how you could do this, when a player speaks, run a trace from the player speaking to all the people in his voice radius, if the trace hits the world then that player hears the persons voice very quietly, or not at all. Would it work?
[QUOTE=Drakehawke;23635896]Someone once suggested having local voice chat that doesn't penetrate walls or buildings, I have a theory as to how you could do this, when a player speaks, run a trace from the player speaking to all the people in his voice radius, if the trace hits the world then that player hears the persons voice very quietly, or not at all. Would it work?[/QUOTE]
If this worked, then in theory, wouldnt it lag the hell out of a server if there are many people using voicechat?
Not really, traces are very efficient
Done it:
cl_init.lua:824
[lua]
local PlayerColorsOn = CreateClientConVar("rp_showchatcolors", 1, true, false)
local function RPSelectwhohearit()
if PlayerColorsOn:GetInt() == 0 then return end
Messagemode = true
hook.Add("HUDPaint", "RPinstructionsOnSayColors", function()
local w, l = chat.GetChatBoxPos()
local h = l - (#playercolors * 20) - 20
local AllTalk = GetConVarNumber("alltalk") == 1
if #playercolors <= 0 and ((HearMode ~= "talk through OOC" and HearMode ~= "advert" and not AllTalk) or (AllTalk and HearMode ~= "talk" and HearMode ~= "me") or HearMode == "speak" ) then
draw.WordBox(2, w, h, string.format(LANGUAGE.hear_noone, HearMode), "ScoreboardText", Color(0,0,0,120), Color(255,0,0,255))
elseif HearMode == "talk through OOC" or HearMode == "advert" then
draw.WordBox(2, w, h, LANGUAGE.hear_everyone, "ScoreboardText", Color(0,0,0,120), Color(0,255,0,255))
elseif not AllTalk or (AllTalk and HearMode ~= "talk" and HearMode ~= "me") then
draw.WordBox(2, w, h, string.format(LANGUAGE.hear_certain_persons, HearMode), "ScoreboardText", Color(0,0,0,120), Color(0,255,0,255))
end
for k,v in pairs(playercolors) do
if v.Nick then
draw.WordBox(2, w, h + k*20, v:Nick(), "ScoreboardText", Color(0,0,0,120), Color(255,255,255,255))
end
end
end)
hook.Add("Think", "RPGetRecipients", function()
if not Messagemode then RPStopMessageMode() hook.Remove("Think", "RPGetRecipients") return end
if HearMode ~= "whisper" and HearMode ~= "yell" and HearMode ~= "talk" and HearMode ~= "speak" and HearMode ~= "me" then return end
playercolors = {}
for k,v in pairs(player.GetAll()) do
if v ~= LocalPlayer() then
local distance = LocalPlayer():GetPos():Distance(v:GetPos())
if HearMode == "whisper" and distance < 90 and not table.HasValue(playercolors, v) then
table.insert(playercolors, v)
elseif HearMode == "yell" and distance < 550 and not table.HasValue(playercolors, v) then
table.insert(playercolors, v)
elseif HearMode == "speak" and distance < 550 and CL_IsInRoom( v ) and not table.HasValue(playercolors, v) then
table.insert(playercolors,v)
elseif HearMode == "talk" and GetConVarNumber("alltalk") ~= 1 and distance < 250 and not table.HasValue(playercolors, v) then
table.insert(playercolors, v)
elseif HearMode == "me" and GetConVarNumber("alltalk") ~= 1 and distance < 250 and not table.HasValue(playercolors, v) then
table.insert(playercolors, v)
end
end
end
end)
end
[/lua]
And at the bottom:
[lua]
function CL_IsInRoom( listener )
local tracedata = {}
tracedata.start = LocalPlayer():GetShootPos()
tracedata.endpos = listener:GetShootPos()
local trace = util.TraceLine( tracedata )
if trace.HitWorld then
return false
else
return true
end
end
[/lua]
sv_gamemode_functions.lua:151
[lua]
function GM:PlayerCanHearPlayersVoice(listener, talker, other)
if listener.DarkRPVars and talker.DarkRPVars and ValidEntity(listener.DarkRPVars.phone) and ValidEntity(talker.DarkRPVars.phone) and listener == talker.DarkRPVars.phone.Caller then
return true, tobool(GetConVarNumber("3dvoice"))
elseif talker.DarkRPVars and ValidEntity(talker.DarkRPVars.phone) then
return false, tobool(GetConVarNumber("3dvoice"))
end
if GetConVarNumber("voiceradius") == 1 and listener:GetShootPos():Distance(talker:GetShootPos()) < 550 and IsInRoom( listener, talker ) then
return true, tobool(GetConVarNumber("3dvoice"))
elseif GetConVarNumber("voiceradius") == 1 then
return false, tobool(GetConVarNumber("3dvoice"))
end
return true, tobool(GetConVarNumber("3dvoice"))
end
[/lua]
And at the bottom:
[lua]
function IsInRoom( listener, talker )
local tracedata = {}
tracedata.start = talker:GetShootPos()
tracedata.endpos = listener:GetShootPos()
local trace = util.TraceLine( tracedata )
if trace.HitWorld then
return false
else
return true
end
end
[/lua]
=D
How to do that picked up props to be ghost ?
[QUOTE=Erne456;23643092]How to do that picked up props to be ghost ?[/QUOTE]
This function was removed due to instability issues with the engine (I think).
Ever since the last revision, Whenever someone tries to use Weld or a couple other tools, it says that the tool is restricted and that I'm on the wrong team. I never restricted weld. I did restrict PCMod tools to my PC Tech job. I triple-checked all the FPP tool restriction list, and Weld isn't there. Anyone else having this problem or have a fix?
how do i make it so i can let "gold members" be a certain job?
there's 0, 1, and 2 for users, admin and superadmin but i want to make a gold member number, how would i do that?
[QUOTE=doctorjohndorian;23664078]Ever since the last revision, Whenever someone tries to use Weld or a couple other tools, it says that the tool is restricted and that I'm on the wrong team. I never restricted weld. I did restrict PCMod tools to my PC Tech job. I triple-checked all the FPP tool restriction list, and Weld isn't there. Anyone else having this problem or have a fix?[/QUOTE]
What does it say exactly when you try to use it?
I've got a quick question, is it possible to change the spawn area for particular classes, such as making the mayor spawn in his mayoral office?
[QUOTE=Drakehawke;23681191]What does it say exactly when you try to use it?[/QUOTE]
"Toolgun restricted! incorrect team!"
[QUOTE=Abderian;23681780]I've got a quick question, is it possible to change the spawn area for particular classes, such as making the mayor spawn in his mayoral office?[/QUOTE]
Yes, /setspawn then the command you use to become the team, e.g. /setspawn mayor or /setspawn cp.
You then can use /addspawn to make more than 1 spawn for each class.
It will set the spawn as where your player is at the moment.
[editline]04:42PM[/editline]
[QUOTE=doctorjohndorian;23683669]"Toolgun restricted! incorrect team!"[/QUOTE]
It means you've ticked one of the jobs on the tool restriction page, so the tools restricted to that job only.
Ok I found some usefull scripts that people have asked for through this thread and many other places. Hopefully this can be useful for some of you.
[release][b]How to make commands superadmin and not admin[/b]
[b]Step 1:[/b]
In [b]admincc.lua[/b] around line 31, it says
[lua]if ply:EntIndex() ~= 0 and not ply:HasPriv(ADMIN) then[/lua]
Change it to this:
[lua]if ply:EntIndex() ~= 0 and not ply:IsSuperAdmin() then[/lua]
[b]Step 2:[/b]
Find this
[lua]if (ply:EntIndex() ~= 0 and not DB.HasPriv(ply, ADMIN)) or (togglecmd.superadmin and not ply:IsSuperAdmin()) then[/lua]
And Change it to:
[lua]if (ply:EntIndex() ~= 0 and not ply:IsSuperAdmin()) or (togglecmd.superadmin and not ply:IsSuperAdmin()) then[/lua]
[b]How to add VIP jobs using ULX:[/b]
Alright, First, You gotta make a ULX Group. If you have ULX, Type this to make a VIP group in-game:
[b]ulx addgroup VIP[/b]
Once you done that, You created your group. Now, Go to player.lua in the DarkRP folder, and find line 234. Right under that citizen code, Add this and edit it:
[lua]
if t == TEAM_YOURCLASS
and !self:IsUserGroup("VIP") and not self:IsAdmin()
then Notify(self, 1, 4, string.format("You must be a VIP to be this job."))
return
end [/lua]
After you added that with the class you want to only be a VIP job, In game when you select that class if the player is not a VIP or an admin, It should pop up with the message: "You must be a VIP to be this job.[/release]
Hope this helped.
Sorry, you need to Log In to post a reply to this thread.