Posts: 84
Threads: 20
Joined: Jun 2010
Reputation:
0
Hey guys, i want to make it to when a zombie attacks a human with a knife or chainsaw the human automatically gets infected. I'm not talking about OnPlayerDeath; i want it to make it to where one slash/swipe infects a human. I've seen it on two servers. How do i do this?
Keep in mind...
players lose health when they fall from high places, explosions, etc
Thanks
Posts: 1,506
Threads: 69
Joined: Feb 2008
And one of the server is mine, eh? (Maybe not, because in mine you get infected if the zombie hits you with anything).
By the way, why don't you try to re-create It yourself? xD
Posts: 84
Threads: 20
Joined: Jun 2010
Reputation:
0
Oh no I'm not going to copy it. It's completely different. I just think it's unfair that zombies with no weapons have to fully kill a human.
Posts: 1,506
Threads: 69
Joined: Feb 2008
What kills you is not a weapon. It's a virus.
Posts: 84
Threads: 20
Joined: Jun 2010
Reputation:
0
So it checks like if a player is near a player and after enough time and/or encounters you get infected?
Posts: 1,506
Threads: 69
Joined: Feb 2008
Nope.
It's not used that much in my server so I could tell you the Idea.
When a player press KEY_FIRE, It checks if you're a zombie. (An Admin must first make someone a zombie, or the player was infected by going to close to some secret place)
If you're a zombie, a loop checks all players If they're close to you.
If they're close enough It makes them a zombie.
Simple.
Then you can set their skins, make a timer to do w/e every w/e seconds.
Posts: 1,506
Threads: 69
Joined: Feb 2008
Not really. I never had any experience of that. Oh, by the way, you should make something like this;
and use M_PLAYERS instead of MAX_PLAYERS in loops.
(obviously change 40 to how many players you expect in your server).
This will increase the performance of the loops
Posts: 84
Threads: 20
Joined: Jun 2010
Reputation:
0
What about using 'foreach'?
Posts: 1,506
Threads: 69
Joined: Feb 2008
I didn't know about that, I just looked It up.
That'll probably work better