Page 1 of 2
[CS:S/CSGO] Zombie
Posted: Mon Dec 21, 2020 7:13 pm
by cssbestrpg
https://github.com/srpg/ZombieThis plugin choose random player to infect to zombie, when you are infected to zombie, you need to infect other players to zombie to win the game.
Huge thanks to Kami, helping me with code and made the code working.
Edit:
Added csgo support, thought no tested at all
Re: [Cs:s] Zombie
Posted: Mon Dec 21, 2020 7:49 pm
by Kami
Hey :) Maybe you should try and add some more features (you could look at the popular SM zombie mods for inspiration). RIght now this seems more like a prototype or backbone for a potential Zombie plugin.
Re: [Cs:s] Zombie
Posted: Mon Dec 21, 2020 7:51 pm
by cssbestrpg
I will add more features, like !ztele and more stuff
Re: [Cs:s] Zombie
Posted: Mon Dec 21, 2020 9:23 pm
by cssbestrpg
Updated:
- Added now market, when type market opens a menu
- Added players have 12000cash everytime when spawn
Re: [Cs:s] Zombie
Posted: Mon Dec 21, 2020 10:04 pm
by cssbestrpg
Updated:
- Added gain full hp, when kill zombie
- Added zombie death makes them back to human when respawns
Re: [Cs:s] Zombie
Posted: Tue Dec 22, 2020 6:25 am
by cssbestrpg
Updated:
- Added !ztele to teleport yourself to spawn
- Added message, when buy weapon
- Added check is player alive and not being t for market use
- Added check is alive for ztele
Re: [Cs:s] Zombie
Posted: Tue Dec 22, 2020 8:09 am
by cssbestrpg
Update:
- Added hegrenade hit set zombie on fire 10seconds
Re: [Cs:s] Zombie
Posted: Tue Dec 22, 2020 8:38 am
by cssbestrpg
Update:
- After first infect, players get m4a1 and deagle, armor + helmet
- Fixed not able use weapons after first round
- Fixed having incorrect price text, when buy from market
- Added when get infected to zombie, weapon get removed(should prevent weapons drop on floor)
- Fixed zombie not respawn after death
- Added when weapon is compelity out of bullets/ammo, it get automatically removed
- Added infect sound, when get infected
- Fixed bug when you are ct and you knife zombie, it keep getting infected(again)
Re: [Cs:s] Zombie
Posted: Thu Dec 24, 2020 4:50 pm
by cssbestrpg
Update:
- Fixed path warning
- Fixed losing weapons t team, before infect
- Added translations
Re: [Cs:s] Zombie
Posted: Sun Jan 10, 2021 12:26 pm
by cssbestrpg
Update:
- Added german translation
- Changed colors in translation
- Added configs
- Added first infected zombie is frozen 10seconds and no receive damage during of freeze
- Cleaned code
Re: [Cs:s] Zombie
Posted: Thu Jan 14, 2021 5:03 pm
by cssbestrpg
Update:
- Added clan_tag support for new functions
- If have the clan_tag server uses it gives following features:
- Weapons back after losing weapons from running out ammo/bullets(Config chance to disable)
- Health boost per kill(Config chance to disable)
- Speed boost(only once)(Config chance to disable)
- Fixed not giving clan_tag member their functions
- Added messages for weapon restore
- Fixed incorrect type in clan_tag getting for message
- Added timer for first infect
- Added teleport back to spawn, when get first infect
Re: [Cs:s] Zombie
Posted: Fri Jan 15, 2021 5:01 pm
by cssbestrpg
Update:
- Added zprops
Coming soon:
- Messages for zprop use
- Credits for zprop
Re: [Cs:s] Zombie
Posted: Sat Jan 16, 2021 12:23 pm
by cssbestrpg
Update:
- Added zprops messages
- Added credits prices for zprops
- Added show price of zprops
- Fixed not remove credits after zprop buy
Re: [Cs:s] Zombie
Posted: Wed Jan 27, 2021 6:37 pm
by cssbestrpg
Update:
- Added infinite bullets
Re: [Cs:s] Zombie
Posted: Sat Jan 30, 2021 10:38 am
by Ayuto
Hey, I saw you are instantiating the Player class quite often, but you are not reusing it. This is not how you are supposed to use classes in Python. So, I would like to give you a little hint. The good thing is that SP is caching the player classes, so misusing the Player class doesn't result in a very heavy performance impact. But your plugin will be faster and more readable if you are reusing the Player instances. Let me provide one example for your zombie.py. Your current code looks like this:
Syntax: Select all
@Event('player_spawn')
def player_spawn(args):
userid = args.get_int('userid')
Player(index_from_userid(userid)).gravity = 1 # Should restore old gravity
Player(index_from_userid(userid)).set_noblock(True)
Player(index_from_userid(userid)).cash = 12000
Player(index_from_userid(userid)).unrestrict_weapons(*weapons)
Game.send(index_from_userid(userid), green='\x04', default='\x07FFB300')
Market.send(index_from_userid(userid), green='\x04', default='\x07FFB300')
global location
location = Player(index_from_userid(userid)).origin
By reusing the Player instance it looks like this:
Syntax: Select all
@Event('player_spawn')
def player_spawn(event):
player = Player.from_userid(event['userid']) # Using get_int() is also fine. Just a personal preference :)
player.gravity = 1
player.set_noblock(True) # Alternatively: player.noblock = True
player.cash = 12000
player.unrestrict_weapons(*weapons)
Game.send(player.index, green='\x04', default='\x07FFB300')
Market.send(player.index, green='\x04', default='\x07FFB300')
global location
location = player.origin
The Player class has many methods and attributes you can access. Some of them are documented on the Wiki:
http://wiki.sourcepython.com/developing ... yers._basehttp://wiki.sourcepython.com/developing ... ies.entityAs for the colors we also have cross-game compatible constants:
https://github.com/Source-Python-Dev-Te ... aytext2.py
Re: [Cs:s] Zombie
Posted: Sat Jan 30, 2021 5:00 pm
by cssbestrpg
Hi, thanks for hint. I have updated code to reuse Player class.
Re: [CS:S/CSGO] Zombie
Posted: Sun Jan 31, 2021 5:17 pm
by cssbestrpg
Update:
- Added csgo support(no tested)
- Added drop weapon when buy in market(use knife if not want get weapons dropped during a buy a weapon)
Re: [CS:S/CSGO] Zombie
Posted: Tue Feb 02, 2021 7:12 pm
by cssbestrpg
Update:
- Fixed issues in csgo models not working correctly(not enterily tested)
Re: [CS:S/CSGO] Zombie
Posted: Tue Feb 16, 2021 2:44 pm
by cssbestrpg
Update:
- Changed for clan members health their max health increases when kill, instead adding current health for clan members
- Added back import accidently removed
Re: [CS:S/CSGO] Zombie
Posted: Fri Feb 26, 2021 6:31 pm
by cssbestrpg
Update:
- Fixed zprop credits message after buy being wrong
- Fixed not removing players credits after zprop buy
- Fixed english mistypo in zprop buy