I have a couple of problems with my server can anyone help me?

  1. Ammo only being able to be bought by the gun dealer (TEAM_GUN)

DarkRP.createAmmoType(“pistol”, {
name = “Pistol ammo”,
model = “models/Items/BoxSRounds.mdl”,
price = 30,
amountGiven = 24,
customCheck = function(ply) return ply:Team() == TEAM_GUN end)
}

It all seems fine but for some reason it doesn’t work?

  1. I have made the group Owner and inherited SuperAdmin to it but for some reason I cannot pick up world props? (I am using falcos prop protection)

If anybody can help me with any one of these strange problems you are amazing!

Is there any way to fix any of these problems?



DarkRP.createAmmoType("pistol", {
	name = "Pistol ammo",
	model = "models/Items/BoxSRounds.mdl",
	price = 30,
	amountGiven = 24,
	customCheck = function(ply) return ply:Team() == TEAM_GUN end
}


you have to be in team gun to use it

OR



DarkRP.createAmmoType("pistol", {
	name = "Pistol ammo",
	model = "models/Items/BoxSRounds.mdl",
	price = 30,
	amountGiven = 24,
	customCheck = function(ply) return ply:Team() == TEAM_GUN or ply:IsSuperAdmin or ply:IsUserGroup ("owner") end
}


@log404

Anybody can still buy ammo and the code looks basically the same!

-Snip, thought it was a gun-

Can nobody help me??? The problem doesn’t seem too hard to solve!

First off, if it isn’t too hard to solve, then you should be able to figure it out. It’s your server, you gotta put some effort in.

Second, why are you trying to return a team index?

[lua]customCheck = function(ply) return ply:Team() == TEAM_GUN end)[/lua]

Actually I’m not even sure what this is going to return.

[lua]customCheck = function(ply)
if ply:Team() == TEAM_GUN then
return true;
else
return false;
end
end)[/lua]

Edit:

Ignore the above, sleep deprived answer == no good.

Everything in this thread is wrong.

[lua]
DarkRP.createAmmoType(“pistol”, {
name = “Pistol ammo”,
model = “models/Items/BoxSRounds.mdl”,
price = 30,
amountGiven = 24,
customCheck = function(ply) return ply:Team() == TEAM_GUN end
})
[/lua]

None of these work?!? Has anyone actually tested these?

I have and mine works for me.

You do realise that “ply:Team() == TEAM_GUN” will return true when the team is TEAM_GUN and false when the team is not TEAM_GUN, right?

You don’t need if statements, because what you are trying to do is basically:



if true then
    return true
else
    return false
end


Makes no sense.

Does anybody have any tested and working code? All I want is some ammo to be only sold by a GunDealer!

shut your needy ass up please, we are working with you and your bumping your own thread despite its only been 3 hours, why dont you be patient and wait?
-what bo98 said should work just fine.

@Tolee

I am just looking for some help you don’t have to rage out at me!

You have already been given some help all he was trying to say is that you people aren’t going to continuously spoon feed you, if it doesn’t work tell us what you put in what file and show use the whole of it and also show us any errors saying it doesn’t work just waists your and our time

Now please can we get back on topic

@ ZombieWizzard

There is no errors at all and any player can still buy the ammo where I need it so only gundealers can buy ammo

Honestly, I had no idea (probably a lack of sleep I’ve had the last few days due to constant amounts of work with my new job). Thanks for clearing that up for me.

Is this a bug in darkrp or what? Is there anyway of doing this at all?