hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2025.06.16. 14:35



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  [3 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Fegyver sebesség bug
HozzászólásElküldve:2012.07.19. 03:52 
Offline
Őskövület
Avatar

Csatlakozott:2013.01.01. 17:48
Hozzászólások:2441
Megköszönt másnak: 18 alkalommal
Megköszönték neki: 21 alkalommal
Szépjóestét!

Az lenne a gondom, hogyha Furienben játszok, és furien vagyok azaz gyors, és átváltok a bombára majd vissza, és teljesen lelassulok. Ezt hogy lehet állítani? Szerintem nem a pluginban kell, hanem csak 1 cvar lesz és az nem az sv_maxspeed :)

Köszi előre is!


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Fegyver sebesség bug
HozzászólásElküldve:2012.07.19. 10:06 
Offline
Signore Senior
Avatar

Csatlakozott:2011.09.09. 17:39
Hozzászólások:4020
Megköszönt másnak: 12 alkalommal
Megköszönték neki: 139 alkalommal
Ehhez kellene a furien mód sma-ja. Ha berakod
Kód:
  1. ÍGY
akkor megcsinálom neked.


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Fegyver sebesség bug
HozzászólásElküldve:2012.07.19. 15:32 
Offline
Őskövület
Avatar

Csatlakozott:2013.01.01. 17:48
Hozzászólások:2441
Megköszönt másnak: 18 alkalommal
Megköszönték neki: 21 alkalommal
Jaj köszönöm Silent be is teszem!

SMA:
Kód:
  1. /*      Formatright © 2009, ConnorMcLeod

  2.  

  3.         Furiens is free software;

  4.         you can redistribute it and/or modify it under the terms of the

  5.         GNU General Public License as published by the Free Software Foundation.

  6.  

  7.         This program is distributed in the hope that it will be useful,

  8.         but WITHOUT ANY WARRANTY; without even the implied warranty of

  9.         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

  10.         GNU General Public License for more details.

  11.  

  12.         You should have received a copy of the GNU General Public License

  13.         along with Furiens; if not, write to the

  14.         Free Software Foundation, Inc., 59 Temple Place - Suite 330,

  15.         Boston, MA 02111-1307, USA.

  16. */

  17.  

  18. #include <amxmodx>

  19. #include <cstrike>

  20. #include <engine>

  21. #include <fun>

  22. #include <fakemeta>

  23. #include <hamsandwich>

  24.  

  25. #include "furien.inc"

  26.  

  27. #define MAX_PLAYERS 32

  28.  

  29. #define Ham_Player_ResetMaxSpeed Ham_Item_PreFrame

  30.  

  31. new g_iMaxPlayers

  32. #define FIRST_PLAYER_ID 1

  33. #define IsPlayer(%1)    ( FIRST_PLAYER_ID <= %1 <= g_iMaxPlayers )

  34.  

  35. new CsTeams:g_iFuriensTeam = CS_TEAM_T

  36.  

  37. // players offsets

  38. #define XTRA_OFS_PLAYER 5

  39. #define m_iAccount 115

  40. #define cs_set_money_value(%1,%2)       set_pdata_int(%1, m_iAccount, %2, XTRA_OFS_PLAYER)

  41.  

  42. // "weaponbox" offsets

  43. #define XO_WEAPONBOX                            4

  44. #define m_rgpPlayerItems_wpnbx_Slot5    39

  45. #define IsWeaponBoxC4(%1)       ( get_pdata_cbase(%1, m_rgpPlayerItems_wpnbx_Slot5, XO_WEAPONBOX) > 0 )

  46.  

  47. new g_bShouldAnswerMenu, g_bCanModifyCvars

  48. #define MarkUserSeeMenu(%1)     g_bShouldAnswerMenu |= 1<<(%1&31)

  49. #define ClearUserSeeMenu(%1)    g_bShouldAnswerMenu &= ~(1<<(%1&31))

  50. #define ShouldUserSeeMenu(%1)   g_bShouldAnswerMenu & 1<<(%1&31)

  51.  

  52. #define MarkUserCvars(%1)       g_bCanModifyCvars |= 1<<(%1&31)

  53. #define ClearUserCvars(%1)      g_bCanModifyCvars &= ~(1<<(%1&31))

  54. #define CanUserCvars(%1)                g_bCanModifyCvars & 1<<(%1&31)

  55.  

  56. const CVARS_MENU_KEYS = (1<<0)|(1<<1)

  57.  

  58. new g_iFurienTeamChangeForward

  59.  

  60. new g_iFurienRoundRestartForward, bool:g_bRestarting

  61.  

  62. new Float:g_flFurienGravity = 0.375

  63. new g_iInvisFactor = 1

  64. new Float:g_flMaxSpeed = 500.0

  65. new g_iFurienReward = 1337

  66. new g_iAntiReward = 400

  67. new g_iAnnounce = 1

  68.  

  69. new bool:g_bSwitchTeam = true

  70. new bool:g_bSwitchInProgress

  71.  

  72. new Trie:g_tPreventEntityKeyvalue

  73. new g_iPickUp = 2

  74.  

  75. new g_szSpeedCommand[128]

  76.  

  77. new g_szFurienWinSound[64]

  78. new g_szAntiWinSound[64]

  79.  

  80. new g_szGameDescription[32]

  81.  

  82. new g_bitBombPlant

  83.  

  84. new g_iNewMoney

  85. new g_iMsgHookMoney

  86.  

  87. new g_iTextMsg, g_iMoney

  88.  

  89. new HamHook:g_iHhTakeDamage

  90.  

  91. public plugin_natives()

  92. {

  93.         register_library("furien")

  94.         register_native("furien_get_user_team", "fr_get_user_team")

  95. }

  96.  

  97. public plugin_precache()

  98. {

  99.         if( !ReadCfgFile() )

  100.         {

  101.                 log_amx("Configuration file doesn't exist !!")

  102.         }

  103. }

  104.  

  105. public plugin_init()

  106. {

  107.         register_plugin("Furiens", FURIEN_VERSION, "ConnorMcLeod")

  108.  

  109.         register_dictionary("common.txt")

  110.         register_dictionary("furiens.txt")

  111.  

  112.         new pCvar = register_cvar("furien_version", FURIEN_VERSION, FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY)

  113.         set_pcvar_string(pCvar, FURIEN_VERSION)

  114.  

  115.         register_clcmd("say ?", "A_Propos")

  116.         register_clcmd("say_team ?", "A_Propos")

  117.         register_clcmd("?", "A_Propos")

  118.  

  119.         register_menucmd(register_menuid("Furiens Cvars"), CVARS_MENU_KEYS, "CvarsMenuCallBack")

  120.  

  121.         RegisterHam(Ham_Spawn, "player", "Player_Spawn_Post", 1)

  122.         RegisterHam(Ham_Player_ResetMaxSpeed, "player", "Player_ResetMaxSpeed", 1)

  123.  

  124.         register_message(get_user_msgid("SendAudio"), "Message_SendAudio")

  125.  

  126.         new iEnt

  127.         iEnt = create_entity("info_target")

  128.         set_pev(iEnt, pev_classname, "check_speed")

  129.         set_pev(iEnt, pev_nextthink, get_gametime() + 0.1)

  130.         register_think("check_speed", "Set_Furiens_Visibility")

  131.  

  132.         iEnt = create_entity("info_target")

  133.         set_pev(iEnt, pev_classname, "check_cvars")

  134.         set_pev(iEnt, pev_nextthink, get_gametime() + 10.0)

  135.         register_think("check_cvars", "Check_Players_Cvars")

  136.  

  137.         g_iFurienTeamChangeForward = CreateMultiForward("furien_team_change", ET_IGNORE, FP_CELL)

  138.  

  139.         register_event("TextMsg", "Event_TextMsg_Restart", "a", "2&#Game_C", "2&#Game_w")

  140.         register_event("HLTV", "Event_HLTV_New_Round", "a", "1=0", "2=0")

  141.         g_iFurienRoundRestartForward = CreateMultiForward("furien_round_restart", ET_IGNORE)

  142.  

  143.         register_event("DeathMsg", "Event_DeathMsg", "a")

  144.  

  145.         if( get_cvar_float("sv_maxspeed") < g_flMaxSpeed )

  146.         {

  147.                 set_cvar_float("sv_maxspeed", g_flMaxSpeed)

  148.         }

  149.  

  150.         formatex(g_szSpeedCommand, charsmax(g_szSpeedCommand),

  151.                         ";cl_forwardspeed %.1f;cl_sidespeed %.1f;cl_backspeed %.1f",

  152.                                                         g_flMaxSpeed, g_flMaxSpeed, g_flMaxSpeed)

  153.  

  154.         g_iMaxPlayers = get_maxplayers()

  155.         g_iTextMsg = get_user_msgid("TextMsg")

  156.         g_iMoney = get_user_msgid("Money")

  157. }

  158.  

  159. ReadCfgFile()

  160. {

  161.         new szConfigFile[128]

  162.         get_localinfo("amxx_configsdir", szConfigFile, charsmax(szConfigFile))

  163.         format(szConfigFile, charsmax(szConfigFile), "%s/furien/furien.ini", szConfigFile);

  164.  

  165.         new fp = fopen(szConfigFile, "rt")

  166.         if( !fp )

  167.         {

  168.                 return 0

  169.         }

  170.  

  171.         new szDatas[96], szKey[32], szValue[64]

  172.         while( !feof(fp) )

  173.         {

  174.                 fgets(fp, szDatas, charsmax(szDatas))

  175.                 trim(szDatas)

  176.                 if(!szDatas[0] || szDatas[0] == ';' || szDatas[0] == '#' || (szDatas[0] == '/' && szDatas[1] == '/'))

  177.                 {

  178.                         continue

  179.                 }

  180.  

  181.                 if( parse(szDatas, szKey, charsmax(szKey), szValue, charsmax(szValue)) < 2 || szValue[0] == 0 )

  182.                 {

  183.                         continue

  184.                 }

  185.  

  186.                 switch( szKey[0] )

  187.                 {

  188.                         case 'B':

  189.                         {

  190.                                 switch( szKey[1] )

  191.                                 {

  192.                                         case 'U':

  193.                                         {

  194.                                                 if( equal(szKey, "BUY") )

  195.                                                 {

  196.                                                         switch( clamp(str_to_num(szValue), 0, 1) )

  197.                                                         {

  198.                                                                 case 0:

  199.                                                                 {

  200.                                                                         new iEnt

  201.  

  202.                                                                         g_tPreventEntityKeyvalue = TrieCreate()

  203.                                                                         TrieSetCell(g_tPreventEntityKeyvalue, "player_weaponstrip", 1)

  204.                                                                         TrieSetCell(g_tPreventEntityKeyvalue, "game_player_equip", 1)

  205.                                                                         TrieSetCell(g_tPreventEntityKeyvalue, "info_map_parameters", 1)

  206.  

  207.                                                                         iEnt = create_entity("info_map_parameters")

  208.                                                                         DispatchKeyValue(iEnt, "buying", "3")

  209.                                                                         DispatchSpawn(iEnt)

  210.  

  211.                                                                         register_buy_cmd()

  212.                                                                 }

  213.                                                         }

  214.                                                 }

  215.                                         }

  216.                                         case 'O':

  217.                                         {

  218.                                                 if( equal(szKey, "BOMB_PLANT") )

  219.                                                 {

  220.                                                         g_bitBombPlant = clamp(str_to_num(szValue), 0, 3)

  221.                                                         if( g_bitBombPlant != 3 )

  222.                                                         {

  223.                                                                 RegisterHam(Ham_AddPlayerItem, "player", "Player_AddPlayerItem")

  224.                                                         }

  225.                                                 }

  226.                                         }

  227.                                 }

  228.                         }

  229.                         case 'F':

  230.                         {

  231.                                 if( equal(szKey, "FURIEN_ANNOUNCE") )

  232.                                 {

  233.                                         g_iAnnounce = str_to_num(szValue)

  234.                                 }

  235.                         }

  236.                         case 'G':

  237.                         {

  238.                                 switch( szKey[1] )

  239.                                 {

  240.                                         case 'A':

  241.                                         {

  242.                                                 if( equal(szKey, "GAMENAME") )

  243.                                                 {

  244.                                                         replace(szValue, charsmax(szValue), "%v", FURIEN_VERSION)

  245.                                                         copy(g_szGameDescription, charsmax(g_szGameDescription), szValue)

  246.                                                         register_forward(FM_GetGameDescription, "GetGameDescription")

  247.                                                 }

  248.                                         }

  249.                                         case 'R':

  250.                                         {

  251.                                                 if( equal(szKey, "GRAVITY") )

  252.                                                 {

  253.                                                         g_flFurienGravity = floatclamp(str_to_float(szValue), 0.0125, 1.0)

  254.                                                 }

  255.                                         }

  256.                                 }

  257.                         }

  258.                         case 'H':

  259.                         {

  260.                                 if( equal(szKey, "HOSTAGE_REMOVE") && str_to_num(szValue) )

  261.                                 {

  262.                                         RegisterHam(Ham_Spawn, "hostage_entity", "Hostage_Spawn")

  263.                                 }

  264.                         }

  265.                         case 'I':

  266.                         {

  267.                                 if( equal(szKey, "INVIS_FACTOR") )

  268.                                 {

  269.                                         g_iInvisFactor = clamp(str_to_num(szValue), 1, 4)

  270.                                 }

  271.                         }

  272.                         case 'K':

  273.                         {

  274.                                 switch( szKey[5] )

  275.                                 {

  276.                                         case 'A':

  277.                                         {

  278.                                                 if( equal(szKey, "KILL_ANTI_REWARD") )

  279.                                                 {

  280.                                                         g_iAntiReward = str_to_num(szValue)

  281.                                                 }

  282.                                         }

  283.                                         case 'F':

  284.                                         {

  285.                                                 if( equal(szKey, "KILL_FURIEN_REWARD") )

  286.                                                 {

  287.                                                         g_iFurienReward = str_to_num(szValue)

  288.                                                 }

  289.                                         }

  290.                                 }

  291.                         }

  292.                         case 'M':

  293.                         {

  294.                                 if( equal(szKey, "MAXSPEED") )

  295.                                 {

  296.                                         g_flMaxSpeed = floatclamp(str_to_float(szValue), 100.0, 2000.0)

  297.                                 }

  298.                         }

  299.                         case 'P':

  300.                         {

  301.                                 if( equal(szKey, "PICK_UP") )

  302.                                 {

  303.                                         g_iPickUp = clamp(str_to_num(szValue), 0, 3)

  304.                                         switch( g_iPickUp )

  305.                                         {

  306.                                                 case 0,1,2:

  307.                                                 {

  308.                                                         RegisterHam(Ham_Touch, "weaponbox", "CWeaponBox_Touch")

  309.                                                         RegisterHam(Ham_Touch, "armoury_entity", "GroundWeapon_Touch")

  310.                                                         RegisterHam(Ham_Touch, "weapon_shield", "GroundWeapon_Touch")

  311.                                                 }

  312.                                         }

  313.                                 }

  314.                         }

  315.                         case 'S':

  316.                         {

  317.                                 if( equal(szKey, "SWITCH_TEAMS") )

  318.                                 {

  319.                                         g_bSwitchTeam = !!clamp(str_to_num(szValue), 0, 1)

  320.                                         if( g_bSwitchTeam )

  321.                                         {

  322.                                                 g_iHhTakeDamage = RegisterHam(Ham_TakeDamage, "player", "Player_TakeDamage")

  323.                                                 DisableHamForward( g_iHhTakeDamage )

  324.                                         }

  325.                                 }

  326.                         }

  327.                         case 'W':

  328.                         {

  329.                                 if( equal(szKey, "WIN_SOUND_", 10) )

  330.                                 {

  331.                                         new szFullPath[128]

  332.                                         switch(szKey[10])

  333.                                         {

  334.                                                 case 'F':

  335.                                                 {

  336.                                                         formatex(szFullPath, charsmax(szFullPath), "sound/%s", szValue)

  337.                                                         if( file_exists(szFullPath) )

  338.                                                         {

  339.                                                                 copy(g_szFurienWinSound, charsmax(g_szFurienWinSound), szValue)

  340.                                                                 precache_sound(szValue)

  341.                                                         }

  342.                                                 }

  343.                                                 case 'A':

  344.                                                 {

  345.                                                         formatex(szFullPath, charsmax(szFullPath), "sound/%s", szValue)

  346.                                                         if( file_exists(szFullPath) )

  347.                                                         {

  348.                                                                 copy(g_szAntiWinSound, charsmax(g_szAntiWinSound), szValue)

  349.                                                                 precache_sound(szValue)

  350.                                                         }

  351.                                                 }

  352.                                         }

  353.                                 }

  354.                         }

  355.                 }

  356.         }

  357.         fclose( fp )

  358.  

  359.         return 1

  360. }

  361.  

  362. public GetGameDescription()

  363. {

  364.         forward_return(FMV_STRING, g_szGameDescription)

  365.         return FMRES_SUPERCEDE

  366. }

  367.  

  368. public Event_TextMsg_Restart()

  369. {

  370.         g_bRestarting = true

  371. }

  372.  

  373. public Event_HLTV_New_Round()

  374. {

  375.         if( g_bRestarting )

  376.         {

  377.                 g_bRestarting = false

  378.                 new iRet

  379.                 ExecuteForward(g_iFurienRoundRestartForward, iRet)

  380.         }

  381.  

  382.         if( g_bSwitchInProgress )

  383.         {

  384.                 g_bSwitchInProgress = false

  385.                 DisableHamForward( g_iHhTakeDamage )

  386.         }

  387. }

  388.  

  389. public GroundWeapon_Touch(iWeapon, id)

  390. {

  391.         if( IsPlayer(id) )

  392.         {

  393.                 if( !g_iPickUp )

  394.                 {

  395.                         remove_entity(iWeapon)

  396.                         return HAM_SUPERCEDE

  397.                 }

  398.  

  399.                 if( !is_user_alive(id) )

  400.                 {

  401.                         return HAM_SUPERCEDE

  402.                 }

  403.  

  404.                 new iTeam = __get_user_team(id)

  405.                 if(     ( iTeam == -1 )

  406.                 ||      (iTeam == Furien && g_iPickUp != 1)

  407.                 ||      (iTeam == AntiFurien && g_iPickUp != 2) )

  408.                 {

  409.                         return HAM_SUPERCEDE

  410.                 }

  411.         }

  412.         return HAM_IGNORED

  413. }

  414.  

  415. public CWeaponBox_Touch(iWeaponBox, id)

  416. {

  417.         if( IsPlayer(id) )

  418.         {

  419.                 if( !is_user_alive(id) )

  420.                 {

  421.                         return HAM_SUPERCEDE

  422.                 }

  423.  

  424.                 if( IsWeaponBoxC4(iWeaponBox) )

  425.                 {

  426.                         return HAM_IGNORED

  427.                 }

  428.  

  429.                 if( !g_iPickUp )

  430.                 {

  431.                         remove_entity(iWeaponBox)

  432.                         return HAM_SUPERCEDE

  433.                 }

  434.  

  435.                 new iTeam = __get_user_team(id)

  436.                 if(     ( iTeam == -1 )

  437.                 ||      (iTeam == Furien && g_iPickUp != 1)

  438.                 ||      (iTeam == AntiFurien && g_iPickUp != 2) )

  439.                 {

  440.                         return HAM_SUPERCEDE

  441.                 }

  442.         }

  443.         return HAM_IGNORED

  444. }

  445.  

  446. register_buy_cmd()

  447. {

  448.         register_clcmd("buy", "ClientCommand_Buy")

  449.         register_clcmd("bUy", "ClientCommand_Buy")

  450.         register_clcmd("buY", "ClientCommand_Buy")

  451.         register_clcmd("bUY", "ClientCommand_Buy")

  452.         register_clcmd("Buy", "ClientCommand_Buy")

  453.         register_clcmd("BUy", "ClientCommand_Buy")

  454.         register_clcmd("BuY", "ClientCommand_Buy")

  455.         register_clcmd("BUY", "ClientCommand_Buy")

  456. }

  457.  

  458. public ClientCommand_Buy(id)

  459. {

  460.         return PLUGIN_HANDLED_MAIN

  461. }

  462.  

  463. public pfn_keyvalue( iEnt )

  464. {

  465.         if( g_tPreventEntityKeyvalue )

  466.         {

  467.                 new szClassName[32], szCrap[2]

  468.                 copy_keyvalue(szClassName, charsmax(szClassName), szCrap, charsmax(szCrap), szCrap, charsmax(szCrap))

  469.                 if( TrieKeyExists(g_tPreventEntityKeyvalue, szClassName) )

  470.                 {

  471.                         remove_entity(iEnt)

  472.                         return PLUGIN_HANDLED

  473.                 }

  474.         }

  475.         return PLUGIN_CONTINUE

  476. }

  477.  

  478. public plugin_cfg()

  479. {

  480.         if( g_tPreventEntityKeyvalue )

  481.         {

  482.                 TrieDestroy(g_tPreventEntityKeyvalue)

  483.                 set_cvar_float("sv_restart", 1.0)

  484.         }

  485. }

  486.  

  487. public fr_get_user_team(/*iPlugin, iParams*/)

  488. {

  489.         return __get_user_team( get_param(1) )

  490. }

  491.  

  492. __get_user_team(id)

  493. {

  494.         new CsTeams:iTeam = cs_get_user_team(id)

  495.         if( CS_TEAM_T <= iTeam <= CS_TEAM_CT )

  496.         {

  497.                 if( iTeam == g_iFuriensTeam )

  498.                 {

  499.                         return Furien

  500.                 }

  501.                 return AntiFurien

  502.         }

  503.         return -1

  504. }

  505.  

  506. public client_connect(id)

  507. {


  508.         if( !is_user_bot(id) )

  509.         {

  510.                 query_client_cvar(id, "gl_clear", "Client_Cvar_Result")

  511.         }

  512. }

  513.  

  514. public Client_Cvar_Result(id, const szCvar[], const szValue[])

  515. {

  516.         if( szValue[0] == 'B' )

  517.         {

  518.                 server_cmd("kick #%d Software video mode forbidden !! Acceleration logicielle interdite !!", get_user_userid(id))

  519.         }

  520. }

  521.  

  522. public client_putinserver( id )

  523. {

  524.         MarkUserSeeMenu( id )

  525.         ClearUserCvars( id )

  526.  

  527.         if( g_iAnnounce )

  528.         {

  529.                 set_task(random_float(11.0, 19.0), "A_Propos", id)

  530.         }

  531. }

  532.  

  533. public Player_Spawn_Post( id )

  534. {

  535.         if( is_user_alive(id) )

  536.         {

  537.                 if( ShouldUserSeeMenu(id) )

  538.                 {

  539.                         ShowSpeedCvarsMenu(id)

  540.                 }

  541.  

  542.                 strip_user_weapons(id)

  543.  

  544.                 if( __get_user_team(id) == Furien )

  545.                 {

  546.                         set_user_gravity(id, g_flFurienGravity)

  547.                         set_user_footsteps(id, 1)

  548.                 }

  549.                 else

  550.                 {

  551.                         set_user_footsteps(id, 0)

  552.                         set_user_gravity(id, 1.0)

  553.                 }

  554.  

  555.                 set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderNormal, 0)

  556.         }

  557. }

  558.  

  559. ShowSpeedCvarsMenu(id)

  560. {

  561.         new szMenu[256], n

  562.         n += formatex(szMenu[n], charsmax(szMenu)-n, "%L^n", id, "FURIEN_MENU_CVAR")

  563.         n += formatex(szMenu[n], charsmax(szMenu)-n, "^n\y1\w. %L", id, "YES")

  564.         n += formatex(szMenu[n], charsmax(szMenu)-n, "^n\y2\w. %L", id, "NO")

  565.  

  566.         show_menu(id, CVARS_MENU_KEYS, szMenu, -1, "Furiens Cvars")

  567. }

  568.  

  569. public CvarsMenuCallBack(id, iKey)

  570. {

  571.         switch( iKey )

  572.         {

  573.                 case 0:

  574.                 {

  575.                         MarkUserCvars( id )

  576.                         ClearUserSeeMenu( id )

  577.                 }

  578.                 case 1:

  579.                 {

  580.                         ClearUserCvars( id )

  581.                 }

  582.         }

  583.         return PLUGIN_HANDLED

  584. }

  585.  

  586. public Player_ResetMaxSpeed( id )

  587. {

  588.         if( is_user_alive(id) && __get_user_team(id) == Furien && get_user_maxspeed(id) != 1.0 )

  589.         {

  590.                 set_pev(id, pev_maxspeed, g_flMaxSpeed)

  591.         }

  592. }

  593.  

  594. public Check_Players_Cvars( iEnt )

  595. {

  596.         entity_set_float(iEnt, EV_FL_nextthink, get_gametime() + 5.0)

  597.  

  598.         new iPlayers[MAX_PLAYERS], iNum, id

  599.         get_players(iPlayers, iNum, "ace", g_iFuriensTeam == CS_TEAM_T ? "TERRORIST" : "CT")

  600.         for(new i; i<iNum; i++)

  601.         {

  602.                 id = iPlayers[i]

  603.                 if( CanUserCvars( id ) )

  604.                 {

  605.                         query_client_cvar(id, "cl_forwardspeed", "CvarResult")

  606.                         query_client_cvar(id, "cl_backspeed", "CvarResult")

  607.                         query_client_cvar(id, "cl_sidespeed", "CvarResult")

  608.                 }

  609.         }

  610. }

  611.  

  612. public CvarResult(const id, const szCvar[], const szValue[])

  613. {

  614.         if( CanUserCvars( id ) && is_user_connected(id) && str_to_float(szValue) < g_flMaxSpeed )

  615.         {

  616.                 client_cmd(id, g_szSpeedCommand)

  617.         }

  618. }

  619.  

  620. public Set_Furiens_Visibility( iEnt )

  621. {

  622.         entity_set_float(iEnt, EV_FL_nextthink, get_gametime() + 0.1)

  623.  

  624.         new iPlayers[MAX_PLAYERS], iNum, id, Float:fVecVelocity[3], iSpeed

  625.  

  626.         get_players(iPlayers, iNum, "ae", g_iFuriensTeam == CS_TEAM_T ? "TERRORIST" : "CT")

  627.  

  628.         for(new i; i<iNum; i++)

  629.         {

  630.                 id = iPlayers[i]

  631.                 if( get_user_weapon(id) == CSW_KNIFE )

  632.                 {

  633.                         entity_get_vector(id, EV_VEC_velocity, fVecVelocity)

  634.                         iSpeed = floatround( vector_length(fVecVelocity) )

  635.                         if( iSpeed < g_iInvisFactor*255 )

  636.                         {

  637.                                 set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, iSpeed/g_iInvisFactor)

  638.                         }

  639.                         else

  640.                         {

  641.                                 set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderNormal, 0)

  642.                         }

  643.                 }

  644.                 else

  645.                 {

  646.                         set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderNormal, 0)

  647.                 }

  648.         }

  649. }

  650.  

  651. public Message_SendAudio(iMsgId, iMsgDest, id)

  652. {

  653.         if( !id )

  654.         {

  655.                 new bool:bAntiWins

  656.                 new bool:bSwitchTeams

  657.                 new szSound[14]

  658.                 get_msg_arg_string(2, szSound, charsmax(szSound))

  659.                 if( equal(szSound, "%!MRAD_ctwin") )

  660.                 {

  661.                         if( g_iFuriensTeam == CS_TEAM_T )

  662.                         {

  663.                                 if( g_bSwitchTeam )

  664.                                 {

  665.                                         bSwitchTeams = true

  666.                                         g_iFuriensTeam = CS_TEAM_CT

  667.                                 }

  668.                                 bAntiWins = true

  669.                         }

  670.                 }

  671.                 else if( equal(szSound, "%!MRAD_terwin") )

  672.                 {

  673.                         if( g_iFuriensTeam == CS_TEAM_CT )

  674.                         {

  675.                                 if( g_bSwitchTeam )

  676.                                 {

  677.                                         bSwitchTeams = true

  678.                                         g_iFuriensTeam = CS_TEAM_T

  679.                                 }

  680.                                 bAntiWins = true

  681.                         }

  682.                 }

  683.                 else

  684.                 {

  685.                         return

  686.                 }

  687.  

  688.                 if( get_msg_block(g_iTextMsg) == BLOCK_NOT )

  689.                 {

  690.                         set_msg_block(g_iTextMsg, BLOCK_ONCE)

  691.                 }

  692.  

  693.                 new iPlayers[32], iNum, iPlayer

  694.                 get_players(iPlayers, iNum)

  695.                 for(new i; i<iNum; i++)

  696.                 {

  697.                         iPlayer = iPlayers[i]

  698.                         client_print(iPlayer, print_center, "%L", iPlayer, bAntiWins ? "FURIEN_ANTI_WIN_MSG" : "FURIEN_FURIEN_WIN_MSG")

  699.                 }

  700.  

  701.                 if( bAntiWins )

  702.                 {

  703.                         if( g_szAntiWinSound[0] )

  704.                         {

  705.                                 set_msg_arg_string(2, g_szAntiWinSound)

  706.                         }

  707.  

  708.                         if( bSwitchTeams )

  709.                         {

  710.                                 new iRet

  711.                                 ExecuteForward(g_iFurienTeamChangeForward, iRet, g_iFuriensTeam)

  712.                                 g_bSwitchInProgress = true

  713.                                 EnableHamForward( g_iHhTakeDamage )

  714.                         }

  715.                 }

  716.                 else

  717.                 {

  718.                         if( g_szFurienWinSound[0] )

  719.                         {

  720.                                 set_msg_arg_string(2, g_szFurienWinSound)

  721.                         }

  722.                 }              

  723.         }

  724. }

  725.  

  726. public Event_DeathMsg()

  727. {

  728.         new iKiller = read_data(1)

  729.         if( IsPlayer(iKiller) && is_user_connected(iKiller) )

  730.         {

  731.                 new iVictim = read_data(2)

  732.                 if( iVictim != iKiller )

  733.                 {

  734.                         new iVicTimTeam = __get_user_team(iVictim)

  735.                         if( __get_user_team(iKiller) == iVicTimTeam )

  736.                         {

  737.                                 return

  738.                         }

  739.                         g_iNewMoney = clamp

  740.                                                 (

  741.                                                         cs_get_user_money(iKiller) + (iVicTimTeam == Furien ? g_iFurienReward : g_iAntiReward),

  742.                                                         0,

  743.                                                         16000

  744.                                                 )

  745.                         g_iMsgHookMoney = register_message(g_iMoney, "Message_Money")

  746.                 }

  747.         }

  748. }

  749.  

  750. public Message_Money(iMsgId, iMsgDest, id)

  751. {

  752.         unregister_message(g_iMoney, g_iMsgHookMoney)

  753.         cs_set_money_value(id, g_iNewMoney)

  754.         set_msg_arg_int(1, ARG_LONG, g_iNewMoney)

  755. }

  756.  

  757. public A_Propos(id)

  758. {

  759.         if( is_user_connected(id) )

  760.         {

  761.                 client_print(id, print_chat, "%L", id, "FURIEN_CREDIT", FURIEN_VERSION)

  762.                 client_print(id, print_console, "%L", id, "FURIEN_LINK")

  763.         }

  764. }

  765.  

  766. public Player_AddPlayerItem(id , iWeapon)

  767. {

  768.         if(     ExecuteHam(Ham_Item_GetWeaponPtr, iWeapon) != iWeapon

  769.         ||      cs_get_weapon_id(iWeapon) != CSW_C4    

  770.         ||      g_bitBombPlant & __get_user_team(id)    )

  771.         {

  772.                 return HAM_IGNORED

  773.         }

  774.  

  775.         set_pev(iWeapon, pev_flags, pev(iWeapon, pev_flags) | FL_KILLME)

  776.         cs_set_user_plant(id, 0)

  777.         set_pev(id, pev_body, 0)

  778.         SetHamReturnInteger(0)

  779.         return HAM_SUPERCEDE

  780. }

  781.  

  782. public Hostage_Spawn( iHostage )

  783. {

  784.         remove_entity(iHostage)

  785.         return HAM_SUPERCEDE

  786. }

  787.  

  788. public Player_TakeDamage() // switch teams

  789. {

  790.         return HAM_SUPERCEDE

  791. }


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 7 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