Welcome, Guest. Please login or register.
Did you miss your activation email?
November 10, 2024, 06:37:34 AM
Home Help Login Register
News: Zombie Master 2 discussion

Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Spectator guns.
Pages: [1]
Author Topic: Spectator guns.  (Read 5807 times)
phoenixf129
Poster

Posts: 476


I Rise from the Ashes.


« on: February 05, 2011, 02:06:24 PM »

Any idea on how i would be able to make it so spectators can be given a weapon via lua? (Not picking them up of course.)

I noticed that InitialSpawn spectators CAN get guns via lua, but when you die, you cant because theoretically they actually ARE spectators, whereas the dead people are not.

I was thinking of implementing some silly thing where spectators are given guns at round end and can go finish off the living.
« Last Edit: February 05, 2011, 02:09:26 PM by phoenixf129 »

Software Upgrade Paradox - If you improve a piece of software enough times, you eventually ruin it.
Thelol182
Poster

Posts: 45


« Reply #1 on: February 05, 2011, 02:54:14 PM »

you got all these crazy idéa that are awesome! ^^
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #2 on: February 05, 2011, 03:07:27 PM »

Giving a weapon to a player == picking up a weapon. Player.Give(wepname) works by creating a weapon at their position. So you'd have to look at all the PlayerCanPickupWeapon hooks etc.

Dead players may be blocked from picking up weapons by GMod, though.

Perhaps use KeyPress (serverside) to detect when spectators click, and then do a FireBullets there. That would avoid the whole weapon hassle.
phoenixf129
Poster

Posts: 476


I Rise from the Ashes.


« Reply #3 on: February 05, 2011, 03:12:03 PM »

Giving a weapon to a player == picking up a weapon. Player.Give(wepname) works by creating a weapon at their position. So you'd have to look at all the PlayerCanPickupWeapon hooks etc.

Dead players may be blocked from picking up weapons by GMod, though.

Perhaps use KeyPress (serverside) to detect when spectators click, and then do a FireBullets there. That would avoid the whole weapon hassle.


Yeah... but InigialSpawn people aren't actually physically dead are they? That would explain why you can get a gun...

Software Upgrade Paradox - If you improve a piece of software enough times, you eventually ruin it.
phoenixf129
Poster

Posts: 476


I Rise from the Ashes.


« Reply #4 on: February 05, 2011, 04:45:33 PM »

What are the... ROUND_* types? For GetRoundState()

Software Upgrade Paradox - If you improve a piece of software enough times, you eventually ruin it.
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #5 on: February 05, 2011, 05:39:33 PM »

shared.lua
bigbadboo
Poster

Posts: 287


« Reply #6 on: February 05, 2011, 07:40:10 PM »

On my old VIP system, you could get guns as spectator. Obv this was corrected quite quickly.

A more fun idea would be to ignite every dead players on round end.
StormX
Poster

Posts: 69


« Reply #7 on: February 05, 2011, 08:20:41 PM »

function IgnitePly()

for k,v in pairs(player.GetAll()) do
    if v:IsAlive() then
        v:Ignite()
    end
end

end
hook.Add("RoundEnd", "IgnitePlayers", IgnitePly)
phoenixf129
Poster

Posts: 476


I Rise from the Ashes.


« Reply #8 on: February 05, 2011, 10:15:49 PM »

function IgnitePly()

for k,v in pairs(player.GetAll()) do
    if v:IsAlive() then
        v:Ignite()
    end
end

end
hook.Add("RoundEnd", "IgnitePlayers", IgnitePly)


if not v:IsAlive() then

Otherwise everyone who IS alive burns. Lol, which is the opposite of bigbadboo's comment. :)


In other news, spectators can now throw knives at round end.


Player1: I WIN! IM SO AWESOME
Spec1: Damn he killed me! I KNOW! Take this!
*Spec1 spams about 100 knives in Player1's Direction*
Player1: RUUUUUUUUUUUUUUUUUUUUUN!
*Player1 gets a knife in the face, and many other places. Many would think that Player1 now resembles a pincushion.*

Software Upgrade Paradox - If you improve a piece of software enough times, you eventually ruin it.
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #9 on: February 05, 2011, 10:34:51 PM »

IsAlive is not a function. RoundEnd is not a hook.

I hope there is a limit on the number of knives a spectator can throw, or people will hit the entity limit very quickly.
phoenixf129
Poster

Posts: 476


I Rise from the Ashes.


« Reply #10 on: February 06, 2011, 11:50:50 AM »

IsAlive is not a function. RoundEnd is not a hook.

I hope there is a limit on the number of knives a spectator can throw, or people will hit the entity limit very quickly.


Damned good point. But i set it so the knives disappear after one second, using a timer.

Software Upgrade Paradox - If you improve a piece of software enough times, you eventually ruin it.
bigbadboo
Poster

Posts: 287


« Reply #11 on: February 06, 2011, 02:27:15 PM »

Im going to implement the flaming, just for teh lolz.
phoenixf129
Poster

Posts: 476


I Rise from the Ashes.


« Reply #12 on: February 07, 2011, 09:36:38 AM »

Im going to implement the flaming, just for teh lolz.


That would be rather aggrevating, main reason why i haven't.

Instead of knives, im working on MONITORS, Dr. Hax moment here.

Software Upgrade Paradox - If you improve a piece of software enough times, you eventually ruin it.
Liru
Poster

Posts: 36



« Reply #13 on: February 08, 2011, 07:31:48 PM »

Instead of knives, im working on MONITORS, Dr. Hax moment here.


So now `bind / "say_team HAX!; sleep; ttt_throw_monitor"` is going to be necessary for your server? :P

Redditor? Join the TTT reddit:
http://ttt.reddit.com
phoenixf129
Poster

Posts: 476


I Rise from the Ashes.


« Reply #14 on: February 08, 2011, 09:09:00 PM »

Yep :) except I'll make the sound Play globally, instead of from the emitters loc .

Software Upgrade Paradox - If you improve a piece of software enough times, you eventually ruin it.
Pages: [1]
Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Spectator guns. « previous next »
Jump to:  


Login with username, password and session length

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
Page created in 0.009 seconds with 18 queries.