hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.05.03. 08:03



Jelenlévő felhasználók

Jelenleg 567 felhasználó van jelen :: 0 regisztrált, 0 rejtett és 567 vendég

A legtöbb felhasználó (1565 fő) 2020.11.21. 11:26-kor tartózkodott itt.

Regisztrált felhasználók: nincs regisztrált felhasználó az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Új téma nyitása  Hozzászólás a témához  [ 3 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: ZP Nemesis
HozzászólásElküldve: 2017.07.31. 18:15 
Offline
Tud valamit

Csatlakozott: 2016.12.25. 12:43
Hozzászólások: 129
Megköszönt másnak: 35 alkalommal
Megköszönték neki: 4 alkalommal
Üdv!
Valaki javítaná. Így szedtem le hibásan.
  1. /*================================================================================
  2.    
  3.     -------------------------------
  4.     -*- [ZP] Game Mode: Assassin -*-
  5.     -------------------------------
  6.    
  7.     This plugin is part of Zombie Plague Mod and is distributed under the
  8.     terms of the GNU General Public License. Check ZP_ReadMe.txt for details.
  9.    
  10. ================================================================================*/
  11.  
  12. #include <amxmodx>
  13. #include <amx_settings_api>
  14. #include <cs_teams_api>
  15. #include <zp50_gamemodes>
  16. #include <zp50_class_assassin>
  17. #include <zp50_deathmatch>
  18.  
  19. // Settings file
  20. new const ZP_SETTINGS_FILE[] = "zombieplague.ini"
  21.  
  22. // Default sounds
  23. new const sound_assassin[][] = { "zombie_plague/nemesis1.wav" , "zombie_plague/nemesis2.wav" }
  24.  
  25. #define SOUND_MAX_LENGTH 64
  26.  
  27. new Array:g_sound_assassin
  28.  
  29. // HUD messages
  30. #define HUD_EVENT_X -1.0
  31. #define HUD_EVENT_Y 0.17
  32. #define HUD_EVENT_R 255
  33. #define HUD_EVENT_G 20
  34. #define HUD_EVENT_B 20
  35.  
  36. new g_MaxPlayers
  37. new g_HudSync
  38. new g_TargetPlayer
  39. new g_LValue[2]
  40.  
  41. new cvar_assassin_chance, cvar_assassin_min_players
  42. new cvar_assassin_show_hud, cvar_assassin_sounds
  43. new cvar_assassin_allow_respawn
  44.  
  45. public plugin_precache()
  46. {
  47.     // Register game mode at precache (plugin gets paused after this)
  48.     register_plugin("[ZP] Game Mode: Assassin", ZP_VERSION_STRING, "ZP Dev Team")
  49.     zp_gamemodes_register("Assassin Mode")
  50.    
  51.     // Create the HUD Sync Objects
  52.     g_HudSync = CreateHudSyncObj()
  53.    
  54.     g_MaxPlayers = get_maxplayers()
  55.    
  56.     cvar_assassin_chance = register_cvar("zp_assassin_chance", "20")
  57.     cvar_assassin_min_players = register_cvar("zp_assassin_min_players", "0")
  58.     cvar_assassin_show_hud = register_cvar("zp_assassin_show_hud", "1")
  59.     cvar_assassin_sounds = register_cvar("zp_assassin_sounds", "1")
  60.     cvar_assassin_allow_respawn = register_cvar("zp_assassin_allow_respawn", "0")
  61.    
  62.     // Initialize arrays
  63.     g_sound_assassin = ArrayCreate(SOUND_MAX_LENGTH, 1)
  64.    
  65.     // Load from external file
  66.     amx_load_setting_string_arr(ZP_SETTINGS_FILE, "Sounds", "ROUND ASSASSIN", g_sound_assassin)
  67.    
  68.     // If we couldn't load custom sounds from file, use and save default ones
  69.     new index
  70.     if (ArraySize(g_sound_assassin) == 0)
  71.     {
  72.         for (index = 0; index < sizeof sound_assassin; index++)
  73.             ArrayPushString(g_sound_assassin, sound_assassin[index])
  74.        
  75.         // Save to external file
  76.         amx_save_setting_string_arr(ZP_SETTINGS_FILE, "Sounds", "ROUND ASSASSIN", g_sound_assassin)
  77.     }
  78.    
  79.     // Precache sounds
  80.     new sound[SOUND_MAX_LENGTH]
  81.     for (index = 0; index < ArraySize(g_sound_assassin); index++)
  82.     {
  83.         ArrayGetString(g_sound_assassin, index, sound, charsmax(sound))
  84.         if (equal(sound[strlen(sound)-4], ".mp3"))
  85.         {
  86.             format(sound, charsmax(sound), "sound/%s", sound)
  87.             precache_generic(sound)
  88.         }
  89.         else
  90.             precache_sound(sound)
  91.     }
  92. }
  93.  
  94. // Deathmatch module's player respawn forward
  95. public zp_fw_deathmatch_respawn_pre(id)
  96. {
  97.     // Respawning allowed?
  98.     if (!get_pcvar_num(cvar_assassin_allow_respawn))
  99.         return PLUGIN_HANDLED;
  100.    
  101.     return PLUGIN_CONTINUE;
  102. }
  103.  
  104. public zp_fw_core_spawn_post(id)
  105. {
  106.     // Always respawn as human on assassin rounds
  107.     zp_core_respawn_as_zombie(id, false)
  108. }
  109.  
  110. public zp_fw_gamemodes_choose_pre(game_mode_id, skipchecks)
  111. {
  112.     if (!skipchecks)
  113.     {
  114.         // Random chance
  115.         if (random_num(1, get_pcvar_num(cvar_assassin_chance)) != 1)
  116.             return PLUGIN_HANDLED;
  117.        
  118.         // Min players
  119.         if (GetAliveCount() < get_pcvar_num(cvar_assassin_min_players))
  120.             return PLUGIN_HANDLED;
  121.     }
  122.    
  123.     // Game mode allowed
  124.     return PLUGIN_CONTINUE;
  125. }
  126.  
  127. public zp_fw_gamemodes_choose_post(game_mode_id, target_player)
  128. {
  129.     // Pick player randomly?
  130.     g_TargetPlayer = (target_player == RANDOM_TARGET_PLAYER) ? GetRandomAlive(random_num(1, GetAliveCount())) : target_player
  131. }
  132.  
  133. public zp_fw_gamemodes_start()
  134. {  
  135.     // Turn player into survivor
  136.     zp_class_assassin_set(g_TargetPlayer)
  137.    
  138.     // Remaining players should be humans (CTs)
  139.     new id
  140.     for (id = 1; id <= g_MaxPlayers; id++)
  141.     {
  142.         // Not alive
  143.         if (!is_user_alive(id))
  144.             continue;
  145.        
  146.         // This is our assassin
  147.         if (zp_class_assassin_get(id))
  148.             continue;
  149.        
  150.         // Switch to CT
  151.         cs_set_player_team(id, CS_TEAM_CT)
  152.     }
  153.    
  154.     // Play assassin sound
  155.     if (get_pcvar_num(cvar_assassin_sounds))
  156.     {
  157.         new sound[SOUND_MAX_LENGTH]
  158.         ArrayGetString(g_sound_assassin, random_num(0, ArraySize(g_sound_assassin) - 1), sound, charsmax(sound))
  159.         PlaySoundToClients(sound)
  160.     }
  161.    
  162.     if (get_pcvar_num(cvar_assassin_show_hud))
  163.     {
  164.         // Show assassin HUD notice
  165.         new name[32]
  166.         get_user_name(g_TargetPlayer, name, charsmax(name))
  167.         set_hudmessage(HUD_EVENT_R, HUD_EVENT_G, HUD_EVENT_B, HUD_EVENT_X, HUD_EVENT_Y, 1, 0.0, 5.0, 1.0, 1.0, -1)
  168.         ShowSyncHudMsg(0, g_HudSync, "%L", LANG_PLAYER, "NOTICE_ASSASSIN", name)
  169.     }
  170.  
  171.     // Setting Dark Lightning For The Mode
  172.     get_cvar_string ( "zp_lighting", g_LValue , 2 )
  173.     if ( !equali( "g_LValue" , "a" ) )
  174.     {
  175.  
  176.         set_cvar_string ( "zp_lighting" , "a" )
  177.  
  178.     }
  179. }
  180.  
  181. // Plays a sound on clients
  182. PlaySoundToClients(const sound[])
  183. {
  184.     if (equal(sound[strlen(sound)-4], ".mp3"))
  185.         client_cmd(0, "mp3 play ^"sound/%s^"", sound)
  186.     else
  187.         client_cmd(0, "spk ^"%s^"", sound)
  188. }
  189.  
  190. // Get Alive Count -returns alive players number-
  191. GetAliveCount()
  192. {
  193.     new iAlive, id
  194.    
  195.     for (id = 1; id <= g_MaxPlayers; id++)
  196.     {
  197.         if (is_user_alive(id))
  198.             iAlive++
  199.     }
  200.    
  201.     return iAlive;
  202. }
  203.  
  204. // Get Random Alive -returns index of alive player number target_index -
  205. GetRandomAlive(target_index)
  206. {
  207.     new iAlive, id
  208.    
  209.     for (id = 1; id <= g_MaxPlayers; id++)
  210.     {
  211.         if (is_user_alive(id))
  212.             iAlive++
  213.        
  214.         if (iAlive == target_index)
  215.             return id;
  216.     }
  217.    
  218.     return -1;
  219. }
  220.  
  221. public zp_fw_gamemodes_end()
  222. {
  223.     // Setting The lighting Settings as before the Mode.
  224.     new cfgdir[32]
  225.     get_configsdir(cfgdir, charsmax(cfgdir))
  226.  
  227.     server_cmd("exec %s/zombieplague.cfg", cfgdir)
  228. }


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: ZP Nemesis
HozzászólásElküldve: 2017.07.31. 19:03 
Offline
Őstag
Avatar

Csatlakozott: 2015.07.27. 22:56
Hozzászólások: 1367
Megköszönt másnak: 28 alkalommal
Megköszönték neki: 351 alkalommal
Mi a hiba?


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: ZP Nemesis
HozzászólásElküldve: 2017.07.31. 19:51 
Offline
Nagyúr
Avatar

Csatlakozott: 2016.03.05. 20:56
Hozzászólások: 663
Megköszönt másnak: 27 alkalommal
Megköszönték neki: 124 alkalommal
Hibátlanul lefordul de látom az olvasás nem az erősséged mert ez assassin mod :D

_________________
Global Offensive modok:

Global Offensive Mode 1.0
Global Offensive Mode 3.0
exodus Global Offensive 4.0


Hozzászólás jelentése
Vissza a tetejére
   
Hozzászólások megjelenítése:  Rendezés  
Új téma nyitása  Hozzászólás a témához  [ 3 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 37 vendég


Nyithatsz új témákat ebben a fórumban.
Válaszolhatsz egy témára ebben a fórumban.
Nem szerkesztheted a hozzászólásaidat ebben a fórumban.
Nem törölheted a hozzászólásaidat ebben a fórumban.
Nem küldhetsz csatolmányokat ebben a fórumban.

Keresés:
Ugrás:  
Powered by phpBB® Forum Software © phpBB Limited
Magyar fordítás © Magyar phpBB Közösség
Portal: Kiss Portal Extension © Michael O'Toole