hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2025.06.17. 13:55



Jelenlévő felhasználók

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

A legtöbb felhasználó (2761 fő) 2025.01.09. 20:06-kor tartózkodott itt.

Regisztrált felhasználók: Bing [Bot], Google [Bot]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  [2 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Plugin
HozzászólásElküldve:2016.01.02. 13:47 
Offline
Lelkes

Csatlakozott:2015.12.29. 14:22
Hozzászólások:15
Üdv. Valaki ki tudná venni ebből a pluginból a replace_all-okat úgy,hogy működjön a plugin?

  1. #include <amxmodx>
  2. #include <fakemeta>
  3. #include <hamsandwich>
  4. #include <cstrike>
  5.  
  6. new g_counter  
  7.  
  8. new g_SyncRestartTimer
  9. new g_SyncGameStart
  10.  
  11. new Float:RoundStartTime
  12.  
  13. new g_Time_Interval;
  14. const MAX_PLAYERS = 32;
  15.  
  16. new g_iRespawn[MAX_PLAYERS+1], g_TeamInfoCounter[MAX_PLAYERS+1], CsTeams:g_iPlayerTeam[MAX_PLAYERS+1];
  17. new g_pCvarRespawnTime, g_pCvarRespawnDelay, g_pCvarMaxHealth;
  18.  
  19. public plugin_init()
  20. {
  21.     register_plugin("Dr.Respawn", "1.2", "Vicious Vixen");
  22.     RegisterHam(Ham_Killed, "player", "fwdPlayerKilledPost", 1);
  23.     RegisterHam(Ham_Spawn, "player", "fwdPlayerSpawnPost", 1);
  24.     register_event("TeamInfo", "eTeamInfo", "a");
  25.     register_logevent( "LogEventRoundStart", 2, "1=Round_Start" )
  26.     g_pCvarRespawnTime = register_cvar("amx_respawn_tickets", "0"); //Set to 0 for unlimited respawns
  27.     g_pCvarRespawnDelay = register_cvar("amx_respawn_delay", "1");
  28.     g_pCvarMaxHealth = register_cvar("amx_max_health", "100");
  29.     g_Time_Interval = register_cvar("amx_max_time", "20");
  30.     set_msg_block( get_user_msgid( "ClCorpse" ), BLOCK_SET );
  31.    
  32.     g_SyncRestartTimer = CreateHudSyncObj()
  33.     g_SyncGameStart = CreateHudSyncObj()
  34.    
  35. }
  36.  
  37. public LogEventRoundStart()
  38. {
  39.     RoundStartTime = get_gametime()
  40.    
  41.     new iPlayers[32]
  42.     new iNum
  43.    
  44.     get_players( iPlayers, iNum )
  45.    
  46.     for( new i = 0; i < iNum; i++ )
  47.     {
  48.         g_iRespawn[iPlayers[i]] = true
  49.     }
  50.     set_task(1.0,"TimeCounter",123456,_,_,"a",get_pcvar_num(g_Time_Interval))
  51.     set_task(get_pcvar_float(g_Time_Interval),"Runda_Terminata",789123)
  52. }
  53.  
  54. public Runda_Terminata()
  55. {
  56.     if(RoundStartTime)
  57.     {
  58.         set_hudmessage( 255, 0, 0, 0.09, 0.00, 1, 0.5, 1.0, 0.5, 15.0, -1)
  59.         ShowSyncHudMsg( 0, g_SyncGameStart, "Ăšjra Ă©ledĂ©s vĂ©ge!")
  60.     }
  61. }
  62.  
  63. public fwdPlayerKilledPost(iVictim, iKiller, iShoudlGib)
  64. {
  65.     if(g_iRespawn[iVictim]++ < get_pcvar_num(g_pCvarRespawnTime) || get_pcvar_num(g_pCvarRespawnTime) == 0)
  66.     {
  67.         set_task(get_pcvar_float(g_pCvarRespawnDelay), "taskRespawnPlayer", iVictim);
  68.     }
  69.     return HAM_IGNORED;
  70. }
  71.  
  72. public fwdPlayerSpawnPost(iClient)
  73. {
  74.     if(is_user_alive(iClient))
  75.     {
  76.         set_pev(iClient, pev_health, get_pcvar_float(g_pCvarMaxHealth));
  77.     }
  78. }
  79.  
  80. public taskRespawnPlayer(id)
  81. {
  82.     if(is_user_connected(id) && RoundStartTime + get_pcvar_num(g_Time_Interval) >= get_gametime() && g_iRespawn[id] && !is_user_alive(id) && cs_get_user_team(id) != CS_TEAM_SPECTATOR) {
  83.         ExecuteHamB(Ham_CS_RoundRespawn, id)
  84.         g_iRespawn[id] = false
  85.         return PLUGIN_HANDLED;
  86.     }
  87.     return PLUGIN_HANDLED;
  88. }  
  89.  
  90. public eTeamInfo()
  91. {
  92.     new iClient = read_data(1);
  93.     new szTeam[2];
  94.     read_data(2, szTeam, charsmax(szTeam));
  95.     switch(szTeam[0])
  96.     {
  97.         case 'T':
  98.         {
  99.             remove_task(iClient);
  100.             g_iPlayerTeam[iClient] = CS_TEAM_T;
  101.         }
  102.         case 'C':
  103.         {
  104.             if(g_TeamInfoCounter[iClient] == 2 || g_iPlayerTeam[iClient] == CS_TEAM_SPECTATOR)
  105.             {
  106.                 set_task(get_pcvar_float(g_pCvarRespawnDelay), "taskRespawnPlayer",  iClient);
  107.             }
  108.             g_iPlayerTeam[iClient] = CS_TEAM_CT;
  109.         }
  110.         case 'S':
  111.         {
  112.             remove_task(iClient);
  113.             g_iPlayerTeam[iClient] = CS_TEAM_SPECTATOR;
  114.         }
  115.     }
  116. }
  117.  
  118. public TimeCounter()
  119. {
  120.     g_counter++
  121.    
  122.     new Float:iRestartTime = get_pcvar_float(g_Time_Interval) - g_counter
  123.     new Float:fSec
  124.     fSec = iRestartTime
  125.    
  126.     set_hudmessage( 255, 0, 0, 0.09, 0.0, 1, 0.0, 1.0, 0.0, 0.0, -1)
  127.     ShowSyncHudMsg( 0, g_SyncRestartTimer, "ĂšjraĂ©ledĂ©s mĂ©g %d másodpercig.", floatround(fSec))
  128.    
  129.     if(get_pcvar_num(g_Time_Interval) - g_counter < 11 && get_pcvar_num(g_Time_Interval) - g_counter !=0)
  130.     {
  131.         static szNum[32]
  132.         num_to_word(get_pcvar_num(g_Time_Interval) - g_counter, szNum, 31)
  133.     }
  134.     if(g_counter == get_pcvar_num(g_Time_Interval))
  135.     {
  136.         g_counter = 0
  137.     }
  138. }
  139. stock print_color(const id, const input[], any:...)
  140. {
  141.         new count = 1, players[32]
  142.         static msg[191]
  143.         vformat(msg, 190, input, 3)
  144.  
  145.         replace_all(msg, 190, "!g", "^4")
  146.         replace_all(msg, 190, "!y", "^1")
  147.         replace_all(msg, 190, "!t", "^3")
  148.         replace_all(msg, 190, "á", "á")
  149.         replace_all(msg, 190, "é", "Ă©")
  150.         replace_all(msg, 190, "í", "Ă­")
  151.         replace_all(msg, 190, "ó", "Ăł")
  152.         replace_all(msg, 190, "ö", "ö")
  153.         replace_all(msg, 190, "ő", "Ĺ‘")
  154.         replace_all(msg, 190, "ú", "Ăş")
  155.         replace_all(msg, 190, "ü", "ĂĽ")
  156.         replace_all(msg, 190, "ű", "ű")
  157.         replace_all(msg, 190, "Á", "Á")
  158.         replace_all(msg, 190, "É", "É")
  159.         replace_all(msg, 190, "Í", "ĂŤ")
  160.         replace_all(msg, 190, "Ó", "Ă“")
  161.         replace_all(msg, 190, "Ö", "Ă–")
  162.         replace_all(msg, 190, "Ő", "Ő")
  163.         replace_all(msg, 190, "Ú", "Ăš")
  164.         replace_all(msg, 190, "Ü", "Ăś")
  165.         replace_all(msg, 190, "Ű", "Ű")      
  166.  
  167.         if (id) players[0] = id; else get_players(players, count, "ch")
  168.         {
  169.                 for (new i = 0; i < count; i++)
  170.                 {
  171.                         if (is_user_connected(players[i]))
  172.                         {
  173.                                 message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
  174.                                 write_byte(players[i])
  175.                                 write_string(msg)
  176.                                 message_end()
  177.                         }
  178.                 }
  179.         }
  180.         return PLUGIN_HANDLED
  181. }
  182. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  183. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1038\\ f0\\ fs16 \n\\ par }
  184. */


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Plugin
HozzászólásElküldve:2016.01.02. 16:31 
Offline
Tud valamit
Avatar

Csatlakozott:2015.09.16. 07:38
Hozzászólások:147
Megköszönt másnak: 7 alkalommal
Megköszönték neki: 1 alkalommal
Tessék (tesztelve nem volt de hiba nélkül le lehet fordítani)
  1. #include <amxmodx>
  2. #include <fakemeta>
  3. #include <hamsandwich>
  4. #include <cstrike>
  5.  
  6. new g_counter  
  7.  
  8. new g_SyncRestartTimer
  9. new g_SyncGameStart
  10.  
  11. new Float:RoundStartTime
  12.  
  13. new g_Time_Interval;
  14. const MAX_PLAYERS = 32;
  15.  
  16. new g_iRespawn[MAX_PLAYERS+1], g_TeamInfoCounter[MAX_PLAYERS+1], CsTeams:g_iPlayerTeam[MAX_PLAYERS+1];
  17. new g_pCvarRespawnTime, g_pCvarRespawnDelay, g_pCvarMaxHealth;
  18.  
  19. public plugin_init()
  20. {
  21.     register_plugin("Dr.Respawn", "1.2", "Vicious Vixen");
  22.     RegisterHam(Ham_Killed, "player", "fwdPlayerKilledPost", 1);
  23.     RegisterHam(Ham_Spawn, "player", "fwdPlayerSpawnPost", 1);
  24.     register_event("TeamInfo", "eTeamInfo", "a");
  25.     register_logevent( "LogEventRoundStart", 2, "1=Round_Start" )
  26.     g_pCvarRespawnTime = register_cvar("amx_respawn_tickets", "0"); //Set to 0 for unlimited respawns
  27.     g_pCvarRespawnDelay = register_cvar("amx_respawn_delay", "1");
  28.     g_pCvarMaxHealth = register_cvar("amx_max_health", "100");
  29.     g_Time_Interval = register_cvar("amx_max_time", "20");
  30.     set_msg_block( get_user_msgid( "ClCorpse" ), BLOCK_SET );
  31.    
  32.     g_SyncRestartTimer = CreateHudSyncObj()
  33.     g_SyncGameStart = CreateHudSyncObj()
  34.    
  35. }
  36.  
  37. public LogEventRoundStart()
  38. {
  39.     RoundStartTime = get_gametime()
  40.    
  41.     new iPlayers[32]
  42.     new iNum
  43.    
  44.     get_players( iPlayers, iNum )
  45.    
  46.     for( new i = 0; i < iNum; i++ )
  47.     {
  48.         g_iRespawn[iPlayers[i]] = true
  49.     }
  50.     set_task(1.0,"TimeCounter",123456,_,_,"a",get_pcvar_num(g_Time_Interval))
  51.     set_task(get_pcvar_float(g_Time_Interval),"Runda_Terminata",789123)
  52. }
  53.  
  54. public Runda_Terminata()
  55. {
  56.     if(RoundStartTime)
  57.     {
  58.         set_hudmessage( 255, 0, 0, 0.09, 0.00, 1, 0.5, 1.0, 0.5, 15.0, -1)
  59.         ShowSyncHudMsg( 0, g_SyncGameStart, "Ăšjra Ă©ledĂ©s vĂ©ge!")
  60.     }
  61. }
  62.  
  63. public fwdPlayerKilledPost(iVictim, iKiller, iShoudlGib)
  64. {
  65.     if(g_iRespawn[iVictim]++ < get_pcvar_num(g_pCvarRespawnTime) || get_pcvar_num(g_pCvarRespawnTime) == 0)
  66.     {
  67.         set_task(get_pcvar_float(g_pCvarRespawnDelay), "taskRespawnPlayer", iVictim);
  68.     }
  69.     return HAM_IGNORED;
  70. }
  71.  
  72. public fwdPlayerSpawnPost(iClient)
  73. {
  74.     if(is_user_alive(iClient))
  75.     {
  76.         set_pev(iClient, pev_health, get_pcvar_float(g_pCvarMaxHealth));
  77.     }
  78. }
  79.  
  80. public taskRespawnPlayer(id)
  81. {
  82.     if(is_user_connected(id) && RoundStartTime + get_pcvar_num(g_Time_Interval) >= get_gametime() && g_iRespawn[id] && !is_user_alive(id) && cs_get_user_team(id) != CS_TEAM_SPECTATOR) {
  83.         ExecuteHamB(Ham_CS_RoundRespawn, id)
  84.         g_iRespawn[id] = false
  85.         return PLUGIN_HANDLED;
  86.     }
  87.     return PLUGIN_HANDLED;
  88. }  
  89.  
  90. public eTeamInfo()
  91. {
  92.     new iClient = read_data(1);
  93.     new szTeam[2];
  94.     read_data(2, szTeam, charsmax(szTeam));
  95.     switch(szTeam[0])
  96.     {
  97.         case 'T':
  98.         {
  99.             remove_task(iClient);
  100.             g_iPlayerTeam[iClient] = CS_TEAM_T;
  101.         }
  102.         case 'C':
  103.         {
  104.             if(g_TeamInfoCounter[iClient] == 2 || g_iPlayerTeam[iClient] == CS_TEAM_SPECTATOR)
  105.             {
  106.                 set_task(get_pcvar_float(g_pCvarRespawnDelay), "taskRespawnPlayer",  iClient);
  107.             }
  108.             g_iPlayerTeam[iClient] = CS_TEAM_CT;
  109.         }
  110.         case 'S':
  111.         {
  112.             remove_task(iClient);
  113.             g_iPlayerTeam[iClient] = CS_TEAM_SPECTATOR;
  114.         }
  115.     }
  116. }
  117.  
  118. public TimeCounter()
  119. {
  120.     g_counter++
  121.    
  122.     new Float:iRestartTime = get_pcvar_float(g_Time_Interval) - g_counter
  123.     new Float:fSec
  124.     fSec = iRestartTime
  125.    
  126.     set_hudmessage( 255, 0, 0, 0.09, 0.0, 1, 0.0, 1.0, 0.0, 0.0, -1)
  127.     ShowSyncHudMsg( 0, g_SyncRestartTimer, "ĂšjraĂ©ledĂ©s mĂ©g %d másodpercig.", floatround(fSec))
  128.    
  129.     if(get_pcvar_num(g_Time_Interval) - g_counter < 11 && get_pcvar_num(g_Time_Interval) - g_counter !=0)
  130.     {
  131.         static szNum[32]
  132.         num_to_word(get_pcvar_num(g_Time_Interval) - g_counter, szNum, 31)
  133.     }
  134.     if(g_counter == get_pcvar_num(g_Time_Interval))
  135.     {
  136.         g_counter = 0
  137.     }
  138.    
  139.         return PLUGIN_HANDLED
  140. }
  141. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  142. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1038\\ f0\\ fs16 \n\\ par }
  143. */


AMX Mod X Compiler 1.8.3-manual
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2013 AMX Mod X Team

Modified for www.Freakz.ro / amx.freakz.ro

Header size: 1144 bytes
Code size: 4644 bytes
Data size: 2072 bytes
Stack/heap size: 16384 bytes; estimated max. usage=47 cells (188 bytes)
Total requirements: 24244 bytes
Done.


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  [2 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 15 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