I need help adding a car dealer class that would be able to spawn cars. They would then be able to sell those cars to other players. The gamemode would then record that the player had bought a car and allow him to spawn it the next time he came on the server. Basically if anyone can point me to what lua files need editing or even a thread that answers the same question. That soulc help a lot.
Pleased don't "sign" your statement, drives people (me) insane.
Has for the car thing, 30 people with a car=bad.
It's not that big of a server, and I would make cars expensive enough so you would have to play for a long time to earn money to buy them
Ahem... okay most maps that DarkRP servers host on are too small for cars to actually be used, in addition to the fact that half of DarkRP's dim-witted users would be screaming at an admin because their car had been stolen by another dim-witted fool.
Please, don't take offense in this, I am just trying to make a point.
Well it could be made so that only the cars owner can use this, Stop poking holes in his question and just tell him...This is not easy to do and someone who is new at lua won't achieve this.
With DarkRP, you can perss F4 to own a car (jeep,airboat ect.) and use the keys to lock it and such.
Like you would a door.
But, as for adding a class that sells them, your on your own there.
I am not new to programing completely but i am 100% willing to learn to get this done. I beleve it will be a great addon to our server
I woulden't like adding car dealer ( reason: there is allready pple that allready are faggots that drives over pple that walks on the street. so like 5 cars on a darkRP server = total war fare. )
Omfg he doesn't care about what you guys think this forum is ment to be for helping not your opinion.
Anyway take a look at this forum might be something there: [url]http://www.facepunch.com/showthread.php?t=725936[/url]
[QUOTE=mrkool723;17523607]Omfg he doesn't care about what you guys think this forum is ment to be for helping not your opinion.
Anyway take a look at this forum might be something there: [url]http://www.facepunch.com/showthread.php?t=725936[/url][/QUOTE]
You just bumped a 10 month old thread...?
at least it has content.
I'll bet by now he either stopped caring or found out how.
[QUOTE=nivek;17524410]I'll bet by now he either stopped caring or found out how.[/QUOTE]
Damn Right
So have you found out how =)
If you want Golf to your server . add this to your Main.lua, Only bug is when the Car dealer change job the car Desappers . Im going to uploud it if i find a anser.
function BuyJeep(ply)
if args == "" then return "" end
local trace = { }
trace.start = ply:EyePos()
trace.endpos = trace.start + ply:GetAimVector() * 85
trace.filter = ply
if RPArrestedPlayers[ply:SteamID()] then return "" end
local tr = util.TraceLine(trace)
local cost = 230
if not ply:CanAfford(cost) then
Notify(ply, 1, 4, "Can not afford this!")
return ""
end
if ply:GetNWInt("maxvehicles") == CfgVars["maxvehicles"] then // This might not work. I added it to admincc.lua but it still might not work
Notify(ply, 1, 3, "Max Vehicles reached!") // If you don't want a restriction, just remove it.
return ""
end
if ply:Team() == TEAM_CAR then
ply:AddMoney(-1000)
Notify(ply, 1, 3, "You bought a Golf for $1000")
local car = ents.Create("prop_vehicle_jeep_old")
car:SetModel("models/golf/golf.mdl")
car:SetKeyValue("vehiclescript","scripts/vehicles/golf.txt")
car:SetNWEntity("owning_ent", ply)
car:SetNWString("Owner", "Shared")
car:SetPos(tr.HitPos)
car.nodupe = true
car:Spawn()
car.SID = ply.SID
return ""
else
Notify(ply, 1, 3, "You must be a Car Dealer to buy this.")
end
return ""
end
AddChatCommand("/buygolf", BuyJeep)
[editline]05:12PM[/editline]
[QUOTE=Coffe;19552398]If you want Golf to your server . add this to your Main.lua, Only bug is when the Car dealer change job the car Desappers . Im going to uploud it if i find a anser.
function BuyJeep(ply)
if args == "" then return "" end
local trace = { }
trace.start = ply:EyePos()
trace.endpos = trace.start + ply:GetAimVector() * 85
trace.filter = ply
if RPArrestedPlayers[ply:SteamID()] then return "" end
local tr = util.TraceLine(trace)
local cost = 1000
if not ply:CanAfford(cost) then
Notify(ply, 1, 4, "Can not afford this!")
return ""
end
if ply:GetNWInt("maxvehicles") == CfgVars["maxvehicles"] then // This might not work. I added it to admincc.lua but it still might not work
Notify(ply, 1, 3, "Max Vehicles reached!") // If you don't want a restriction, just remove it.
return ""
end
if ply:Team() == TEAM_CAR then
ply:AddMoney(-1000)
Notify(ply, 1, 3, "You bought a Golf for $1000")
local car = ents.Create("prop_vehicle_jeep_old")
car:SetModel("models/golf/golf.mdl")
car:SetKeyValue("vehiclescript","scripts/vehicles/golf.txt")
car:SetNWEntity("owning_ent", ply)
car:SetNWString("Owner", "Shared")
car:SetPos(tr.HitPos)
car.nodupe = true
car:Spawn()
car.SID = ply.SID
return ""
else
Notify(ply, 1, 3, "You must be a Car Dealer to buy this.")
end
return ""
end
AddChatCommand("/buygolf", BuyJeep)[/QUOTE]
unfunny bump
[QUOTE=Nightwatch;12446294]Ahem... okay most maps that DarkRP servers host on are too small for cars to actually be used, in addition to the fact that half of DarkRP's dim-witted users would be screaming at an admin because their car had been stolen by another dim-witted fool.
Please, don't take offense in this, I am just trying to make a point.[/QUOTE]
This was the basic sum-up of when I added cars to my server,
except I was the one stealing them.
[QUOTE=Gunner71;12436121]I need help adding a car dealer class that would be able to spawn cars. They would then be able to sell those cars to other players. The gamemode would then record that the player had bought a car and allow him to spawn it the next time he came on the server. Basically if anyone can point me to what lua files need editing or even a thread that answers the same question. That soulc help a lot.[/QUOTE]
I am sorry, but you are too late. There is such a class already in where you can find in random servers.
Sorry, you need to Log In to post a reply to this thread.