hlmod.hu

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



Jelenlévő felhasználók

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

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

Regisztrált felhasználók: Bing [Bot], Majestic-12 [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: csak T legyen Furien
HozzászólásElküldve: 2012.06.02. 13:48 
Offline
Tag

Csatlakozott: 2011.12.21. 16:41
Hozzászólások: 32
Hali ismét :)

én nagyon nem értek ezekhez,de megszeretnék kérni valakit hogy írja át nekem a furien módba az hogy MINDIG CSAK T legyen a furien,mert az első körbe T a furien CT az antifurien aki kap 1 Desertet,de a 2. körbe már megfordul a helyzet és úgy is marad,onnantól végig a CT a furien:S valaki át tudná írni hogy ne váltakozzon? hálásan köszönöm annak aki ebbe fáradozik és annak aki már segített :)


Kód:
  1. */

  2.  

  3. #include <amxmodx>

  4. #include <cstrike>

  5. #include <engine>

  6. #include <fun>

  7. #include <fakemeta>

  8. #include <hamsandwich>

  9.  

  10. #include "furien.inc"

  11.  

  12. #define MAX_PLAYERS 32

  13.  

  14. #define Ham_Player_ResetMaxSpeed Ham_Item_PreFrame

  15.  

  16. new g_iMaxPlayers

  17. #define FIRST_PLAYER_ID 1

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

  19.  

  20. new CsTeams:g_iFuriensTeam = CS_TEAM_T

  21.  

  22. // players offsets

  23. #define XTRA_OFS_PLAYER 5

  24. #define m_iAccount 115

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

  26.  

  27. // "weaponbox" offsets

  28. #define XO_WEAPONBOX                            4

  29. #define m_rgpPlayerItems_wpnbx_Slot5    39

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

  31.  

  32. new g_bShouldAnswerMenu, g_bCanModifyCvars

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

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

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

  36.  

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

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

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

  40.  

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

  42.  

  43. new g_iFurienTeamChangeForward

  44.  

  45. new g_iFurienRoundRestartForward, bool:g_bRestarting

  46.  

  47. new Float:g_flFurienGravity = 0.375

  48. new g_iInvisFactor = 1

  49. new Float:g_flMaxSpeed = 500.0

  50. new g_iFurienReward = 1337

  51. new g_iAntiReward = 400

  52. new g_iAnnounce = 1

  53.  

  54. new bool:g_bSwitchTeam = true

  55. new bool:g_bSwitchInProgress

  56.  

  57. new Trie:g_tPreventEntityKeyvalue

  58. new g_iPickUp = 2

  59.  

  60. new g_szSpeedCommand[128]

  61.  

  62. new g_szFurienWinSound[64]

  63. new g_szAntiWinSound[64]

  64.  

  65. new g_szGameDescription[32]

  66.  

  67. new g_bitBombPlant

  68.  

  69. new g_iNewMoney

  70. new g_iMsgHookMoney

  71.  

  72. new g_iTextMsg, g_iMoney

  73.  

  74. new HamHook:g_iHhTakeDamage

  75.  

  76. public plugin_natives()

  77. {

  78.         register_library("furien")

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

  80. }

  81.  

  82. public plugin_precache()

  83. {

  84.         if( !ReadCfgFile() )

  85.         {

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

  87.         }

  88. }

  89.  

  90. public plugin_init()

  91. {

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

  93.  

  94.         register_dictionary("common.txt")

  95.         register_dictionary("furiens.txt")

  96.  

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

  98.         set_pcvar_string(pCvar, FURIEN_VERSION)

  99.  

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

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

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

  103.  

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

  105.  

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

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

  108.  

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

  110.  

  111.         new iEnt

  112.         iEnt = create_entity("info_target")

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

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

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

  116.  

  117.         iEnt = create_entity("info_target")

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

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

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

  121.  

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

  123.  

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

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

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

  127.  

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

  129.  

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

  131.         {

  132.                 set_cvar_float("sv_maxspeed", g_flMaxSpeed)

  133.         }

  134.  

  135.         formatex(g_szSpeedCommand, charsmax(g_szSpeedCommand),

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

  137.                                                         g_flMaxSpeed, g_flMaxSpeed, g_flMaxSpeed)

  138.  

  139.         g_iMaxPlayers = get_maxplayers()

  140.         g_iTextMsg = get_user_msgid("TextMsg")

  141.         g_iMoney = get_user_msgid("Money")

  142. }

  143.  

  144. ReadCfgFile()

  145. {

  146.         new szConfigFile[128]

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

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

  149.  

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

  151.         if( !fp )

  152.         {

  153.                 return 0

  154.         }

  155.  

  156.         new szDatas[96], szKey[16], szValue[64]

  157.         while( !feof(fp) )

  158.         {

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

  160.                 trim(szDatas)

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

  162.                 {

  163.                         continue

  164.                 }

  165.  

  166.                 parse(szDatas, szKey, charsmax(szKey), szValue, charsmax(szValue))

  167.  

  168.                 switch( szKey[0] )

  169.                 {

  170.                         case 'B':

  171.                         {

  172.                                 switch( szKey[1] )

  173.                                 {

  174.                                         case 'U':

  175.                                         {

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

  177.                                                 {

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

  179.                                                         {

  180.                                                                 case 0:

  181.                                                                 {

  182.                                                                         new iEnt

  183.  

  184.                                                                         g_tPreventEntityKeyvalue = TrieCreate()

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

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

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

  188.  

  189.                                                                         iEnt = create_entity("info_map_parameters")

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

  191.                                                                         DispatchSpawn(iEnt)

  192.  

  193.                                                                         register_buy_cmd()

  194.                                                                 }

  195.                                                         }

  196.                                                 }

  197.                                         }

  198.                                         case 'O':

  199.                                         {

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

  201.                                                 {

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

  203.                                                         if( g_bitBombPlant != 3 )

  204.                                                         {

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

  206.                                                         }

  207.                                                 }

  208.                                         }

  209.                                 }

  210.                         }

  211.                         case 'F':

  212.                         {

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

  214.                                 {

  215.                                         g_iAnnounce = str_to_num(szValue)

  216.                                 }

  217.                         }

  218.                         case 'G':

  219.                         {

  220.                                 switch( szKey[1] )

  221.                                 {

  222.                                         case 'A':

  223.                                         {

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

  225.                                                 {

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

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

  228.                                                         register_forward(FM_GetGameDescription, "GetGameDescription")

  229.                                                 }

  230.                                         }

  231.                                         case 'R':

  232.                                         {

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

  234.                                                 {

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

  236.                                                 }

  237.                                         }

  238.                                 }

  239.                         }

  240.                         case 'I':

  241.                         {

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

  243.                                 {

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

  245.                                 }

  246.                         }

  247.                         case 'K':

  248.                         {

  249.                                 switch( szKey[5] )

  250.                                 {

  251.                                         case 'A':

  252.                                         {

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

  254.                                                 {

  255.                                                         g_iAntiReward = str_to_num(szValue)

  256.                                                 }

  257.                                         }

  258.                                         case 'F':

  259.                                         {

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

  261.                                                 {

  262.                                                         g_iFurienReward = str_to_num(szValue)

  263.                                                 }

  264.                                         }

  265.                                 }

  266.                         }

  267.                         case 'M':

  268.                         {

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

  270.                                 {

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

  272.                                 }

  273.                         }

  274.                         case 'P':

  275.                         {

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

  277.                                 {

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

  279.                                         switch( g_iPickUp )

  280.                                         {

  281.                                                 case 0,1,2:

  282.                                                 {

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

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

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

  286.                                                 }

  287.                                         }

  288.                                 }

  289.                         }

  290.                         case 'S':

  291.                         {

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

  293.                                 {

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

  295.                                         if( g_bSwitchTeam )

  296.                                         {

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

  298.                                                 DisableHamForward( g_iHhTakeDamage )

  299.                                         }

  300.                                 }

  301.                         }

  302.                         case 'W':

  303.                         {

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

  305.                                 {

  306.                                         new szFullPath[128]

  307.                                         switch(szKey[10])

  308.                                         {

  309.                                                 case 'F':

  310.                                                 {

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

  312.                                                         if( file_exists(szFullPath) )

  313.                                                         {

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

  315.                                                                 precache_sound(szValue)

  316.                                                         }

  317.                                                 }

  318.                                                 case 'A':

  319.                                                 {

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

  321.                                                         if( file_exists(szFullPath) )

  322.                                                         {

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

  324.                                                                 precache_sound(szValue)

  325.                                                         }

  326.                                                 }

  327.                                         }

  328.                                 }

  329.                         }

  330.                 }

  331.         }

  332.         fclose( fp )

  333.  

  334.         return 1

  335. }

  336.  

  337. public GetGameDescription()

  338. {

  339.         forward_return(FMV_STRING, g_szGameDescription)

  340.         return FMRES_SUPERCEDE

  341. }

  342.  

  343. public Event_TextMsg_Restart()

  344. {

  345.         g_bRestarting = true

  346. }

  347.  

  348. public Event_HLTV_New_Round()

  349. {

  350.         if( g_bRestarting )

  351.         {

  352.                 g_bRestarting = false

  353.                 new iRet

  354.                 ExecuteForward(g_iFurienRoundRestartForward, iRet)

  355.         }

  356.  

  357.         if( g_bSwitchInProgress )

  358.         {

  359.                 g_bSwitchInProgress = false

  360.                 DisableHamForward( g_iHhTakeDamage )

  361.         }

  362. }

  363.  

  364. public GroundWeapon_Touch(iWeapon, id)

  365. {

  366.         if( IsPlayer(id) )

  367.         {

  368.                 if( !g_iPickUp )

  369.                 {

  370.                         remove_entity(iWeapon)

  371.                         return HAM_SUPERCEDE

  372.                 }

  373.  

  374.                 if( !is_user_alive(id) )

  375.                 {

  376.                         return HAM_SUPERCEDE

  377.                 }

  378.  

  379.                 new iTeam = __get_user_team(id)

  380.                 if(     ( iTeam == -1 )

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

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

  383.                 {

  384.                         return HAM_SUPERCEDE

  385.                 }

  386.         }

  387.         return HAM_IGNORED

  388. }

  389.  

  390. public CWeaponBox_Touch(iWeaponBox, id)

  391. {

  392.         if( IsPlayer(id) )

  393.         {

  394.                 if( !is_user_alive(id) )

  395.                 {

  396.                         return HAM_SUPERCEDE

  397.                 }

  398.  

  399.                 if( IsWeaponBoxC4(iWeaponBox) )

  400.                 {

  401.                         return HAM_IGNORED

  402.                 }

  403.  

  404.                 if( !g_iPickUp )

  405.                 {

  406.                         remove_entity(iWeaponBox)

  407.                         return HAM_SUPERCEDE

  408.                 }

  409.  

  410.                 new iTeam = __get_user_team(id)

  411.                 if(     ( iTeam == -1 )

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

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

  414.                 {

  415.                         return HAM_SUPERCEDE

  416.                 }

  417.         }

  418.         return HAM_IGNORED

  419. }

  420.  

  421. register_buy_cmd()

  422. {

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

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

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

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

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

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

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

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

  431. }

  432.  

  433. public ClientCommand_Buy(id)

  434. {

  435.         return PLUGIN_HANDLED_MAIN

  436. }

  437.  

  438. public pfn_keyvalue( iEnt )

  439. {

  440.         if( g_tPreventEntityKeyvalue )

  441.         {

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

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

  444.                 if( TrieKeyExists(g_tPreventEntityKeyvalue, szClassName) )

  445.                 {

  446.                         remove_entity(iEnt)

  447.                         return PLUGIN_HANDLED

  448.                 }

  449.         }

  450.         return PLUGIN_CONTINUE

  451. }

  452.  

  453. public plugin_cfg()

  454. {

  455.         if( g_tPreventEntityKeyvalue )

  456.         {

  457.                 TrieDestroy(g_tPreventEntityKeyvalue)

  458.                 set_cvar_float("sv_restart", 1.0)

  459.         }

  460. }

  461.  

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

  463. {

  464.         return __get_user_team( get_param(1) )

  465. }

  466.  

  467. __get_user_team(id)

  468. {

  469.         new CsTeams:iTeam = cs_get_user_team(id)

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

  471.         {

  472.                 if( iTeam == g_iFuriensTeam )

  473.                 {

  474.                         return Furien

  475.                 }

  476.                 return AntiFurien

  477.         }

  478.         return -1

  479. }

  480.  

  481. public client_connect(id)

  482. {


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

  484. }

  485.  

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

  487. {

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

  489.         {

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

  491.         }

  492. }

  493.  

  494. public client_putinserver( id )

  495. {

  496.         MarkUserSeeMenu( id )

  497.         ClearUserCvars( id )

  498.  

  499.         if( g_iAnnounce )

  500.         {

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

  502.         }

  503. }

  504.  

  505. public Player_Spawn_Post( id )

  506. {

  507.         if( is_user_alive(id) )

  508.         {

  509.                 if( ShouldUserSeeMenu(id) )

  510.                 {

  511.                         ShowSpeedCvarsMenu(id)

  512.                 }

  513.  

  514.                 strip_user_weapons(id)

  515.  

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

  517.                 {

  518.                         set_user_gravity(id, g_flFurienGravity)

  519.                         set_user_footsteps(id, 1)

  520.                 }

  521.                 else

  522.                 {

  523.                         set_user_footsteps(id, 0)

  524.                         set_user_gravity(id, 1.0)

  525.                 }

  526.  

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

  528.         }

  529. }

  530.  

  531. ShowSpeedCvarsMenu(id)

  532. {

  533.         new szMenu[256], n

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

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

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

  537.  

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

  539. }

  540.  

  541. public CvarsMenuCallBack(id, iKey)

  542. {

  543.         switch( iKey )

  544.         {

  545.                 case 0:

  546.                 {

  547.                         MarkUserCvars( id )

  548.                         ClearUserSeeMenu( id )

  549.                 }

  550.                 case 1:

  551.                 {

  552.                         ClearUserCvars( id )

  553.                 }

  554.         }

  555.         return PLUGIN_HANDLED

  556. }

  557.  

  558. public Player_ResetMaxSpeed( id )

  559. {

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

  561.         {

  562.                 set_pev(id, pev_maxspeed, g_flMaxSpeed)

  563.         }

  564. }

  565.  

  566. public Check_Players_Cvars( iEnt )

  567. {

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

  569.  

  570.         new iPlayers[MAX_PLAYERS], iNum, id

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

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

  573.         {

  574.                 id = iPlayers[i]

  575.                 if( CanUserCvars( id ) )

  576.                 {

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

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

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

  580.                 }

  581.         }

  582. }

  583.  

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

  585. {

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

  587.         {

  588.                 client_cmd(id, g_szSpeedCommand)

  589.         }

  590. }

  591.  

  592. public Set_Furiens_Visibility( iEnt )

  593. {

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

  595.  

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

  597.  

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

  599.  

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

  601.         {

  602.                 id = iPlayers[i]

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

  604.                 {

  605.                         entity_get_vector(id, EV_VEC_velocity, fVecVelocity)

  606.                         iSpeed = floatround( vector_length(fVecVelocity) )

  607.                         if( iSpeed < g_iInvisFactor*255 )

  608.                         {

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

  610.                         }

  611.                         else

  612.                         {

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

  614.                         }

  615.                 }

  616.                 else

  617.                 {

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

  619.                 }

  620.         }

  621. }

  622.  

  623. public Message_SendAudio(iMsgId, iMsgDest, id)

  624. {

  625.         if( !id )

  626.         {

  627.                 new bool:bAntiWins

  628.                 new bool:bSwitchTeams

  629.                 new szSound[14]

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

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

  632.                 {

  633.                         if( g_iFuriensTeam == CS_TEAM_T )

  634.                         {

  635.                                 if( g_bSwitchTeam )

  636.                                 {

  637.                                         bSwitchTeams = true

  638.                                         g_iFuriensTeam = CS_TEAM_CT

  639.                                 }

  640.                                 bAntiWins = true

  641.                         }

  642.                 }

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

  644.                 {

  645.                         if( g_iFuriensTeam == CS_TEAM_CT )

  646.                         {

  647.                                 if( g_bSwitchTeam )

  648.                                 {

  649.                                         bSwitchTeams = true

  650.                                         g_iFuriensTeam = CS_TEAM_T

  651.                                 }

  652.                                 bAntiWins = true

  653.                         }

  654.                 }

  655.                 else

  656.                 {

  657.                         return

  658.                 }

  659.  

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

  661.                 {

  662.                         set_msg_block(g_iTextMsg, BLOCK_ONCE)

  663.                 }

  664.  

  665.                 new iPlayers[32], iNum, iPlayer

  666.                 get_players(iPlayers, iNum)

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

  668.                 {

  669.                         iPlayer = iPlayers[i]

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

  671.                 }

  672.  

  673.                 if( bAntiWins )

  674.                 {

  675.                         if( g_szAntiWinSound[0] )

  676.                         {

  677.                                 set_msg_arg_string(2, g_szAntiWinSound)

  678.                         }

  679.  

  680.                         if( bSwitchTeams )

  681.                         {

  682.                                 new iRet

  683.                                 ExecuteForward(g_iFurienTeamChangeForward, iRet, g_iFuriensTeam)

  684.                                 g_bSwitchInProgress = true

  685.                                 EnableHamForward( g_iHhTakeDamage )

  686.                         }

  687.                 }

  688.                 else

  689.                 {

  690.                         if( g_szFurienWinSound[0] )

  691.                         {

  692.                                 set_msg_arg_string(2, g_szFurienWinSound)

  693.                         }

  694.                 }              

  695.         }

  696. }

  697.  

  698. public Event_DeathMsg()

  699. {

  700.         new iKiller = read_data(1)

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

  702.         {

  703.                 new iVictim = read_data(2)

  704.                 if( iVictim != iKiller )

  705.                 {

  706.                         new iVicTimTeam = __get_user_team(iVictim)

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

  708.                         {

  709.                                 return

  710.                         }

  711.                         g_iNewMoney = clamp

  712.                                                 (

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

  714.                                                         0,

  715.                                                         16000

  716.                                                 )

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

  718.                 }

  719.         }

  720. }

  721.  

  722. public Message_Money(iMsgId, iMsgDest, id)

  723. {

  724.         unregister_message(g_iMoney, g_iMsgHookMoney)

  725.         cs_set_money_value(id, g_iNewMoney)

  726.         set_msg_arg_int(1, ARG_LONG, g_iNewMoney)

  727. }

  728.  

  729. public A_Propos(id)

  730. {

  731.         if( is_user_connected(id) )

  732.         {

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

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

  735.         }

  736. }

  737.  

  738. public Player_AddPlayerItem(id , iWeapon)

  739. {

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

  741.         ||      cs_get_weapon_id(iWeapon) != CSW_C4    

  742.         ||      g_bitBombPlant & __get_user_team(id)    )

  743.         {

  744.                 return HAM_IGNORED

  745.         }

  746.  

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

  748.         cs_set_user_plant(id, 0)

  749.         set_pev(id, pev_body, 0)

  750.         SetHamReturnInteger(0)

  751.         return HAM_SUPERCEDE

  752. }

  753.  

  754. public Player_TakeDamage() // switch teams

  755. {

  756.         return HAM_SUPERCEDE

  757. }


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: csak T legyen Furien
HozzászólásElküldve: 2012.06.02. 14:15 
Offline
Tiszteletbeli

Csatlakozott: 2010.02.04. 19:12
Hozzászólások: 3528
Megköszönt másnak: 26 alkalommal
Megköszönték neki: 180 alkalommal
Idézet:
*/

ez mi akar lenni az elején? vagy az infókat nem másoltad be, és a vége bennmaradt?

_________________
http://www.ebateam.eu/


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: csak T legyen Furien
HozzászólásElküldve: 2012.06.02. 14:23 
Offline
Tag

Csatlakozott: 2011.12.21. 16:41
Hozzászólások: 32
itt az egész,nem értek hozzá mint ahogy már mondtam ,így véletlen ott maradt
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[16], 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.                 parse(szDatas, szKey, charsmax(szKey), szValue, charsmax(szValue))

  182.  

  183.                 switch( szKey[0] )

  184.                 {

  185.                         case 'B':

  186.                         {

  187.                                 switch( szKey[1] )

  188.                                 {

  189.                                         case 'U':

  190.                                         {

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

  192.                                                 {

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

  194.                                                         {

  195.                                                                 case 0:

  196.                                                                 {

  197.                                                                         new iEnt

  198.  

  199.                                                                         g_tPreventEntityKeyvalue = TrieCreate()

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

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

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

  203.  

  204.                                                                         iEnt = create_entity("info_map_parameters")

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

  206.                                                                         DispatchSpawn(iEnt)

  207.  

  208.                                                                         register_buy_cmd()

  209.                                                                 }

  210.                                                         }

  211.                                                 }

  212.                                         }

  213.                                         case 'O':

  214.                                         {

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

  216.                                                 {

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

  218.                                                         if( g_bitBombPlant != 3 )

  219.                                                         {

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

  221.                                                         }

  222.                                                 }

  223.                                         }

  224.                                 }

  225.                         }

  226.                         case 'F':

  227.                         {

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

  229.                                 {

  230.                                         g_iAnnounce = str_to_num(szValue)

  231.                                 }

  232.                         }

  233.                         case 'G':

  234.                         {

  235.                                 switch( szKey[1] )

  236.                                 {

  237.                                         case 'A':

  238.                                         {

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

  240.                                                 {

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

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

  243.                                                         register_forward(FM_GetGameDescription, "GetGameDescription")

  244.                                                 }

  245.                                         }

  246.                                         case 'R':

  247.                                         {

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

  249.                                                 {

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

  251.                                                 }

  252.                                         }

  253.                                 }

  254.                         }

  255.                         case 'I':

  256.                         {

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

  258.                                 {

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

  260.                                 }

  261.                         }

  262.                         case 'K':

  263.                         {

  264.                                 switch( szKey[5] )

  265.                                 {

  266.                                         case 'A':

  267.                                         {

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

  269.                                                 {

  270.                                                         g_iAntiReward = str_to_num(szValue)

  271.                                                 }

  272.                                         }

  273.                                         case 'F':

  274.                                         {

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

  276.                                                 {

  277.                                                         g_iFurienReward = str_to_num(szValue)

  278.                                                 }

  279.                                         }

  280.                                 }

  281.                         }

  282.                         case 'M':

  283.                         {

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

  285.                                 {

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

  287.                                 }

  288.                         }

  289.                         case 'P':

  290.                         {

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

  292.                                 {

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

  294.                                         switch( g_iPickUp )

  295.                                         {

  296.                                                 case 0,1,2:

  297.                                                 {

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

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

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

  301.                                                 }

  302.                                         }

  303.                                 }

  304.                         }

  305.                         case 'S':

  306.                         {

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

  308.                                 {

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

  310.                                         if( g_bSwitchTeam )

  311.                                         {

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

  313.                                                 DisableHamForward( g_iHhTakeDamage )

  314.                                         }

  315.                                 }

  316.                         }

  317.                         case 'W':

  318.                         {

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

  320.                                 {

  321.                                         new szFullPath[128]

  322.                                         switch(szKey[10])

  323.                                         {

  324.                                                 case 'F':

  325.                                                 {

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

  327.                                                         if( file_exists(szFullPath) )

  328.                                                         {

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

  330.                                                                 precache_sound(szValue)

  331.                                                         }

  332.                                                 }

  333.                                                 case 'A':

  334.                                                 {

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

  336.                                                         if( file_exists(szFullPath) )

  337.                                                         {

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

  339.                                                                 precache_sound(szValue)

  340.                                                         }

  341.                                                 }

  342.                                         }

  343.                                 }

  344.                         }

  345.                 }

  346.         }

  347.         fclose( fp )

  348.  

  349.         return 1

  350. }

  351.  

  352. public GetGameDescription()

  353. {

  354.         forward_return(FMV_STRING, g_szGameDescription)

  355.         return FMRES_SUPERCEDE

  356. }

  357.  

  358. public Event_TextMsg_Restart()

  359. {

  360.         g_bRestarting = true

  361. }

  362.  

  363. public Event_HLTV_New_Round()

  364. {

  365.         if( g_bRestarting )

  366.         {

  367.                 g_bRestarting = false

  368.                 new iRet

  369.                 ExecuteForward(g_iFurienRoundRestartForward, iRet)

  370.         }

  371.  

  372.         if( g_bSwitchInProgress )

  373.         {

  374.                 g_bSwitchInProgress = false

  375.                 DisableHamForward( g_iHhTakeDamage )

  376.         }

  377. }

  378.  

  379. public GroundWeapon_Touch(iWeapon, id)

  380. {

  381.         if( IsPlayer(id) )

  382.         {

  383.                 if( !g_iPickUp )

  384.                 {

  385.                         remove_entity(iWeapon)

  386.                         return HAM_SUPERCEDE

  387.                 }

  388.  

  389.                 if( !is_user_alive(id) )

  390.                 {

  391.                         return HAM_SUPERCEDE

  392.                 }

  393.  

  394.                 new iTeam = __get_user_team(id)

  395.                 if(     ( iTeam == -1 )

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

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

  398.                 {

  399.                         return HAM_SUPERCEDE

  400.                 }

  401.         }

  402.         return HAM_IGNORED

  403. }

  404.  

  405. public CWeaponBox_Touch(iWeaponBox, id)

  406. {

  407.         if( IsPlayer(id) )

  408.         {

  409.                 if( !is_user_alive(id) )

  410.                 {

  411.                         return HAM_SUPERCEDE

  412.                 }

  413.  

  414.                 if( IsWeaponBoxC4(iWeaponBox) )

  415.                 {

  416.                         return HAM_IGNORED

  417.                 }

  418.  

  419.                 if( !g_iPickUp )

  420.                 {

  421.                         remove_entity(iWeaponBox)

  422.                         return HAM_SUPERCEDE

  423.                 }

  424.  

  425.                 new iTeam = __get_user_team(id)

  426.                 if(     ( iTeam == -1 )

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

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

  429.                 {

  430.                         return HAM_SUPERCEDE

  431.                 }

  432.         }

  433.         return HAM_IGNORED

  434. }

  435.  

  436. register_buy_cmd()

  437. {

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

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

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

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

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

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

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

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

  446. }

  447.  

  448. public ClientCommand_Buy(id)

  449. {

  450.         return PLUGIN_HANDLED_MAIN

  451. }

  452.  

  453. public pfn_keyvalue( iEnt )

  454. {

  455.         if( g_tPreventEntityKeyvalue )

  456.         {

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

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

  459.                 if( TrieKeyExists(g_tPreventEntityKeyvalue, szClassName) )

  460.                 {

  461.                         remove_entity(iEnt)

  462.                         return PLUGIN_HANDLED

  463.                 }

  464.         }

  465.         return PLUGIN_CONTINUE

  466. }

  467.  

  468. public plugin_cfg()

  469. {

  470.         if( g_tPreventEntityKeyvalue )

  471.         {

  472.                 TrieDestroy(g_tPreventEntityKeyvalue)

  473.                 set_cvar_float("sv_restart", 1.0)

  474.         }

  475. }

  476.  

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

  478. {

  479.         return __get_user_team( get_param(1) )

  480. }

  481.  

  482. __get_user_team(id)

  483. {

  484.         new CsTeams:iTeam = cs_get_user_team(id)

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

  486.         {

  487.                 if( iTeam == g_iFuriensTeam )

  488.                 {

  489.                         return Furien

  490.                 }

  491.                 return AntiFurien

  492.         }

  493.         return -1

  494. }

  495.  

  496. public client_connect(id)

  497. {


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

  499. }

  500.  

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

  502. {

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

  504.         {

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

  506.         }

  507. }

  508.  

  509. public client_putinserver( id )

  510. {

  511.         MarkUserSeeMenu( id )

  512.         ClearUserCvars( id )

  513.  

  514.         if( g_iAnnounce )

  515.         {

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

  517.         }

  518. }

  519.  

  520. public Player_Spawn_Post( id )

  521. {

  522.         if( is_user_alive(id) )

  523.         {

  524.                 if( ShouldUserSeeMenu(id) )

  525.                 {

  526.                         ShowSpeedCvarsMenu(id)

  527.                 }

  528.  

  529.                 strip_user_weapons(id)

  530.  

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

  532.                 {

  533.                         set_user_gravity(id, g_flFurienGravity)

  534.                         set_user_footsteps(id, 1)

  535.                 }

  536.                 else

  537.                 {

  538.                         set_user_footsteps(id, 0)

  539.                         set_user_gravity(id, 1.0)

  540.                 }

  541.  

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

  543.         }

  544. }

  545.  

  546. ShowSpeedCvarsMenu(id)

  547. {

  548.         new szMenu[256], n

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

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

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

  552.  

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

  554. }

  555.  

  556. public CvarsMenuCallBack(id, iKey)

  557. {

  558.         switch( iKey )

  559.         {

  560.                 case 0:

  561.                 {

  562.                         MarkUserCvars( id )

  563.                         ClearUserSeeMenu( id )

  564.                 }

  565.                 case 1:

  566.                 {

  567.                         ClearUserCvars( id )

  568.                 }

  569.         }

  570.         return PLUGIN_HANDLED

  571. }

  572.  

  573. public Player_ResetMaxSpeed( id )

  574. {

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

  576.         {

  577.                 set_pev(id, pev_maxspeed, g_flMaxSpeed)

  578.         }

  579. }

  580.  

  581. public Check_Players_Cvars( iEnt )

  582. {

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

  584.  

  585.         new iPlayers[MAX_PLAYERS], iNum, id

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

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

  588.         {

  589.                 id = iPlayers[i]

  590.                 if( CanUserCvars( id ) )

  591.                 {

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

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

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

  595.                 }

  596.         }

  597. }

  598.  

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

  600. {

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

  602.         {

  603.                 client_cmd(id, g_szSpeedCommand)

  604.         }

  605. }

  606.  

  607. public Set_Furiens_Visibility( iEnt )

  608. {

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

  610.  

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

  612.  

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

  614.  

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

  616.         {

  617.                 id = iPlayers[i]

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

  619.                 {

  620.                         entity_get_vector(id, EV_VEC_velocity, fVecVelocity)

  621.                         iSpeed = floatround( vector_length(fVecVelocity) )

  622.                         if( iSpeed < g_iInvisFactor*255 )

  623.                         {

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

  625.                         }

  626.                         else

  627.                         {

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

  629.                         }

  630.                 }

  631.                 else

  632.                 {

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

  634.                 }

  635.         }

  636. }

  637.  

  638. public Message_SendAudio(iMsgId, iMsgDest, id)

  639. {

  640.         if( !id )

  641.         {

  642.                 new bool:bAntiWins

  643.                 new bool:bSwitchTeams

  644.                 new szSound[14]

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

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

  647.                 {

  648.                         if( g_iFuriensTeam == CS_TEAM_T )

  649.                         {

  650.                                 if( g_bSwitchTeam )

  651.                                 {

  652.                                         bSwitchTeams = true

  653.                                         g_iFuriensTeam = CS_TEAM_CT

  654.                                 }

  655.                                 bAntiWins = true

  656.                         }

  657.                 }

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

  659.                 {

  660.                         if( g_iFuriensTeam == CS_TEAM_CT )

  661.                         {

  662.                                 if( g_bSwitchTeam )

  663.                                 {

  664.                                         bSwitchTeams = true

  665.                                         g_iFuriensTeam = CS_TEAM_T

  666.                                 }

  667.                                 bAntiWins = true

  668.                         }

  669.                 }

  670.                 else

  671.                 {

  672.                         return

  673.                 }

  674.  

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

  676.                 {

  677.                         set_msg_block(g_iTextMsg, BLOCK_ONCE)

  678.                 }

  679.  

  680.                 new iPlayers[32], iNum, iPlayer

  681.                 get_players(iPlayers, iNum)

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

  683.                 {

  684.                         iPlayer = iPlayers[i]

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

  686.                 }

  687.  

  688.                 if( bAntiWins )

  689.                 {

  690.                         if( g_szAntiWinSound[0] )

  691.                         {

  692.                                 set_msg_arg_string(2, g_szAntiWinSound)

  693.                         }

  694.  

  695.                         if( bSwitchTeams )

  696.                         {

  697.                                 new iRet

  698.                                 ExecuteForward(g_iFurienTeamChangeForward, iRet, g_iFuriensTeam)

  699.                                 g_bSwitchInProgress = true

  700.                                 EnableHamForward( g_iHhTakeDamage )

  701.                         }

  702.                 }

  703.                 else

  704.                 {

  705.                         if( g_szFurienWinSound[0] )

  706.                         {

  707.                                 set_msg_arg_string(2, g_szFurienWinSound)

  708.                         }

  709.                 }              

  710.         }

  711. }

  712.  

  713. public Event_DeathMsg()

  714. {

  715.         new iKiller = read_data(1)

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

  717.         {

  718.                 new iVictim = read_data(2)

  719.                 if( iVictim != iKiller )

  720.                 {

  721.                         new iVicTimTeam = __get_user_team(iVictim)

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

  723.                         {

  724.                                 return

  725.                         }

  726.                         g_iNewMoney = clamp

  727.                                                 (

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

  729.                                                         0,

  730.                                                         16000

  731.                                                 )

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

  733.                 }

  734.         }

  735. }

  736.  

  737. public Message_Money(iMsgId, iMsgDest, id)

  738. {

  739.         unregister_message(g_iMoney, g_iMsgHookMoney)

  740.         cs_set_money_value(id, g_iNewMoney)

  741.         set_msg_arg_int(1, ARG_LONG, g_iNewMoney)

  742. }

  743.  

  744. public A_Propos(id)

  745. {

  746.         if( is_user_connected(id) )

  747.         {

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

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

  750.         }

  751. }

  752.  

  753. public Player_AddPlayerItem(id , iWeapon)

  754. {

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

  756.         ||      cs_get_weapon_id(iWeapon) != CSW_C4    

  757.         ||      g_bitBombPlant & __get_user_team(id)    )

  758.         {

  759.                 return HAM_IGNORED

  760.         }

  761.  

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

  763.         cs_set_user_plant(id, 0)

  764.         set_pev(id, pev_body, 0)

  765.         SetHamReturnInteger(0)

  766.         return HAM_SUPERCEDE

  767. }

  768.  

  769. public Player_TakeDamage() // switch teams

  770. {

  771.         return HAM_SUPERCEDE

  772. }


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