hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.03.28. 09:49



Jelenlévő felhasználók

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

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

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

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



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

Regisztráció

Kereső


Új téma nyitása  Hozzászólás a témához  [ 4 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Menüre pluginok kikapcsolasa
HozzászólásElküldve: 2015.01.03. 09:28 
Offline
Senior Tag
Avatar

Csatlakozott: 2013.03.10. 11:42
Hozzászólások: 240
Megköszönt másnak: 52 alkalommal
Megköszönték neki: 9 alkalommal
Sziasztok!
Egy olyan pluginra lenne szükségem hogyha beírja egy játés hogy /menu akkor előhoz 1 menut amiben van 2 mod. Ha az eggyik modot bekapcsolja akkor mukodik neki 2plugin ha a masikat akkor ez a 2 plugin kikapcsol.
Valaki tudna nekem ebben segíteni?
Előre is köszönöm! :P
Gomb az alap dolog:o :)

_________________
NEW IP:
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Menüre pluginok kikapcsolasa
HozzászólásElküldve: 2015.01.03. 15:51 
Offline
Őskövület
Avatar

Csatlakozott: 2012.02.27. 09:42
Hozzászólások: 2588
Megköszönt másnak: 25 alkalommal
Megköszönték neki: 418 alkalommal
2 mod van

1. egybeírod a pluginokat és bool változóval megoldod.
2. inc -t csinálsz és a menüs plugin lesz a vezérlő ahol ha az 1 est nyomja a bool változó true ha a 2 est akk false. Az inc pedig eltárolja a változó értékét és a 2 pluginban include olod az inc-t és lekéred a változó értékét. Ha true akk nemfut ha false fut de lehet fordítva is.

Ha nem tudod megoldani posztolj forráskódot.

_________________
Kép

Ők köszönték meg CrB nek ezt a hozzászólást: TraneTommy (2015.01.04. 12:23)
  Népszerűség: 2.27%


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Menüre pluginok kikapcsolasa
HozzászólásElküldve: 2015.01.03. 17:02 
Offline
Senior Tag
Avatar

Csatlakozott: 2013.03.10. 11:42
Hozzászólások: 240
Megköszönt másnak: 52 alkalommal
Megköszönték neki: 9 alkalommal
Oh köszi:)
De nem tudom megoldani szóval kérném a segítséget:)


SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <engine>
  4. #include <vault>
  5. #include <fun>
  6. #include <colorchat>
  7.  
  8. #define PLUGIN "Knife Mod"
  9. #define VERSION "1.0"
  10. #define AUTHOR "spunko"
  11.  
  12. #define TASK_INTERVAL 4.0
  13. #define MAX_HEALTH 255
  14.  
  15. new knife_model[33]
  16. new g_Menu
  17.  
  18. new CVAR_HIGHSPEED
  19. new CVAR_LOWSPEED
  20. new CVAR_LOWGRAV
  21. new CVAR_NORMGRAV
  22. new CVAR_HEALTH_ADD
  23. new CVAR_HEALTH_MAX
  24. new CVAR_DAMAGE
  25.  
  26. public plugin_init() {
  27.  
  28. register_plugin(PLUGIN, VERSION, AUTHOR)
  29.  
  30. register_event( "Damage", "event_damage", "be" )
  31. register_event("CurWeapon","CurWeapon","be","1=1")
  32.  
  33. g_Menu = register_menuid("Knife Mod")
  34. register_menucmd(g_Menu, 1023, "knifemenu")
  35.  
  36. register_clcmd("say /knife", "display_knife")
  37. register_clcmd("say /kes", "display_knife")
  38.  
  39. CVAR_HIGHSPEED = register_cvar("km_highspeed","340")
  40. CVAR_LOWSPEED = register_cvar("km_lowspeed","170")
  41. CVAR_HEALTH_ADD = register_cvar("km_addhealth", "3")
  42. CVAR_HEALTH_MAX = register_cvar("km_maxhealth", "75")
  43. CVAR_DAMAGE = register_cvar("km_damage", "2")
  44. CVAR_LOWGRAV = register_cvar("km_lowgravity" , "400")
  45. CVAR_NORMGRAV = get_cvar_pointer("sv_gravity")
  46.  
  47. set_task(35 "kmodmsg", 0, _, _, "b")
  48. }
  49.  
  50. public plugin_precache() {
  51. precache_model("models/acabdr_knife2015/v_gravity.mdl")
  52. precache_model("models/acabdr_knife2015/p_butcher.mdl")
  53. precache_model("models/acabdr_knife2015/v_sebzo.mdl")
  54. precache_model("models/acabdr_knife2015/p_machete.mdl")
  55. precache_model("models/acabdr_knife2015/v_bak.mdl")
  56. precache_model("models/acabdr_knife2015/p_bak.mdl")
  57. precache_model("models/acabdr_knife2015/v_gyors.mdl")
  58. precache_model("models/acabdr_knife2015/p_pocket.mdl")
  59. precache_model("models/acabdr_knife2015/v_knife.mdl")
  60. precache_model("models/acabdr_knife2015/p_knife.mdl")
  61. }
  62.  
  63. public display_knife(id) {
  64. new menuBody[512]
  65. add(menuBody, 511, "\b|ACAB| Kések\w^n^n")
  66. add(menuBody, 511, "1. \rMachete \y(Sebzés/lassan)\w^n")
  67. add(menuBody, 511, "2. \rLopakodó \y(Nem trapolsz)\w^n")
  68. add(menuBody, 511, "3. \rGyors \y(Gyorsan futsz)\w^n")
  69. add(menuBody, 511, "4. \rNagy ugró \y(Alacsony gravitáció)\w^n")
  70. add(menuBody, 511, "5. \rAlap \y(Élet regen)\w^n^n")
  71. add(menuBody, 511, "0. \rKilépés^n")
  72.  
  73. new keys = ( 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<9 )
  74. show_menu(id, keys, menuBody, -1, "Knife Mod")
  75. }
  76.  
  77. public knifemenu(id, key) {
  78. switch(key)
  79. {
  80. case 0: SetKnife(id , 4)
  81. case 1: SetKnife(id , 2)
  82. case 2: SetKnife(id , 3)
  83. case 3: SetKnife(id , 1)
  84. case 4: SetKnife(id , 0)
  85. default: return PLUGIN_HANDLED
  86. }
  87. SaveData(id)
  88. return PLUGIN_HANDLED
  89. }
  90.  
  91. public SetKnife(id , Knife) {
  92. knife_model[id] = Knife
  93.  
  94. new Clip, Ammo, Weapon = get_user_weapon(id, Clip, Ammo)
  95. if ( Weapon != CSW_KNIFE )
  96. return PLUGIN_HANDLED
  97.  
  98. new vModel[56],pModel[56]
  99.  
  100. switch(Knife)
  101. {
  102. case 0: {
  103. format(vModel,55,"models/acabdr_knife2015/v_knife.mdl")
  104. format(pModel,55,"models/acabdr_knife2015/p_knife.mdl")
  105. }
  106. case 1: {
  107. format(vModel,55,"models/acabdr_knife2015/v_gravity.mdl")
  108. format(pModel,55,"models/acabdr_knife2015/p_butcher.mdl")
  109. }
  110. case 2: {
  111. format(vModel,55,"models/acabdr_knife2015/v_bak.mdl")
  112. format(pModel,55,"models/acabdr_knife2015/p_bak.mdl")
  113. }
  114. case 3: {
  115. format(vModel,55,"models/acabdr_knife2015/v_gyors.mdl")
  116. format(pModel,55,"models/acabdr_knife2015/p_pocket.mdl")
  117. }
  118. case 4: {
  119. format(vModel,55,"models/acabdr_knife2015/v_sebzo.mdl")
  120. format(pModel,55,"models/acabdr_knife2015/p_machete.mdl")
  121. }
  122. }
  123.  
  124. entity_set_string(id, EV_SZ_viewmodel, vModel)
  125. entity_set_string(id, EV_SZ_weaponmodel, pModel)
  126.  
  127. return PLUGIN_HANDLED;
  128. }
  129.  
  130. public event_damage( id ) {
  131.  
  132. new victim_id = id;
  133. if( !is_user_connected( victim_id ) ) return PLUGIN_CONTINUE
  134. new dmg_take = read_data( 2 );
  135. new dmgtype = read_data( 3 );
  136. new Float:multiplier = get_pcvar_float(CVAR_DAMAGE);
  137. new Float:damage = dmg_take * multiplier;
  138. new health = get_user_health( victim_id );
  139.  
  140. new iWeapID, attacker_id = get_user_attacker( victim_id, iWeapID );
  141.  
  142. if( !is_user_connected( attacker_id ) || !is_user_alive( victim_id ) ) {
  143. return PLUGIN_HANDLED
  144. }
  145.  
  146. if( iWeapID == CSW_KNIFE && knife_model[attacker_id] == 4 ) {
  147.  
  148. if( floatround(damage) >= health ) {
  149. if( victim_id == attacker_id ) {
  150. return PLUGIN_CONTINUE
  151. }else{
  152. log_kill( attacker_id, victim_id, "knife", 0 );
  153. }
  154.  
  155. return PLUGIN_CONTINUE
  156. }else {
  157. if( victim_id == attacker_id ) return PLUGIN_CONTINUE
  158.  
  159. fakedamage( victim_id, "weapon_knife", damage, dmgtype );
  160. }
  161. }
  162. return PLUGIN_CONTINUE
  163. }
  164.  
  165. public CurWeapon(id)
  166. {
  167. new Weapon = read_data(2)
  168.  
  169. // Set Knife Model
  170. SetKnife(id, knife_model[id])
  171.  
  172. // Task Options
  173.  
  174. if(knife_model[id] == 0 && !task_exists(id) && Weapon == CSW_KNIFE)
  175. set_task(TASK_INTERVAL , "task_healing",id,_,_,"b")
  176. else if(task_exists(id))
  177. remove_task(id)
  178.  
  179. // Abilities
  180. set_user_footsteps(id , ( (knife_model[id] == 2 && Weapon == CSW_KNIFE) ? 1 : 0) )
  181.  
  182. new Float:Gravity = ((knife_model[id] == 1 && Weapon == CSW_KNIFE)? get_pcvar_float(CVAR_LOWGRAV) : get_pcvar_float(CVAR_NORMGRAV)) / 800.0
  183. set_user_gravity(id , Gravity)
  184.  
  185. // Speed
  186. new Float:Speed
  187. if(Weapon != CSW_KNIFE || knife_model[id] < 3)
  188. return PLUGIN_CONTINUE
  189. else if(knife_model[id] == 3)
  190. Speed = get_pcvar_float(CVAR_HIGHSPEED)
  191. else if(knife_model[id] == 4)
  192. Speed = get_pcvar_float(CVAR_LOWSPEED)
  193.  
  194. set_user_maxspeed(id, Speed)
  195.  
  196. return PLUGIN_HANDLED
  197.  
  198. }
  199.  
  200. stock log_kill(killer, victim, weapon[],headshot) {
  201. user_silentkill( victim );
  202.  
  203. message_begin( MSG_ALL, get_user_msgid( "DeathMsg" ), {0,0,0}, 0 );
  204. write_byte( killer );
  205. write_byte( victim );
  206. write_byte( headshot );
  207. write_string( weapon );
  208. message_end();
  209.  
  210. new kfrags = get_user_frags( killer );
  211. set_user_frags( killer, kfrags++ );
  212. new vfrags = get_user_frags( victim );
  213. set_user_frags( victim, vfrags++ );
  214.  
  215. return PLUGIN_CONTINUE
  216. }
  217.  
  218.  
  219. public task_healing(id) {
  220. new addhealth = get_pcvar_num(CVAR_HEALTH_ADD)
  221. if (!addhealth)
  222. return
  223.  
  224. new maxhealth = get_pcvar_num(CVAR_HEALTH_MAX)
  225. if (maxhealth > MAX_HEALTH) {
  226. set_pcvar_num(CVAR_HEALTH_MAX, MAX_HEALTH)
  227. maxhealth = MAX_HEALTH
  228. }
  229.  
  230. new health = get_user_health(id)
  231.  
  232. if (is_user_alive(id) && (health < maxhealth)) {
  233. set_user_health(id, health + addhealth)
  234. set_hudmessage(0, 255, 0, -1.0, 0.25, 0, 1.0, 2.0, 0.1, 0.1, 4)
  235. show_hudmessage(id,"<< !!Élet REGEN!! >>")
  236. message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, id)
  237. write_short(1<<10)
  238. write_short(1<<10)
  239. write_short(0x0000)
  240. write_byte(0)
  241. write_byte(200)
  242. write_byte(0)
  243. write_byte(75)
  244. message_end()
  245. }
  246.  
  247. else {
  248. if (is_user_alive(id) && (health > maxhealth))
  249. remove_task(id)
  250. }
  251. }
  252.  
  253. public client_disconnect(id) {
  254. if(task_exists(id)) remove_task(id)
  255. }
  256.  
  257.  
  258. public kmodmsg() {
  259.  
  260. ColorChat(0, BLUE, "^1|ACAB|: ^4Késekért: ^3/knife")
  261. }
  262.  
  263. public client_authorized(id)
  264. {
  265. LoadData(id)
  266. }
  267.  
  268. SaveData(id)
  269. {
  270.  
  271. new authid[32]
  272. get_user_authid(id, authid, 31)
  273.  
  274. new vaultkey[64]
  275. new vaultdata[64]
  276.  
  277. format(vaultkey, 63, "KMOD_%s", authid)
  278. format(vaultdata, 63, "%d", knife_model[id])
  279. set_vaultdata(vaultkey, vaultdata)
  280. }
  281.  
  282. LoadData(id)
  283. {
  284. new authid[32]
  285. get_user_authid(id,authid,31)
  286.  
  287. new vaultkey[64], vaultdata[64]
  288.  
  289. format(vaultkey, 63, "KMOD_%s", authid)
  290. get_vaultdata(vaultkey, vaultdata, 63)
  291. knife_model[id] = str_to_num(vaultdata)
  292.  
  293. }
  294.  
  295. stock print_color(const id, const input[], any:...)
  296. {
  297. new count = 1, players[32]
  298. static msg[191]
  299. vformat(msg, 190, input, 3)
  300.  
  301. replace_all(msg, 190, "!g", "^4")
  302. replace_all(msg, 190, "!y", "^1")
  303. replace_all(msg, 190, "!t", "^3")
  304. replace_all(msg, 190, "á", "á")
  305. replace_all(msg, 190, "é", "Ă©")
  306. replace_all(msg, 190, "í", "Ă­")
  307. replace_all(msg, 190, "ó", "Ăł")
  308. replace_all(msg, 190, "ö", "ö")
  309. replace_all(msg, 190, "ő", "Ĺ‘")
  310. replace_all(msg, 190, "ú", "Ăş")
  311. replace_all(msg, 190, "ü", "ĂĽ")
  312. replace_all(msg, 190, "ű", "ű")
  313. replace_all(msg, 190, "Á", "Á")
  314. replace_all(msg, 190, "É", "É")
  315. replace_all(msg, 190, "Í", "ĂŤ")
  316. replace_all(msg, 190, "Ó", "Ă“")
  317. replace_all(msg, 190, "Ö", "Ă–")
  318. replace_all(msg, 190, "Ő", "Ő")
  319. replace_all(msg, 190, "Ú", "Ăš")
  320. replace_all(msg, 190, "Ü", "Ăś")
  321. replace_all(msg, 190, "Ű", "Ĺ°")
  322.  
  323. if (id) players[0] = id; else get_players(players, count, "ch")
  324. {
  325. for (new i = 0; i < count; i++)
  326. {
  327. if (is_user_connected(players[i]))
  328. {
  329. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
  330. write_byte(players[i])
  331. write_string(msg)
  332. message_end()
  333. }
  334. }
  335. }
  336. return PLUGIN_HANDLED
  337. }
  338.  

SMA Forráskód: [ Mindet kijelol ]
  1. /*
  2.  *
  3.  * Author: Cheesy Peteza
  4.  * Date: 22-Apr-2004 (updated 2-March-2005)
  5.  *
  6.  *
  7.  * Description: Enable bunny hopping in Counter-Strike.
  8.  *
  9.  * Cvars:
  10.  * bh_enabled 1 to enable this plugin, 0 to disable.
  11.  * bh_autojump If set to 1 players just need to hold down jump to bunny hop (no skill required)
  12.  * bh_showusage If set to 1 it will inform joining players that bunny hopping has been enabled
  13.  * and how to use it if bh_autojump enabled.
  14.  *
  15.  * Requirements: AMXModX 0.16 or greater
  16.  *
  17.  *
  18.  */
  19.  
  20. #include <amxmodx>
  21. #include <engine>
  22. #inculde <chatcolor>
  23.  
  24. #define FL_WATERJUMP (1<<11) // player jumping out of water
  25. #define FL_ONGROUND (1<<9) // At rest / on the ground
  26.  
  27. public plugin_init() {
  28. register_plugin("Super Bunny Hopper", "1.2", "Cheesy Peteza")
  29. register_cvar("sbhopper_version", "1.2", FCVAR_SERVER)
  30.  
  31. register_cvar("bh_enabled", "1")
  32. register_cvar("bh_autojump", "1")
  33. register_cvar("bh_showusage", "1")
  34. }
  35.  
  36. public client_PreThink(id) {
  37. if (!get_cvar_num("bh_enabled"))
  38. return PLUGIN_CONTINUE
  39.  
  40. entity_set_float(id, EV_FL_fuser2, 0.0) // Disable slow down after jumping
  41.  
  42. if (!get_cvar_num("bh_autojump"))
  43. return PLUGIN_CONTINUE
  44.  
  45. // Code from CBasePlayer::Jump (player.cpp) Make a player jump automatically
  46. if (entity_get_int(id, EV_INT_button) & 2) { // If holding jump
  47. new flags = entity_get_int(id, EV_INT_flags)
  48.  
  49. if (flags & FL_WATERJUMP)
  50. return PLUGIN_CONTINUE
  51. if ( entity_get_int(id, EV_INT_waterlevel) >= 2 )
  52. return PLUGIN_CONTINUE
  53. if ( !(flags & FL_ONGROUND) )
  54. return PLUGIN_CONTINUE
  55.  
  56. new Float:velocity[3]
  57. entity_get_vector(id, EV_VEC_velocity, velocity)
  58. velocity[2] += 250.0
  59. entity_set_vector(id, EV_VEC_velocity, velocity)
  60.  
  61. entity_set_int(id, EV_INT_gaitsequence, 6) // Play the Jump Animation
  62. }
  63. return PLUGIN_CONTINUE
  64. }
  65.  
  66. public client_authorized(id)
  67. set_task(30.0, "showUsage", id)
  68.  
  69. public showUsage(id) {
  70. if ( !get_cvar_num("bh_enabled") || !get_cvar_num("bh_showusage") )
  71. return PLUGIN_HANDLED
  72.  
  73. if ( !get_cvar_num("bh_autojump") ) {
  74. ChatColor(id, BLUE, "|ACAB|: ^4BHOPP:ON")
  75. } else {
  76. ChatColor(id, BLUE, "|ACAB|: ^4Az ugrás lenyomva tartással tudsz ^3BHOPPOLNI!")
  77. }
  78. return PLUGIN_HANDLED
  79. }
  80.  

SMA Forráskód: [ Mindet kijelol ]
  1. /***************************************************************************************************
  2.   AMX Parachute
  3.  
  4.   Version: 0.2.2
  5.   Author: KRoTaL
  6.  
  7.   0.1 Release
  8.   0.1.1 Players can't buy a parachute if they already own one
  9.   0.1.2 Release for AMX MOD X
  10.   0.1.3 Minor changes
  11.   0.1.4 Players lose their parachute if they die
  12.   0.1.5 Added amx_parachute cvar
  13.   0.1.6 Changed set_origin to movetype_follow (you won't see your own parachute)
  14.   0.1.7 Added amx_parachute <name> | admins with admin level a get a free parachute
  15.   0.1.8 Fixed the give parachute command
  16. added a admin_parachute cvar to give admins with level A a free parachute
  17.   0.1.9 Added a sell command & added a cvar to get money back
  18.   0.2.0 Added para_free cvar to give everyone a free parachute
  19.   0.2.1 Fixed some minor bugs
  20.   0.2.2 Fixed the parachute remove bug
  21.   0.2.3 Fixed the alive bug
  22.  
  23.  
  24.   Commands:
  25.  
  26. say buy_parachute - buys a parachute
  27.  
  28. amx_parachute <name>|@all - gives a player a free parachute
  29.  
  30. Press +use to slow down your fall.
  31.  
  32.   Cvars:
  33.  
  34. sv_parachute "1" - 0: disables the plugin
  35. 1: enables the plugin
  36.  
  37. parachute_cost "1000" - cost of the parachute
  38.  
  39. admin_parachute "0" - 0: admins with level A won't get a free parachute
  40. 1: admins with level A get a free parachute
  41.  
  42. parachute_payback "75" - the amount you get back of the parachute in %(75/100*1000) = 750
  43.  
  44. para_free "0" - 0: no free parachute
  45. 1: free parachute for everyone
  46.  
  47.  
  48.   Setup (AMXX 1.71):
  49.  
  50.   Install the amxx file.
  51.   Enable engine and cstrike(amxx's modules.ini)
  52.   Put the parachute.mdl file in the cstrike/models folder
  53.  
  54.  
  55. ***************************************************************************************************/
  56.  
  57. #include <amxmodx>
  58. #include <amxmisc>
  59. #include <engine>
  60. #include <cstrike>
  61.  
  62. #define PLUGINNAME "AMXX Parachute"
  63. #define VERSION "0.2.3"
  64. #define AUTHOR "KRoT@L"
  65.  
  66. new bool:has_parachute[33];
  67. new para_ent[33];
  68. new bool:had_parachute[33];
  69. new bool:player_died[33];
  70.  
  71. public plugin_init()
  72. {
  73. register_plugin( PLUGINNAME, VERSION, AUTHOR )
  74.  
  75. register_dictionary( "parachute.txt" )
  76.  
  77. register_concmd( "say buy_parachute", "buy_parachute" )
  78. register_concmd( "say sell_parachute", "sell_parachute" )
  79. register_concmd( "amx_parachute", "give_parachute", ADMIN_LEVEL_A, "amx_parachute <name, @all>" )
  80.  
  81. register_cvar( "sv_parachute", "1" )
  82. register_cvar( "parachute_cost", "1000" )
  83. register_cvar( "parachute_payback", "75" )
  84. register_cvar( "admin_parachute", "0" )
  85. register_cvar( "para_free", "0" )
  86.  
  87. register_logevent( "event_roundstart", 2, "0=World triggered", "1=Round_Start" )
  88. register_logevent( "event_roundend", 2, "0=World triggered", "1=Round_End" )
  89. register_event( "ResetHUD", "event_resethud", "be" )
  90. register_event( "DeathMsg", "death_event", "a" )
  91. }
  92.  
  93. public plugin_modules() {
  94. require_module( "engine" )
  95. require_module( "cstrike" )
  96. }
  97.  
  98. public plugin_precache()
  99. {
  100. precache_model("models/parachute.mdl")
  101. }
  102.  
  103. public client_connect(id)
  104. {
  105. if(para_ent[id] > 0)
  106. {
  107. remove_entity(para_ent[id])
  108. }
  109. has_parachute[id] = false
  110. para_ent[id] = 0
  111. }
  112.  
  113. public event_roundstart() {
  114. new MaxPlayers = get_maxplayers();
  115. for( new id; id < MaxPlayers; id++ ) {
  116. if( had_parachute[id] == true && player_died[id] == false ) {
  117. has_parachute[id] = true
  118. }
  119. }
  120. set_task( 3.0, "free_parachute" );
  121.  
  122. }
  123.  
  124. public event_roundend() {
  125. new MaxPlayers = get_maxplayers();
  126. for( new id; id < MaxPlayers; id++ ) {
  127. if( is_user_alive( id ) ) {
  128. if( has_parachute[id] == true ) {
  129. had_parachute[id] = true;
  130. }else{
  131. had_parachute[id] = false;
  132. }
  133. player_died[id] = false;
  134.  
  135. }else {
  136. if(para_ent[id] > 0) {
  137. remove_entity(para_ent[id])
  138. }
  139. has_parachute[id] = false
  140. para_ent[id] = 0
  141. player_died[id] = true;
  142. }
  143. }
  144.  
  145. }
  146.  
  147. public event_resethud( id ) {
  148. if(para_ent[id] > 0)
  149. {
  150. remove_entity(para_ent[id])
  151. }
  152. has_parachute[id] = false
  153. para_ent[id] = 0
  154. }
  155.  
  156. public death_event()
  157. {
  158. new id = read_data(2)
  159.  
  160. if(para_ent[id] > 0)
  161. {
  162. remove_entity(para_ent[id])
  163. }
  164. has_parachute[id] = false
  165. para_ent[id] = 0
  166. player_died[id] = true
  167. }
  168.  
  169. public buy_parachute(id) {
  170.  
  171. if(get_cvar_num( "sv_parachute" ) == 0)
  172. {
  173. client_print(id, print_chat, "%L", id, "para_disabled")
  174. return PLUGIN_HANDLED
  175. }
  176.  
  177. if(has_parachute[id])
  178. {
  179. client_print(id, print_chat, "%L", id, "para_has" )
  180. return PLUGIN_HANDLED
  181. }
  182.  
  183. new money = cs_get_user_money(id)
  184. new cost = get_cvar_num( "parachute_cost" )
  185.  
  186. if(money < cost)
  187. {
  188. client_print(id, print_chat, "%L", id, "para_money", cost)
  189. return PLUGIN_CONTINUE
  190. }
  191.  
  192. cs_set_user_money(id, money - cost)
  193. client_print(id, print_chat, "%L", id, "para_buy" )
  194. has_parachute[id] = true
  195.  
  196. return PLUGIN_CONTINUE
  197. }
  198.  
  199. public sell_parachute(id) {
  200. if (get_cvar_num("sv_parachute") == 0) {
  201. client_print(id, print_chat, "%L", id, "para_disabled")
  202. return PLUGIN_CONTINUE
  203. }
  204. if (has_parachute[id]) {
  205. if(para_ent[id] > 0)
  206. {
  207. if(is_valid_ent(para_ent[id])) {
  208. remove_entity(para_ent[id])
  209. }
  210. }
  211. has_parachute[id] = false
  212. para_ent[id] = 0
  213.  
  214. new money = cs_get_user_money(id)
  215. new cost = get_cvar_num("parachute_cost")
  216. new payback = floatround(float(cost) * (get_cvar_float("parachute_payback") / 100))
  217. cs_set_user_money(id, money + payback)
  218. client_print(id, print_chat, "%L", id, "para_sell", payback)
  219. }
  220. return PLUGIN_CONTINUE
  221. }
  222. public free_parachute() {
  223. new maxPlayers = get_maxplayers();
  224. if(get_cvar_num( "sv_parachute" ) == 0) return PLUGIN_CONTINUE
  225.  
  226. for( new i = 1; i <= maxPlayers; i++ )
  227. {
  228. if( !is_user_connected( i ) ) return PLUGIN_CONTINUE
  229.  
  230. if ( get_cvar_num( "para_free") == 1 ) {
  231. client_print( i, print_chat, "%L", LANG_PLAYER, "para_admin_free" )
  232. has_parachute[i] = true
  233.  
  234. return PLUGIN_CONTINUE
  235. }
  236. if ( get_cvar_num("admin_parachute") == 1 && get_user_flags( i ) && ADMIN_LEVEL_A ) {
  237. client_print( i, print_chat, "%L", LANG_PLAYER, "para_admin_free" )
  238. has_parachute[i] = true
  239.  
  240. return PLUGIN_CONTINUE
  241. }
  242. }
  243. return PLUGIN_CONTINUE
  244. }
  245.  
  246. public give_parachute(id, level, cid) {
  247.  
  248. if (!cmd_access(id, level, cid, 2 ) ) {
  249. return PLUGIN_CONTINUE
  250. }
  251.  
  252. if (get_cvar_num("sv_parachute") == 0 ) {
  253. client_print(id, print_chat, "%L", id, "para_disabled")
  254.  
  255. return PLUGIN_CONTINUE
  256. }else{
  257. new arg[32]
  258. read_argv( 1, arg, 31 )
  259. if (arg[0] == '@' && arg[1] == 'a') {
  260. new maxPlayers = get_maxplayers();
  261. for( new i = 1; i <= maxPlayers; i++ )
  262. {
  263. client_print( i, print_chat, "%L", LANG_PLAYER, "para_free_all" )
  264. has_parachute[i] = true
  265. }
  266.  
  267. return PLUGIN_CONTINUE
  268. }
  269. new player = cmd_target( id, arg, 4 )
  270.  
  271. if (has_parachute[id]) {
  272. client_print(id, print_chat, "%L", id, "para_has" )
  273.  
  274. return PLUGIN_CONTINUE
  275. }
  276. if( !player ) {
  277. client_print( id, print_chat, "%L", id, "para_no_player" )
  278.  
  279. return PLUGIN_CONTINUE
  280. }else{
  281. client_print(player, print_chat, "%L", player, "para_give" )
  282. has_parachute[player] = true
  283.  
  284. return PLUGIN_CONTINUE
  285. }
  286.  
  287. }
  288. return PLUGIN_CONTINUE
  289. }
  290.  
  291. public client_PreThink(id)
  292. {
  293. if( get_cvar_num( "sv_parachute" ) == 0 )
  294. {
  295. return PLUGIN_CONTINUE
  296. }
  297.  
  298. if( !is_user_alive(id) )
  299. {
  300. return PLUGIN_CONTINUE
  301. }
  302.  
  303. if( has_parachute[id] )
  304. {
  305. if (get_user_button(id) & IN_USE )
  306. {
  307. if ( !( get_entity_flags(id) & FL_ONGROUND ) )
  308. {
  309. new Float:velocity[3]
  310. entity_get_vector(id, EV_VEC_velocity, velocity)
  311. if(velocity[2] < 0)
  312. {
  313. if (para_ent[id] == 0)
  314. {
  315. para_ent[id] = create_entity("info_target")
  316. if (para_ent[id] > 0)
  317. {
  318. entity_set_model(para_ent[id], "models/parachute.mdl")
  319. entity_set_int(para_ent[id], EV_INT_movetype, MOVETYPE_FOLLOW)
  320. entity_set_edict(para_ent[id], EV_ENT_aiment, id)
  321. }
  322. }
  323. if (para_ent[id] > 0)
  324. {
  325. velocity[2] = (velocity[2] + 40.0 < -100) ? velocity[2] + 40.0 : -100.0
  326. entity_set_vector(id, EV_VEC_velocity, velocity)
  327. if (entity_get_float(para_ent[id], EV_FL_frame) < 0.0 || entity_get_float(para_ent[id], EV_FL_frame) > 254.0)
  328. {
  329. if (entity_get_int(para_ent[id], EV_INT_sequence) != 1)
  330. {
  331. entity_set_int(para_ent[id], EV_INT_sequence, 1)
  332. }
  333. entity_set_float(para_ent[id], EV_FL_frame, 0.0)
  334. }
  335. else
  336. {
  337. entity_set_float(para_ent[id], EV_FL_frame, entity_get_float(para_ent[id], EV_FL_frame) + 1.0)
  338. }
  339. }
  340. }
  341. else
  342. {
  343. if (para_ent[id] > 0)
  344. {
  345. remove_entity(para_ent[id])
  346. para_ent[id] = 0
  347. }
  348. }
  349. }
  350. else
  351. {
  352. if (para_ent[id] > 0)
  353. {
  354. remove_entity(para_ent[id])
  355. para_ent[id] = 0
  356. }
  357. }
  358. }
  359. else if (get_user_oldbutton(id) & IN_USE)
  360. {
  361. if (para_ent[id] > 0)
  362. {
  363. remove_entity(para_ent[id])
  364. para_ent[id] = 0
  365. }
  366. }
  367. }
  368.  
  369. return PLUGIN_CONTINUE
  370. }
  371.  

_________________
NEW IP:
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Menüre pluginok kikapcsolasa
HozzászólásElküldve: 2015.01.04. 12:04 
Offline
Nagyúr

Csatlakozott: 2014.05.10. 16:41
Hozzászólások: 721
Megköszönt másnak: 43 alkalommal
Megköszönték neki: 64 alkalommal
Talán nehéz munka lenne meg minden de bekapcsolni be lehet.
Kód:
callfunc_begin ( "knife-mod (cvar)" , "Knifemod.amxx")
    callfunc_push_int (id)
    callfunc_push_int (0)
    callfunc_end ()

Kód:
callfunc_begin ( "parachute (cvar)" , "parachute.amxx")
    callfunc_push_int (id)
    callfunc_push_int (0)
    callfunc_end ()


Magyarul a menüpontok alá:) :P :D

Ők köszönték meg NuD[!]e nek ezt a hozzászólást: TraneTommy (2015.01.04. 12:23)
  Népszerűség: 2.27%


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


Ki van itt

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