Approved Game Mode: Killer [ Fixed ! ]

Gameplay Addons
Post Reply
User avatar
lizoumapper
Mapper
Mapper
Morocco
Posts: 174
Joined: 1 Year Ago
Location: Morocco
Has thanked: 13 times
Been thanked: 9 times
Age: 18
Contact:

Game Mode: Killer [ Fixed ! ]

#1

Post by lizoumapper » 10 Months Ago

GameMode : Killer[/b]
Description :

This gamemode become all zombie is killer, not infector become kill human.

Cvars :

ze_killer_chance 1 // Chance Killer Mode ( if chance is 1, round killers always started ! )

Natives :
ze_start_killerround( id ) - Native start round killers

[!] Warning :

You enable sound want listen sound when appear zombie :
choose any sound but was extension .wav rename it ex : (gamemode_killer.wav) and poste in {GAMEDIR}/cstrike/sound/zombie_escape/

And go file zombie_escape.txt located in{GAMEDIR}/cstrike/addons/amxmodx/data/lang/
open file and add this (anywhere in the file):

Code: Select all

GAMEMODE_KILLER = Killer Mode Started !
ze_gamemode_killers.zip
SMA + AMXX
(5 KiB) Downloaded 133 times
ze_gamemode_killers.zip
SMA + AMXX
(5 KiB) Downloaded 133 times
  1.  
  2. /*
  3.     [ ZE ] Game:Mode : Killer
  4.     When Infect Zombie Become Killer !
  5.     Escapers-Zone.NET
  6. */
  7.  
  8. #include < zombie_escape >
  9.  
  10. #define ADMIN_ACCESS ADMIN_LEVEL_H
  11.  
  12. // Default Sound
  13. new SoundRound[ ] =
  14. {
  15.     "ambience/the_horror2.wav"
  16. }
  17.  
  18. // Variable
  19. new pcvar_chance
  20. new gMaxPlayers
  21.  
  22. // Bool
  23. new bool:gKiller[ 33 ]
  24.  
  25. public plugin_init() {
  26.    
  27.     // Load Plugin
  28.     register_plugin( "[ ZE ] Gamemode:Killer", "1.0.0", "LiZou Mapper")
  29.    
  30.     // Event
  31.     register_event( "HLTV", "EventNewRound", "a", "1=0", "2=0" )
  32.    
  33.     // Clcmds
  34.     register_clcmd( "ze_killers", "cmdKillers", ADMIN_ACCESS, "< Round Killers >" )
  35.    
  36.     // Cvars
  37.     pcvar_chance = register_cvar( "ze_killer_chance", "10" )
  38.    
  39.     // Dictionnary
  40.     register_dictionary( "zombie_escape.txt" )
  41.    
  42.     // More
  43.     gMaxPlayers = get_maxplayers( )
  44.    
  45. }
  46.  
  47. public plugin_natives( )
  48. {
  49.     register_native( "ze_start_killerround", "cmdKillers" )
  50. }
  51.  
  52. public plugin_precache( )
  53. {
  54.     precache_sound( SoundRound )
  55. }
  56.    
  57. public EventNewRound( id )
  58. {
  59.     // If chance = 1 start round nemesis
  60.     if( random_num(1, get_pcvar_num( pcvar_chance ) ) == 1 )
  61.     {
  62.         gKiller[ id ] = true
  63.     }
  64. }
  65.  
  66. public cmdKillers( id )
  67. {
  68.     gKiller[ id ] = true
  69.     client_print( id, print_console, "[ ? ] Next is Gamemode Killers^n" )
  70.     client_print( id, print_console, "[ ! ] Always if you want make gamemode killers make ze_killers in new round !" )
  71. }
  72.  
  73. public ze_zombie_appear( )
  74. {
  75.     // Effect Round ( Sound, Message )
  76.     Effect( )
  77. }
  78.  
  79. public ze_user_infected_pre( iVictim, iInfector )
  80. {
  81.     // if round killer started, make zombie killer
  82.     if( gKiller[ iInfector ] )
  83.     {
  84.         // Credits : Mohamed Alaa
  85.         ExecuteHamB( Ham_Killed, iVictim, iInfector, 0)
  86.         return 1;  
  87.     }
  88.    
  89.     return 0
  90. }
  91.  
  92. public ze_roundend( )
  93. {
  94.     for(new id ; id < gMaxPlayers ;id++ )
  95.         gKiller[ id ] = false
  96. }
  97.  
  98. Effect( )  
  99. {
  100.     for( new id; id < gMaxPlayers; id++ )
  101.     {
  102.     if( gKiller[ id ] )
  103.     {
  104.         static LangHUD[ 64 ]
  105.            
  106.         // Message Round Killers
  107.         formatex( LangHUD, charsmax( LangHUD ), "%L", LANG_PLAYER, "GAMEMODE_KILLER" )
  108.         set_hudmessage( 0, 255, 0, -1.0, 0.25, 1, 6.0, 5.0, 0.5, 1.5 )
  109.         show_hudmessage( id, LangHUD )
  110.            
  111.         // Sound Round Killer
  112.         client_cmd( id, "spk %s", SoundRound )
  113.     }
  114.     }
  115. }
Last edited by lizoumapper on 04 Feb 2020, 21:23, edited 7 times in total.
This is my blog : http://lizoumappercs.ga
GoldSource Engine :D

Muhammet20
Veteran Member
Veteran Member
Posts: 408
Joined: 1 Year Ago
Has thanked: 36 times
Been thanked: 5 times
Contact:

#2

Post by Muhammet20 » 10 Months Ago

nice
i will try after the first term ends
i mean for the school

[ Post made via Android ]

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 2016
Joined: 3 Years Ago
Location: Egypt
Has thanked: 34 times
Been thanked: 115 times
Age: 22
Contact:

#3

Post by Raheem » 5 Months Ago

You can use: ze_user_infected_pre(iVictim, iInfector, iDamage);

To block infection you do: At the same function, you can add sounds/HUDs... etc and no need for loop.

Update your code and make it human readable so I approve it.
These users thanked the author Raheem for the post:
lizoumapper (5 Months Ago)
Loading Raheem's signature, Please wait...
Image

User avatar
lizoumapper
Mapper
Mapper
Morocco
Posts: 174
Joined: 1 Year Ago
Location: Morocco
Has thanked: 13 times
Been thanked: 9 times
Age: 18
Contact:

#4

Post by lizoumapper » 5 Months Ago

Thanks Raheem
Plugin is Fixed !
i tested it in game. it's working good
but you check from it, check for all codes in plugin ( is not bad )
These users thanked the author lizoumapper for the post:
Raheem (5 Months Ago)
This is my blog : http://lizoumappercs.ga
GoldSource Engine :D

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests