hlmod.hu

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



Jelenlévő felhasználók

Jelenleg 378 felhasználó van jelen :: 2 regisztrált, 0 rejtett és 376 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 A témát lezárták, nem szerkesztheted a hozzászólásaid, és nem küldhetsz új hozzászólást.  [14 hozzászólás ]  Oldal12Következő
Szerző Üzenet
 Hozzászólás témája: Complilálás
HozzászólásElküldve:2012.07.19. 21:25 
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
Helló!

Ezt valaki le tudja compilálni?
Detector azt mondta hogy neki nem dob errort. Remélem tudtok segíteni.

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.  

  497.  

  498. public client_putinserver( id )

  499. {

  500.         MarkUserSeeMenu( id )

  501.         ClearUserCvars( id )

  502.  

  503.         if( g_iAnnounce )

  504.         {

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

  506.         }

  507. }

  508.  

  509. public Player_Spawn_Post( id )

  510. {

  511.         if( is_user_alive(id) )

  512.         {

  513.                 if( ShouldUserSeeMenu(id) )

  514.                 {

  515.                         ShowSpeedCvarsMenu(id)

  516.                 }

  517.  

  518.                 strip_user_weapons(id)

  519.  

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

  521.                 {

  522.                         set_user_gravity(id, g_flFurienGravity)

  523.                         set_user_footsteps(id, 1)

  524.                 }

  525.                 else

  526.                 {

  527.                         set_user_footsteps(id, 0)

  528.                         set_user_gravity(id, 1.0)

  529.                 }

  530.  

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

  532.         }

  533. }

  534.  

  535. ShowSpeedCvarsMenu(id)

  536. {

  537.         new szMenu[256], n

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

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

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

  541.  

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

  543. }

  544.  

  545. public CvarsMenuCallBack(id, iKey)

  546. {

  547.         switch( iKey )

  548.         {

  549.                 case 0:

  550.                 {

  551.                         MarkUserCvars( id )

  552.                         ClearUserSeeMenu( id )

  553.                 }

  554.                 case 1:

  555.                 {

  556.                         ClearUserCvars( id )

  557.                 }

  558.         }

  559.         return PLUGIN_HANDLED

  560. }

  561.  

  562. public Player_ResetMaxSpeed( id )

  563. {

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

  565.         {

  566.                 set_pev(id, pev_maxspeed, g_flMaxSpeed)

  567.         }

  568. }

  569.  

  570. public Check_Players_Cvars( iEnt )

  571. {

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

  573.  

  574.         new iPlayers[MAX_PLAYERS], iNum, id

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

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

  577.         {

  578.                 id = iPlayers[i]

  579.                 if( CanUserCvars( id ) )

  580.                 {

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

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

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

  584.                 }

  585.         }

  586. }

  587.  

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

  589. {

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

  591.         {

  592.                 client_cmd(id, g_szSpeedCommand)

  593.         }

  594. }

  595.  

  596. public Set_Furiens_Visibility( iEnt )

  597. {

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

  599.  

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

  601.  

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

  603.  

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

  605.         {

  606.                 id = iPlayers[i]

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

  608.                 {

  609.                         entity_get_vector(id, EV_VEC_velocity, fVecVelocity)

  610.                         iSpeed = floatround( vector_length(fVecVelocity) )

  611.                         if( iSpeed < g_iInvisFactor*255 )

  612.                         {

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

  614.                         }

  615.                         else

  616.                         {

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

  618.                         }

  619.                 }

  620.                 else

  621.                 {

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

  623.                 }

  624.         }

  625. }

  626.  

  627. public Message_SendAudio(iMsgId, iMsgDest, id)

  628. {

  629.         if( !id )

  630.         {

  631.                 new bool:bAntiWins

  632.                 new bool:bSwitchTeams

  633.                 new szSound[14]

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

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

  636.                 {

  637.                         if( g_iFuriensTeam == CS_TEAM_T )

  638.                         {

  639.                                 if( g_bSwitchTeam )

  640.                                 {

  641.                                         bSwitchTeams = true

  642.                                         g_iFuriensTeam = CS_TEAM_CT

  643.                                 }

  644.                                 bAntiWins = true

  645.                         }

  646.                 }

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

  648.                 {

  649.                         if( g_iFuriensTeam == CS_TEAM_CT )

  650.                         {

  651.                                 if( g_bSwitchTeam )

  652.                                 {

  653.                                         bSwitchTeams = true

  654.                                         g_iFuriensTeam = CS_TEAM_T

  655.                                 }

  656.                                 bAntiWins = true

  657.                         }

  658.                 }

  659.                 else

  660.                 {

  661.                         return

  662.                 }

  663.  

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

  665.                 {

  666.                         set_msg_block(g_iTextMsg, BLOCK_ONCE)

  667.                 }

  668.  

  669.                 new iPlayers[32], iNum, iPlayer

  670.                 get_players(iPlayers, iNum)

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

  672.                 {

  673.                         iPlayer = iPlayers[i]

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

  675.                 }

  676.  

  677.                 if( bAntiWins )

  678.                 {

  679.                         if( g_szAntiWinSound[0] )

  680.                         {

  681.                                 set_msg_arg_string(2, g_szAntiWinSound)

  682.                         }

  683.  

  684.                         if( bSwitchTeams )

  685.                         {

  686.                                 new iRet

  687.                                 ExecuteForward(g_iFurienTeamChangeForward, iRet, g_iFuriensTeam)

  688.                                 g_bSwitchInProgress = true

  689.                                 EnableHamForward( g_iHhTakeDamage )

  690.                         }

  691.                 }

  692.                 else

  693.                 {

  694.                         if( g_szFurienWinSound[0] )

  695.                         {

  696.                                 set_msg_arg_string(2, g_szFurienWinSound)

  697.                         }

  698.                 }              

  699.         }

  700. }

  701.  

  702. public Event_DeathMsg()

  703. {

  704.         new iKiller = read_data(1)

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

  706.         {

  707.                 new iVictim = read_data(2)

  708.                 if( iVictim != iKiller )

  709.                 {

  710.                         new iVicTimTeam = __get_user_team(iVictim)

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

  712.                         {

  713.                                 return

  714.                         }

  715.                         g_iNewMoney = clamp

  716.                                                 (

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

  718.                                                         0,

  719.                                                         16000

  720.                                                 )

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

  722.                 }

  723.         }

  724. }

  725.  

  726. public Message_Money(iMsgId, iMsgDest, id)

  727. {

  728.         unregister_message(g_iMoney, g_iMsgHookMoney)

  729.         cs_set_money_value(id, g_iNewMoney)

  730.         set_msg_arg_int(1, ARG_LONG, g_iNewMoney)

  731. }

  732.  

  733. public A_Propos(id)

  734. {

  735.         if( is_user_connected(id) )

  736.         {

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

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

  739.         }

  740. }

  741.  

  742. public Player_AddPlayerItem(id , iWeapon)

  743. {

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

  745.         ||      cs_get_weapon_id(iWeapon) != CSW_C4    

  746.         ||      g_bitBombPlant & __get_user_team(id)    )

  747.         {

  748.                 return HAM_IGNORED

  749.         }

  750.  

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

  752.         cs_set_user_plant(id, 0)

  753.         set_pev(id, pev_body, 0)

  754.         SetHamReturnInteger(0)

  755.         return HAM_SUPERCEDE

  756. }

  757.  

  758. public Player_TakeDamage() // switch teams

  759. {

  760.         return HAM_SUPERCEDE

  761. }

  762.  


INC:
http://data.hu/get/5360514/furien.inc

Kösznöm aki megcsinálja!


Hozzászólás jelentése
Vissza a tetejére
   
 
 Hozzászólás témája: Re: Complilálás
HozzászólásElküldve:2012.07.19. 22:22 
Offline
Tiszteletbeli
Avatar

Csatlakozott:2011.09.18. 13:01
Hozzászólások:4274
Megköszönt másnak: 55 alkalommal
Megköszönték neki: 515 alkalommal
Bence98007 írta:
Helló!

Ezt valaki le tudja compilálni?
Detector azt mondta hogy neki nem dob errort. Remélem tudtok segíteni.

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.  

  497.  

  498. public client_putinserver( id )

  499. {

  500.         MarkUserSeeMenu( id )

  501.         ClearUserCvars( id )

  502.  

  503.         if( g_iAnnounce )

  504.         {

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

  506.         }

  507. }

  508.  

  509. public Player_Spawn_Post( id )

  510. {

  511.         if( is_user_alive(id) )

  512.         {

  513.                 if( ShouldUserSeeMenu(id) )

  514.                 {

  515.                         ShowSpeedCvarsMenu(id)

  516.                 }

  517.  

  518.                 strip_user_weapons(id)

  519.  

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

  521.                 {

  522.                         set_user_gravity(id, g_flFurienGravity)

  523.                         set_user_footsteps(id, 1)

  524.                 }

  525.                 else

  526.                 {

  527.                         set_user_footsteps(id, 0)

  528.                         set_user_gravity(id, 1.0)

  529.                 }

  530.  

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

  532.         }

  533. }

  534.  

  535. ShowSpeedCvarsMenu(id)

  536. {

  537.         new szMenu[256], n

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

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

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

  541.  

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

  543. }

  544.  

  545. public CvarsMenuCallBack(id, iKey)

  546. {

  547.         switch( iKey )

  548.         {

  549.                 case 0:

  550.                 {

  551.                         MarkUserCvars( id )

  552.                         ClearUserSeeMenu( id )

  553.                 }

  554.                 case 1:

  555.                 {

  556.                         ClearUserCvars( id )

  557.                 }

  558.         }

  559.         return PLUGIN_HANDLED

  560. }

  561.  

  562. public Player_ResetMaxSpeed( id )

  563. {

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

  565.         {

  566.                 set_pev(id, pev_maxspeed, g_flMaxSpeed)

  567.         }

  568. }

  569.  

  570. public Check_Players_Cvars( iEnt )

  571. {

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

  573.  

  574.         new iPlayers[MAX_PLAYERS], iNum, id

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

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

  577.         {

  578.                 id = iPlayers[i]

  579.                 if( CanUserCvars( id ) )

  580.                 {

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

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

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

  584.                 }

  585.         }

  586. }

  587.  

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

  589. {

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

  591.         {

  592.                 client_cmd(id, g_szSpeedCommand)

  593.         }

  594. }

  595.  

  596. public Set_Furiens_Visibility( iEnt )

  597. {

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

  599.  

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

  601.  

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

  603.  

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

  605.         {

  606.                 id = iPlayers[i]

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

  608.                 {

  609.                         entity_get_vector(id, EV_VEC_velocity, fVecVelocity)

  610.                         iSpeed = floatround( vector_length(fVecVelocity) )

  611.                         if( iSpeed < g_iInvisFactor*255 )

  612.                         {

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

  614.                         }

  615.                         else

  616.                         {

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

  618.                         }

  619.                 }

  620.                 else

  621.                 {

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

  623.                 }

  624.         }

  625. }

  626.  

  627. public Message_SendAudio(iMsgId, iMsgDest, id)

  628. {

  629.         if( !id )

  630.         {

  631.                 new bool:bAntiWins

  632.                 new bool:bSwitchTeams

  633.                 new szSound[14]

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

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

  636.                 {

  637.                         if( g_iFuriensTeam == CS_TEAM_T )

  638.                         {

  639.                                 if( g_bSwitchTeam )

  640.                                 {

  641.                                         bSwitchTeams = true

  642.                                         g_iFuriensTeam = CS_TEAM_CT

  643.                                 }

  644.                                 bAntiWins = true

  645.                         }

  646.                 }

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

  648.                 {

  649.                         if( g_iFuriensTeam == CS_TEAM_CT )

  650.                         {

  651.                                 if( g_bSwitchTeam )

  652.                                 {

  653.                                         bSwitchTeams = true

  654.                                         g_iFuriensTeam = CS_TEAM_T

  655.                                 }

  656.                                 bAntiWins = true

  657.                         }

  658.                 }

  659.                 else

  660.                 {

  661.                         return

  662.                 }

  663.  

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

  665.                 {

  666.                         set_msg_block(g_iTextMsg, BLOCK_ONCE)

  667.                 }

  668.  

  669.                 new iPlayers[32], iNum, iPlayer

  670.                 get_players(iPlayers, iNum)

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

  672.                 {

  673.                         iPlayer = iPlayers[i]

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

  675.                 }

  676.  

  677.                 if( bAntiWins )

  678.                 {

  679.                         if( g_szAntiWinSound[0] )

  680.                         {

  681.                                 set_msg_arg_string(2, g_szAntiWinSound)

  682.                         }

  683.  

  684.                         if( bSwitchTeams )

  685.                         {

  686.                                 new iRet

  687.                                 ExecuteForward(g_iFurienTeamChangeForward, iRet, g_iFuriensTeam)

  688.                                 g_bSwitchInProgress = true

  689.                                 EnableHamForward( g_iHhTakeDamage )

  690.                         }

  691.                 }

  692.                 else

  693.                 {

  694.                         if( g_szFurienWinSound[0] )

  695.                         {

  696.                                 set_msg_arg_string(2, g_szFurienWinSound)

  697.                         }

  698.                 }              

  699.         }

  700. }

  701.  

  702. public Event_DeathMsg()

  703. {

  704.         new iKiller = read_data(1)

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

  706.         {

  707.                 new iVictim = read_data(2)

  708.                 if( iVictim != iKiller )

  709.                 {

  710.                         new iVicTimTeam = __get_user_team(iVictim)

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

  712.                         {

  713.                                 return

  714.                         }

  715.                         g_iNewMoney = clamp

  716.                                                 (

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

  718.                                                         0,

  719.                                                         16000

  720.                                                 )

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

  722.                 }

  723.         }

  724. }

  725.  

  726. public Message_Money(iMsgId, iMsgDest, id)

  727. {

  728.         unregister_message(g_iMoney, g_iMsgHookMoney)

  729.         cs_set_money_value(id, g_iNewMoney)

  730.         set_msg_arg_int(1, ARG_LONG, g_iNewMoney)

  731. }

  732.  

  733. public A_Propos(id)

  734. {

  735.         if( is_user_connected(id) )

  736.         {

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

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

  739.         }

  740. }

  741.  

  742. public Player_AddPlayerItem(id , iWeapon)

  743. {

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

  745.         ||      cs_get_weapon_id(iWeapon) != CSW_C4    

  746.         ||      g_bitBombPlant & __get_user_team(id)    )

  747.         {

  748.                 return HAM_IGNORED

  749.         }

  750.  

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

  752.         cs_set_user_plant(id, 0)

  753.         set_pev(id, pev_body, 0)

  754.         SetHamReturnInteger(0)

  755.         return HAM_SUPERCEDE

  756. }

  757.  

  758. public Player_TakeDamage() // switch teams

  759. {

  760.         return HAM_SUPERCEDE

  761. }

  762.  


INC:
http://data.hu/get/5360514/furien.inc

Kösznöm aki megcsinálja!

Amxx-et nem posztolunk:D

_________________
Idk. Csak ugy funbooo.
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 
 Hozzászólás témája: Re: Complilálás
HozzászólásElküldve:2012.07.19. 22:53 
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
Sejtettem.

"You are not alllowed to post amxx files" ^^


Hozzászólás jelentése
Vissza a tetejére
   
 
 Hozzászólás témája: Re: Complilálás
HozzászólásElküldve:2012.07.21. 08:41 
Offline
Developer
Avatar

Csatlakozott:2011.06.01. 21:11
Hozzászólások:7966
Megköszönt másnak: 295 alkalommal
Megköszönték neki: 537 alkalommal
Bence98007 írta:
Sejtettem.

"You are not alllowed to post amxx files" ^^



Ez már megint egy baromság, azt postolsz amit akarsz, ez nem alliedmost! Legfeljebb berakod .rarba, de ha már amxxet sem lehet akkor nseknek se segítsünk! No Steam = No Support

_________________
http://www.easyrankup.eu


Hozzászólás jelentése
Vissza a tetejére
   
 
 Hozzászólás témája: Re: Complilálás
HozzászólásElküldve:2012.07.21. 08:44 
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
Igazából alliedmodson sincs ilyen, hogy "NS-eknek nem segítünk". Ott az a szabály van, hogy AKKOR segítünk, ha CSAK STEAMES szervered van. Tehát lehetsz te steames, de ha NS szeród van akkor már nem segítenek. Egyébként meg ezt az amxx fileos cuccot beleírom szabályzatba. Súlyos károkat lehet így okozni. Ezért kéne az integrált átalakító, csak Dave nem ért már megint hozzá :D


Hozzászólás jelentése
Vissza a tetejére
   
 
 Hozzászólás témája: Re: Complilálás
HozzászólásElküldve:2012.07.21. 08:47 
Offline
Developer
Avatar

Csatlakozott:2011.06.01. 21:11
Hozzászólások:7966
Megköszönt másnak: 295 alkalommal
Megköszönték neki: 537 alkalommal
Silent írta:
Igazából alliedmodson sincs ilyen, hogy "NS-eknek nem segítünk". Ott az a szabály van, hogy AKKOR segítünk, ha CSAK STEAMES szervered van. Tehát lehetsz te steames, de ha NS szeród van akkor már nem segítenek. Egyébként meg ezt az amxx fileos cuccot beleírom szabályzatba. Súlyos károkat lehet így okozni. Ezért kéne az integrált átalakító, csak Dave nem ért már megint hozzá :D




Nem kötekedésből mondom, de akkor meg kéne azt is csinálni hogy az oldalra csak smát lehessen feltölteni, és maguknak átkonvertálják, mert bármelyik "Súlyos károkat tud okozni"!

_________________
http://www.easyrankup.eu


Hozzászólás jelentése
Vissza a tetejére
   
 
 Hozzászólás témája: Re: Complilálás
HozzászólásElküldve:2012.07.21. 08:49 
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
Ezt mondom, hogy Dave-nak megkéne csinálni az integrált(beépített) sma forgatást. Tehát elég feltölteni az sma-t és a rendszer(mint alliedmods-on) leforgatja és azt lehet letölteni.


Hozzászólás jelentése
Vissza a tetejére
   
 
 Hozzászólás témája: Re: Complilálás
HozzászólásElküldve:2012.07.21. 15:02 
Offline
Tiszteletbeli
Avatar

Csatlakozott:2011.09.18. 13:01
Hozzászólások:4274
Megköszönt másnak: 55 alkalommal
Megköszönték neki: 515 alkalommal
Ha jol tudom amxmodx.org on is ugy van hogy csak sma-t kell feltolteni.Amxx-et magatol generalja.
UI: akinek vagy egy kis esze az sma-t alakitsa at es nem amxx-et tolt.

_________________
Idk. Csak ugy funbooo.
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 
 Hozzászólás témája: Re: Complilálás
HozzászólásElküldve:2012.07.21. 21:26 
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
Már rég megvan, azért kösz Kiki a próbálkozást! Értékelem! 2* xD


Hozzászólás jelentése
Vissza a tetejére
   
 
 Hozzászólás témája: Re: Complilálás
HozzászólásElküldve:2012.07.26. 18:41 
Offline
Veterán
Avatar

Csatlakozott:2011.06.07. 15:29
Hozzászólások:1728
Megköszönt másnak: 1 alkalommal
Megköszönték neki: 63 alkalommal
Miért scripting?

Amúgy Bence: Amikor következőre rossz helyre nyitsz témát, akkor szerintem kitiltást is kapsz. Minimum 10x elmagyaráztuk már, hogy mikor-hova nyisd, de te még mindig * rá. ( * helyére mindenki azt képzel, aki akar )


Hozzászólás jelentése
Vissza a tetejére
   
 
Hozzászólások megjelenítése: Rendezés 
Új téma nyitása A témát lezárták, nem szerkesztheted a hozzászólásaid, és nem küldhetsz új hozzászólást.  [14 hozzászólás ]  Oldal12Következő


Ki van itt

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