Sorry for so many questions.
I want to do a round system where it detects if all the players on one team are dead then if one team's players are dead their is a new round (When the new round happens I will do stuff) the new round happens 5 secs after the last round ended.
Another question is how would I go about doing something so that if you have a weapon you cant pick it up again, even for more ammo. Like if their is 6 in a pile you can only pickup one of the same weapon.
Thanks.
First question: Fretta. Has everything you need.
Second question: use the PlayerCanPickupWeapon hook, like this:
[code]function OnlyOne(pl,wep)
if pl:HasWeapon(wep:GetClass()) then return false end
end
hook.Add("PlayerCanPickupWeapon","OnlyOne",OnlyOne)[/code]
What about not using Fretta?
Also thanks.
There's no reason not to use Fretta. It has everything you need down to the letter. Why reinvent the wheel?
[QUOTE=Entoros;16545764]There's no reason not to use Fretta. It has everything you need down to the letter. Why reinvent the wheel?[/QUOTE]
Maybe I don't want to use Fretta, plus I want to learn more stuff not use Fretta for everything.
'Fretta' is not what I want for this.
If you don't want to use Fretta, at least you should look at Fretta. You could just get some ideas from how it does it.
[QUOTE=Entoros;16545120]First question: Fretta. Has everything you need.
Second question: use the PlayerCanPickupWeapon hook, like this:
[code]function OnlyOne(pl,wep)
if pl:HasWeapon(wep:GetClass()) then return false end
end
hook.Add("PlayerCanPickupWeapon","OnlyOne",OnlyOne)[/code][/QUOTE]
Is it possible to check if the client has no ammo, if the client has no ammo they can pick up another of the same gun.
I presume you would use pl:GetAmmoCount?
[QUOTE=Entoros;16545764]Why reinvent the wheel?[/QUOTE]
Without reinventing the wheel our tyres on our cars would still be stone.
As for making something round based, it's pretty straight forward. Basic pseudo code:
[lua]
current = CurTime() + 60 --This should be pretty much ~60
hook.Add("Think", "ioausfd", function ()
if current > CurTime() then
--Round start/in progress
else
--round end and reset timer
current = CurTime() + 60 --This should now be ~120
end
end
)
[/lua]
[QUOTE=JSharpe;17000421]Without reinventing the wheel our tyres on our cars would still be stone[/QUOTE]
That's so true.
[QUOTE=JSharpe]Without reinventing the wheel our tyres on our cars would still be stone.[/QUOTE]
Erm, what? You modify the design of the existing wheel to make it better was the point of the analogy. Fretta is the wheel, so we make it better by making gamemodes for it.
[QUOTE=Entoros;17000647]Fretta is the wheel, so we make it better by making gamemodes for it.[/QUOTE]
Fretta is the wheel, we then use that very wheel. We don't make it better, we just use it in our own way.
[QUOTE=DawG_09;17000209]Is it possible to check if the client has no ammo, if the client has no ammo they can pick up another of the same gun.
I presume you would use pl:GetAmmoCount?[/QUOTE]
Well?
You can only reinvent the wheel so much.
I've tryed using GetAmmoCount but this dosent work, I'm prolly getting something wrong.
[lua]
function OnlyOne(pl,wep)
wep = pl:GetActiveWeapon()
if pl:GetAmmoCount(wep:GetPrimaryAmmoType()) >= 1
then return false
end
end
hook.Add("PlayerCanPickupWeapon","OnlyOne",OnlyOne)
[/lua]
Sorry, you need to Log In to post a reply to this thread.