hlmod.hu

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



Jelenlévő felhasználók

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

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

Regisztrált felhasználók: Bing [Bot] 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  [ 13 hozzászólás ]  Oldal 1 2 Következő
Szerző Üzenet
 Hozzászólás témája: 2ugrásos Knife Mod
HozzászólásElküldve: 2015.01.04. 12:23 
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!
Valaki bele tudná nekem írni a 2ugrást a Knife_mod ba?:)
Megköszönném és menne a gomb!:)

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.0, "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.  

_________________
NEW IP:
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: 2ugrásos Knife Mod
HozzászólásElküldve: 2015.01.04. 14:45 
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
csinálsz 1 uj menüpontot. és bele írod hogy
Kód:
callfunc_begin ("sv_parachute" , "Parachute")
    callfunc_push_int (id)
    callfunc_push_int (0)
    callfunc_end ()


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: 2ugrásos Knife Mod
HozzászólásElküldve: 2015.01.04. 14:46 
Offline
Nagyúr
Avatar

Csatlakozott: 2014.04.10. 15:32
Hozzászólások: 776
Megköszönt másnak: 122 alkalommal
Megköszönték neki: 60 alkalommal
NuD[!]e írta:
csinálsz 1 uj menüpontot. és bele írod hogy
Kód:
callfunc_begin ("sv_parachute" , "Parachute")
    callfunc_push_int (id)
    callfunc_push_int (0)
    callfunc_end ()



Ez mióta 2 ugrás?

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: 2ugrásos Knife Mod
HozzászólásElküldve: 2015.01.04. 14:50 
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
Csatolom hozzá akkor!:)
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <engine>
  4. #include <cstrike>
  5. #include <fun>
  6.  
  7. new bool:has_parachute[33]
  8. new para_ent[33]
  9. new gCStrike = 0
  10. new pDetach, pFallSpeed, pEnabled, pCost, pPayback
  11.  
  12. #define PARACHUTE_LEVEL ADMIN_LEVEL_A
  13.  
  14. public plugin_init()
  15. {
  16. register_plugin("Parachute", "1.3", "KRoT@L/JTP10181")
  17. pEnabled = register_cvar("sv_parachute", "1" )
  18. pFallSpeed = register_cvar("parachute_fallspeed", "100")
  19. pDetach = register_cvar("parachute_detach", "1")
  20.  
  21. if (cstrike_running()) gCStrike = true
  22.  
  23. if (gCStrike) {
  24.  
  25. pCost = register_cvar("parachute_cost", "1000")
  26. pPayback = register_cvar("parachute_payback", "75")
  27.  
  28. register_concmd("amx_parachute", "admin_give_parachute", PARACHUTE_LEVEL, "<nick, #userid or @team>" )
  29. }
  30.  
  31. register_clcmd("say", "HandleSay")
  32. register_clcmd("say_team", "HandleSay")
  33.  
  34. register_event("ResetHUD", "newSpawn", "be")
  35. register_event("DeathMsg", "death_event", "a")
  36.  
  37. //Setup jtp10181 CVAR
  38. new cvarString[256], shortName[16]
  39. copy(shortName,15,"chute")
  40.  
  41. register_cvar("jtp10181","",FCVAR_SERVER|FCVAR_SPONLY)
  42. get_cvar_string("jtp10181",cvarString,255)
  43.  
  44. if (strlen(cvarString) == 0) {
  45. formatex(cvarString,255,shortName)
  46. set_cvar_string("jtp10181",cvarString)
  47. }
  48. else if (contain(cvarString,shortName) == -1) {
  49. format(cvarString,255,"%s,%s",cvarString, shortName)
  50. set_cvar_string("jtp10181",cvarString)
  51. }
  52. }
  53.  
  54. public plugin_natives()
  55. {
  56. set_module_filter("module_filter")
  57. set_native_filter("native_filter")
  58. }
  59.  
  60. public module_filter(const module[])
  61. {
  62. if (!cstrike_running() && equali(module, "cstrike")) {
  63. return PLUGIN_HANDLED
  64. }
  65.  
  66. return PLUGIN_CONTINUE
  67. }
  68.  
  69. public native_filter(const name[], index, trap)
  70. {
  71. if (!trap) return PLUGIN_HANDLED
  72.  
  73. return PLUGIN_CONTINUE
  74. }
  75.  
  76. public plugin_precache()
  77. {
  78. precache_model("models/parachute.mdl")
  79. }
  80.  
  81. public client_connect(id)
  82. {
  83. parachute_reset(id)
  84. }
  85.  
  86. public client_disconnect(id)
  87. {
  88. parachute_reset(id)
  89. }
  90.  
  91. public death_event()
  92. {
  93. new id = read_data(2)
  94. parachute_reset(id)
  95. }
  96.  
  97. parachute_reset(id)
  98. {
  99. if(para_ent[id] > 0) {
  100. if (is_valid_ent(para_ent[id])) {
  101. remove_entity(para_ent[id])
  102. }
  103. }
  104.  
  105. if (is_user_alive(id)) set_user_gravity(id, 1.0)
  106.  
  107. has_parachute[id] = false
  108. para_ent[id] = 0
  109. }
  110.  
  111. public newSpawn(id)
  112. {
  113. if(para_ent[id] > 0) {
  114. remove_entity(para_ent[id])
  115. set_user_gravity(id, 1.0)
  116. para_ent[id] = 0
  117. }
  118.  
  119. if (!gCStrike || access(id,PARACHUTE_LEVEL) || get_pcvar_num(pCost) <= 0) {
  120. has_parachute[id] = true
  121. //set_view(id, CAMERA_3RDPERSON)
  122. }
  123. }
  124.  
  125. public HandleSay(id)
  126. {
  127. if(!is_user_connected(id)) return PLUGIN_CONTINUE
  128.  
  129. new args[128]
  130. read_args(args, 127)
  131. remove_quotes(args)
  132.  
  133. if (gCStrike) {
  134. if (equali(args, "buy_parachute")) {
  135. buy_parachute(id)
  136. return PLUGIN_HANDLED
  137. }
  138. else if (equali(args, "sell_parachute")) {
  139. sell_parachute(id)
  140. return PLUGIN_HANDLED
  141. }
  142. else if (containi(args, "give_parachute") == 0) {
  143. give_parachute(id,args[15])
  144. return PLUGIN_HANDLED
  145. }
  146. }
  147.  
  148. if (containi(args, "parachute") != -1) {
  149. if (gCStrike) client_print(id, print_chat, "[AMXX] Ejt�erny� parancsok: buy_parachute, sell_parachute, give_parachute")
  150. client_print(id, print_chat, "[AMXX] Az ejt�erny� haszn�lat�hoz nyomd meg az E bet�t")
  151. }
  152.  
  153. return PLUGIN_CONTINUE
  154. }
  155.  
  156. public buy_parachute(id)
  157. {
  158. if (!gCStrike) return PLUGIN_CONTINUE
  159. if (!is_user_connected(id)) return PLUGIN_CONTINUE
  160.  
  161. if (!get_pcvar_num(pEnabled)) {
  162. client_print(id, print_chat, "[AMXX] Ejt�erny� plugin kikapcsolva")
  163. return PLUGIN_HANDLED
  164. }
  165.  
  166. if (has_parachute[id]) {
  167. client_print(id, print_chat, "[AMXX] Neked m�r van ejt�erny�d")
  168. return PLUGIN_HANDLED
  169. }
  170.  
  171. new money = cs_get_user_money(id)
  172. new cost = get_pcvar_num(pCost)
  173.  
  174. if (money < cost) {
  175. client_print(id, print_chat, "[AMXX] Nincs el�g p�nzed az ejt�erny� v�s�rl�s�hoz - Costs $%i", cost)
  176. return PLUGIN_HANDLED
  177. }
  178.  
  179. cs_set_user_money(id, money - cost)
  180. client_print(id, print_chat, "[AMXX] Vett�l egy ejt�erny�t Haszn�lathoz nyomd meg az E bet�t")
  181. has_parachute[id] = true
  182.  
  183. return PLUGIN_HANDLED
  184. }
  185.  
  186. public sell_parachute(id)
  187. {
  188. if (!gCStrike) return PLUGIN_CONTINUE
  189. if (!is_user_connected(id)) return PLUGIN_CONTINUE
  190.  
  191. if (!get_pcvar_num(pEnabled)) {
  192. client_print(id, print_chat, "[AMXX] Ejt�erny� plugin kikapcsolva")
  193. return PLUGIN_HANDLED
  194. }
  195.  
  196. if (!has_parachute[id]) {
  197. client_print(id, print_chat, "[AMXX] Neked nincs ejt�erny�d ez�rt nem tudod eladni")
  198. return PLUGIN_HANDLED
  199. }
  200.  
  201. if (access(id,PARACHUTE_LEVEL)) {
  202. client_print(id, print_chat, "[AMXX] Te nem adhatod el az admin �ltal adott ingyen ejt�erny�t!")
  203. return PLUGIN_HANDLED
  204. }
  205.  
  206. parachute_reset(id)
  207.  
  208. new money = cs_get_user_money(id)
  209. new cost = get_pcvar_num(pCost)
  210.  
  211. new sellamt = floatround(cost * (get_pcvar_num(pPayback) / 100.0))
  212. cs_set_user_money(id, money + sellamt)
  213.  
  214. client_print(id, print_chat, "[AMX] Eladtad a haszn�lt ejt�erny�d ennyi�rt: $%d", sellamt)
  215.  
  216. return PLUGIN_CONTINUE
  217. }
  218.  
  219. public give_parachute(id,args[])
  220. {
  221. if (!gCStrike) return PLUGIN_CONTINUE
  222. if (!is_user_connected(id)) return PLUGIN_CONTINUE
  223.  
  224. if (!get_pcvar_num(pEnabled)) {
  225. client_print(id, print_chat, "[AMXX] Ejt�erny� plugin bekapcsolva")
  226. return PLUGIN_HANDLED
  227. }
  228.  
  229. if (!has_parachute[id]) {
  230. client_print(id, print_chat, "[AMXX] Te nem tudod haszn�lni az ejt�erny�d mert nincs.")
  231. return PLUGIN_HANDLED
  232. }
  233.  
  234. new player = cmd_target(id, args, 4)
  235. if (!player) return PLUGIN_HANDLED
  236.  
  237. new id_name[32], pl_name[32]
  238. get_user_name(id, id_name, 31)
  239. get_user_name(player, pl_name, 31)
  240.  
  241. if(has_parachute[player]) {
  242. client_print(id, print_chat, "[AMXX] %s m�r van ejt�erny�je.", pl_name)
  243. return PLUGIN_HANDLED
  244. }
  245.  
  246. parachute_reset(id)
  247. has_parachute[player] = true
  248.  
  249. client_print(id, print_chat, "[AMXX] Adt�l ejt�erny�t neki : %s.", pl_name)
  250. client_print(player, print_chat, "[AMXX] %s haszn�lja az ejt�erny�t amit te adt�l neki.", id_name)
  251.  
  252. return PLUGIN_HANDLED
  253. }
  254.  
  255. public admin_give_parachute(id, level, cid) {
  256.  
  257. if (!gCStrike) return PLUGIN_CONTINUE
  258.  
  259. if(!cmd_access(id,level,cid,2)) return PLUGIN_HANDLED
  260.  
  261. if (!get_pcvar_num(pEnabled)) {
  262. client_print(id, print_chat, "[AMXX] ejt�erny� plugin kikapcsolva")
  263. return PLUGIN_HANDLED
  264. }
  265.  
  266. new arg[32], name[32], name2[32], authid[35], authid2[35]
  267. read_argv(1,arg,31)
  268. get_user_name(id,name,31)
  269. get_user_authid(id,authid,34)
  270.  
  271. if (arg[0]=='@'){
  272. new players[32], inum
  273. if (equali("T",arg[1])) copy(arg[1],31,"TERRORIST")
  274. if (equali("ALL",arg[1])) get_players(players,inum)
  275. else get_players(players,inum,"e",arg[1])
  276.  
  277. if (inum == 0) {
  278. console_print(id,"No clients in such team")
  279. return PLUGIN_HANDLED
  280. }
  281.  
  282. for(new a = 0; a < inum; a++) {
  283. has_parachute[players[a]] = true
  284. }
  285.  
  286. switch(get_cvar_num("amx_show_activity")) {
  287. case 2: client_print(0,print_chat,"ADMIN %s: adott egy ejt�erny�t ^"%s^" playernek",name,arg[1])
  288. case 1: client_print(0,print_chat,"ADMIN: Adott egy ejt�erny�t ^"%s^" playernek",arg[1])
  289. }
  290.  
  291. console_print(id,"[AMXX] Te adt�l egy ejt�erny�t ^"%s^" playernek",arg[1])
  292. log_amx("^"%s<%d><%s><>^" adt�l ejt�erny�t ^"%s^"", name,get_user_userid(id),authid,arg[1])
  293. }
  294. else {
  295.  
  296. new player = cmd_target(id,arg,6)
  297. if (!player) return PLUGIN_HANDLED
  298.  
  299. has_parachute[player] = true
  300.  
  301. get_user_name(player,name2,31)
  302. get_user_authid(player,authid2,34)
  303.  
  304. switch(get_cvar_num("amx_show_activity")) {
  305. case 2: client_print(0,print_chat,"ADMIN %s: adt�l ejt�erny�t ^"%s^"",name,name2)
  306. case 1: client_print(0,print_chat,"ADMIN: adt�l ejt�erny�t ^"%s^"",name2)
  307. }
  308.  
  309. console_print(id,"[AMXX] te adt�l ejt�erny�t ^"%s^"", name2)
  310. log_amx("^"%s<%d><%s><>^" adt�l ejt�erny�t ^"%s<%d><%s><>^"", name,get_user_userid(id),authid,name2,get_user_userid(player),authid2)
  311. }
  312. return PLUGIN_HANDLED
  313. }
  314.  
  315. public client_PreThink(id)
  316. {
  317. //parachute.mdl animation information
  318. //0 - deploy - 84 frames
  319. //1 - idle - 39 frames
  320. //2 - detach - 29 frames
  321.  
  322. if (!get_pcvar_num(pEnabled)) return
  323. if (!is_user_alive(id) || !has_parachute[id]) return
  324.  
  325. new Float:fallspeed = get_pcvar_float(pFallSpeed) * -1.0
  326. new Float:frame
  327.  
  328. new button = get_user_button(id)
  329. new oldbutton = get_user_oldbutton(id)
  330. new flags = get_entity_flags(id)
  331.  
  332. if (para_ent[id] > 0 && (flags & FL_ONGROUND)) {
  333.  
  334. if (get_pcvar_num(pDetach)) {
  335.  
  336. if (get_user_gravity(id) == 0.1) set_user_gravity(id, 1.0)
  337.  
  338. if (entity_get_int(para_ent[id],EV_INT_sequence) != 2) {
  339. entity_set_int(para_ent[id], EV_INT_sequence, 2)
  340. entity_set_int(para_ent[id], EV_INT_gaitsequence, 1)
  341. entity_set_float(para_ent[id], EV_FL_frame, 0.0)
  342. entity_set_float(para_ent[id], EV_FL_fuser1, 0.0)
  343. entity_set_float(para_ent[id], EV_FL_animtime, 0.0)
  344. entity_set_float(para_ent[id], EV_FL_framerate, 0.0)
  345. return
  346. }
  347.  
  348. frame = entity_get_float(para_ent[id],EV_FL_fuser1) + 2.0
  349. entity_set_float(para_ent[id],EV_FL_fuser1,frame)
  350. entity_set_float(para_ent[id],EV_FL_frame,frame)
  351.  
  352. if (frame > 254.0) {
  353. remove_entity(para_ent[id])
  354. para_ent[id] = 0
  355. }
  356. }
  357. else {
  358. remove_entity(para_ent[id])
  359. set_user_gravity(id, 1.0)
  360. para_ent[id] = 0
  361. }
  362.  
  363. return
  364. }
  365.  
  366. if (button & IN_USE) {
  367.  
  368. new Float:velocity[3]
  369. entity_get_vector(id, EV_VEC_velocity, velocity)
  370.  
  371. if (velocity[2] < 0.0) {
  372.  
  373. if(para_ent[id] <= 0) {
  374. para_ent[id] = create_entity("info_target")
  375. if(para_ent[id] > 0) {
  376. entity_set_string(para_ent[id],EV_SZ_classname,"parachute")
  377. entity_set_edict(para_ent[id], EV_ENT_aiment, id)
  378. entity_set_edict(para_ent[id], EV_ENT_owner, id)
  379. entity_set_int(para_ent[id], EV_INT_movetype, MOVETYPE_FOLLOW)
  380. entity_set_model(para_ent[id], "models/parachute.mdl")
  381. entity_set_int(para_ent[id], EV_INT_sequence, 0)
  382. entity_set_int(para_ent[id], EV_INT_gaitsequence, 1)
  383. entity_set_float(para_ent[id], EV_FL_frame, 0.0)
  384. entity_set_float(para_ent[id], EV_FL_fuser1, 0.0)
  385. }
  386. }
  387.  
  388. if (para_ent[id] > 0) {
  389.  
  390. entity_set_int(id, EV_INT_sequence, 3)
  391. entity_set_int(id, EV_INT_gaitsequence, 1)
  392. entity_set_float(id, EV_FL_frame, 1.0)
  393. entity_set_float(id, EV_FL_framerate, 1.0)
  394. set_user_gravity(id, 0.1)
  395.  
  396. velocity[2] = (velocity[2] + 40.0 < fallspeed) ? velocity[2] + 40.0 : fallspeed
  397. entity_set_vector(id, EV_VEC_velocity, velocity)
  398.  
  399. if (entity_get_int(para_ent[id],EV_INT_sequence) == 0) {
  400.  
  401. frame = entity_get_float(para_ent[id],EV_FL_fuser1) + 1.0
  402. entity_set_float(para_ent[id],EV_FL_fuser1,frame)
  403. entity_set_float(para_ent[id],EV_FL_frame,frame)
  404.  
  405. if (frame > 100.0) {
  406. entity_set_float(para_ent[id], EV_FL_animtime, 0.0)
  407. entity_set_float(para_ent[id], EV_FL_framerate, 0.4)
  408. entity_set_int(para_ent[id], EV_INT_sequence, 1)
  409. entity_set_int(para_ent[id], EV_INT_gaitsequence, 1)
  410. entity_set_float(para_ent[id], EV_FL_frame, 0.0)
  411. entity_set_float(para_ent[id], EV_FL_fuser1, 0.0)
  412. }
  413. }
  414. }
  415. }
  416. else if (para_ent[id] > 0) {
  417. remove_entity(para_ent[id])
  418. set_user_gravity(id, 1.0)
  419. para_ent[id] = 0
  420. }
  421. }
  422. else if ((oldbutton & IN_USE) && para_ent[id] > 0 ) {
  423. remove_entity(para_ent[id])
  424. set_user_gravity(id, 1.0)
  425. para_ent[id] = 0
  426. }
  427. }
  428. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  429. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1038\\ f0\\ fs16 \n\\ par }
  430. */
  431.  


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: 2ugrásos Knife Mod
HozzászólásElküldve: 2015.01.04. 14:52 
Offline
Beavatott

Csatlakozott: 2014.12.30. 14:09
Hozzászólások: 94
Megköszönt másnak: 1 alkalommal
Megköszönték neki: 16 alkalommal
NuD[!]e írta:
Csatolom hozzá akkor!:)
SMA Forráskód: [ Mindet kijelol ]#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <cstrike>
#include <fun>
 
new bool:has_parachute[33]
new para_ent[33]
new gCStrike = 0
new pDetach, pFallSpeed, pEnabled, pCost, pPayback
 
#define PARACHUTE_LEVEL ADMIN_LEVEL_A
 
public plugin_init()
{
register_plugin("Parachute", "1.3", "KRoT@L/JTP10181")
pEnabled = register_cvar("sv_parachute", "1" )
pFallSpeed = register_cvar("parachute_fallspeed", "100")
pDetach = register_cvar("parachute_detach", "1")
 
if (cstrike_running()) gCStrike = true
 
if (gCStrike) {
 
pCost = register_cvar("parachute_cost", "1000")
pPayback = register_cvar("parachute_payback", "75")
 
register_concmd("amx_parachute", "admin_give_parachute", PARACHUTE_LEVEL, "<nick, #userid or @team>" )
}
 
register_clcmd("say", "HandleSay")
register_clcmd("say_team", "HandleSay")
 
register_event("ResetHUD", "newSpawn", "be")
register_event("DeathMsg", "death_event", "a")
 
//Setup jtp10181 CVAR
new cvarString[256], shortName[16]
copy(shortName,15,"chute")
 
register_cvar("jtp10181","",FCVAR_SERVER|FCVAR_SPONLY)
get_cvar_string("jtp10181",cvarString,255)
 
if (strlen(cvarString) == 0) {
formatex(cvarString,255,shortName)
set_cvar_string("jtp10181",cvarString)
}
else if (contain(cvarString,shortName) == -1) {
format(cvarString,255,"%s,%s",cvarString, shortName)
set_cvar_string("jtp10181",cvarString)
}
}
 
public plugin_natives()
{
set_module_filter("module_filter")
set_native_filter("native_filter")
}
 
public module_filter(const module[])
{
if (!cstrike_running() && equali(module, "cstrike")) {
return PLUGIN_HANDLED
}
 
return PLUGIN_CONTINUE
}
 
public native_filter(const name[], index, trap)
{
if (!trap) return PLUGIN_HANDLED
 
return PLUGIN_CONTINUE
}
 
public plugin_precache()
{
precache_model("models/parachute.mdl")
}
 
public client_connect(id)
{
parachute_reset(id)
}
 
public client_disconnect(id)
{
parachute_reset(id)
}
 
public death_event()
{
new id = read_data(2)
parachute_reset(id)
}
 
parachute_reset(id)
{
if(para_ent[id] > 0) {
if (is_valid_ent(para_ent[id])) {
remove_entity(para_ent[id])
}
}
 
if (is_user_alive(id)) set_user_gravity(id, 1.0)
 
has_parachute[id] = false
para_ent[id] = 0
}
 
public newSpawn(id)
{
if(para_ent[id] > 0) {
remove_entity(para_ent[id])
set_user_gravity(id, 1.0)
para_ent[id] = 0
}
 
if (!gCStrike || access(id,PARACHUTE_LEVEL) || get_pcvar_num(pCost) <= 0) {
has_parachute[id] = true
//set_view(id, CAMERA_3RDPERSON)
}
}
 
public HandleSay(id)
{
if(!is_user_connected(id)) return PLUGIN_CONTINUE
 
new args[128]
read_args(args, 127)
remove_quotes(args)
 
if (gCStrike) {
if (equali(args, "buy_parachute")) {
buy_parachute(id)
return PLUGIN_HANDLED
}
else if (equali(args, "sell_parachute")) {
sell_parachute(id)
return PLUGIN_HANDLED
}
else if (containi(args, "give_parachute") == 0) {
give_parachute(id,args[15])
return PLUGIN_HANDLED
}
}
 
if (containi(args, "parachute") != -1) {
if (gCStrike) client_print(id, print_chat, "[AMXX] Ejt�erny� parancsok: buy_parachute, sell_parachute, give_parachute")
client_print(id, print_chat, "[AMXX] Az ejt�erny� haszn�lat�hoz nyomd meg az E bet�t")
}
 
return PLUGIN_CONTINUE
}
 
public buy_parachute(id)
{
if (!gCStrike) return PLUGIN_CONTINUE
if (!is_user_connected(id)) return PLUGIN_CONTINUE
 
if (!get_pcvar_num(pEnabled)) {
client_print(id, print_chat, "[AMXX] Ejt�erny� plugin kikapcsolva")
return PLUGIN_HANDLED
}
 
if (has_parachute[id]) {
client_print(id, print_chat, "[AMXX] Neked m�r van ejt�erny�d")
return PLUGIN_HANDLED
}
 
new money = cs_get_user_money(id)
new cost = get_pcvar_num(pCost)
 
if (money < cost) {
client_print(id, print_chat, "[AMXX] Nincs el�g p�nzed az ejt�erny� v�s�rl�s�hoz - Costs $%i", cost)
return PLUGIN_HANDLED
}
 
cs_set_user_money(id, money - cost)
client_print(id, print_chat, "[AMXX] Vett�l egy ejt�erny�t Haszn�lathoz nyomd meg az E bet�t")
has_parachute[id] = true
 
return PLUGIN_HANDLED
}
 
public sell_parachute(id)
{
if (!gCStrike) return PLUGIN_CONTINUE
if (!is_user_connected(id)) return PLUGIN_CONTINUE
 
if (!get_pcvar_num(pEnabled)) {
client_print(id, print_chat, "[AMXX] Ejt�erny� plugin kikapcsolva")
return PLUGIN_HANDLED
}
 
if (!has_parachute[id]) {
client_print(id, print_chat, "[AMXX] Neked nincs ejt�erny�d ez�rt nem tudod eladni")
return PLUGIN_HANDLED
}
 
if (access(id,PARACHUTE_LEVEL)) {
client_print(id, print_chat, "[AMXX] Te nem adhatod el az admin �ltal adott ingyen ejt�erny�t!")
return PLUGIN_HANDLED
}
 
parachute_reset(id)
 
new money = cs_get_user_money(id)
new cost = get_pcvar_num(pCost)
 
new sellamt = floatround(cost * (get_pcvar_num(pPayback) / 100.0))
cs_set_user_money(id, money + sellamt)
 
client_print(id, print_chat, "[AMX] Eladtad a haszn�lt ejt�erny�d ennyi�rt: $%d", sellamt)
 
return PLUGIN_CONTINUE
}
 
public give_parachute(id,args[])
{
if (!gCStrike) return PLUGIN_CONTINUE
if (!is_user_connected(id)) return PLUGIN_CONTINUE
 
if (!get_pcvar_num(pEnabled)) {
client_print(id, print_chat, "[AMXX] Ejt�erny� plugin bekapcsolva")
return PLUGIN_HANDLED
}
 
if (!has_parachute[id]) {
client_print(id, print_chat, "[AMXX] Te nem tudod haszn�lni az ejt�erny�d mert nincs.")
return PLUGIN_HANDLED
}
 
new player = cmd_target(id, args, 4)
if (!player) return PLUGIN_HANDLED
 
new id_name[32], pl_name[32]
get_user_name(id, id_name, 31)
get_user_name(player, pl_name, 31)
 
if(has_parachute[player]) {
client_print(id, print_chat, "[AMXX] %s m�r van ejt�erny�je.", pl_name)
return PLUGIN_HANDLED
}
 
parachute_reset(id)
has_parachute[player] = true
 
client_print(id, print_chat, "[AMXX] Adt�l ejt�erny�t neki : %s.", pl_name)
client_print(player, print_chat, "[AMXX] %s haszn�lja az ejt�erny�t amit te adt�l neki.", id_name)
 
return PLUGIN_HANDLED
}
 
public admin_give_parachute(id, level, cid) {
 
if (!gCStrike) return PLUGIN_CONTINUE
 
if(!cmd_access(id,level,cid,2)) return PLUGIN_HANDLED
 
if (!get_pcvar_num(pEnabled)) {
client_print(id, print_chat, "[AMXX] ejt�erny� plugin kikapcsolva")
return PLUGIN_HANDLED
}
 
new arg[32], name[32], name2[32], authid[35], authid2[35]
read_argv(1,arg,31)
get_user_name(id,name,31)
get_user_authid(id,authid,34)
 
if (arg[0]=='@'){
new players[32], inum
if (equali("T",arg[1])) copy(arg[1],31,"TERRORIST")
if (equali("ALL",arg[1])) get_players(players,inum)
else get_players(players,inum,"e",arg[1])
 
if (inum == 0) {
console_print(id,"No clients in such team")
return PLUGIN_HANDLED
}
 
for(new a = 0; a < inum; a++) {
has_parachute[players[a]] = true
}
 
switch(get_cvar_num("amx_show_activity")) {
case 2: client_print(0,print_chat,"ADMIN %s: adott egy ejt�erny�t ^"%s^" playernek",name,arg[1])
case 1: client_print(0,print_chat,"ADMIN: Adott egy ejt�erny�t ^"%s^" playernek",arg[1])
}
 
console_print(id,"[AMXX] Te adt�l egy ejt�erny�t ^"%s^" playernek",arg[1])
log_amx("^"%s<%d><%s><>^" adt�l ejt�erny�t ^"%s^"", name,get_user_userid(id),authid,arg[1])
}
else {
 
new player = cmd_target(id,arg,6)
if (!player) return PLUGIN_HANDLED
 
has_parachute[player] = true
 
get_user_name(player,name2,31)
get_user_authid(player,authid2,34)
 
switch(get_cvar_num("amx_show_activity")) {
case 2: client_print(0,print_chat,"ADMIN %s: adt�l ejt�erny�t ^"%s^"",name,name2)
case 1: client_print(0,print_chat,"ADMIN: adt�l ejt�erny�t ^"%s^"",name2)
}
 
console_print(id,"[AMXX] te adt�l ejt�erny�t ^"%s^"", name2)
log_amx("^"%s<%d><%s><>^" adt�l ejt�erny�t ^"%s<%d><%s><>^"", name,get_user_userid(id),authid,name2,get_user_userid(player),authid2)
}
return PLUGIN_HANDLED
}
 
public client_PreThink(id)
{
//parachute.mdl animation information
//0 - deploy - 84 frames
//1 - idle - 39 frames
//2 - detach - 29 frames
 
if (!get_pcvar_num(pEnabled)) return
if (!is_user_alive(id) || !has_parachute[id]) return
 
new Float:fallspeed = get_pcvar_float(pFallSpeed) * -1.0
new Float:frame
 
new button = get_user_button(id)
new oldbutton = get_user_oldbutton(id)
new flags = get_entity_flags(id)
 
if (para_ent[id] > 0 && (flags & FL_ONGROUND)) {
 
if (get_pcvar_num(pDetach)) {
 
if (get_user_gravity(id) == 0.1) set_user_gravity(id, 1.0)
 
if (entity_get_int(para_ent[id],EV_INT_sequence) != 2) {
entity_set_int(para_ent[id], EV_INT_sequence, 2)
entity_set_int(para_ent[id], EV_INT_gaitsequence, 1)
entity_set_float(para_ent[id], EV_FL_frame, 0.0)
entity_set_float(para_ent[id], EV_FL_fuser1, 0.0)
entity_set_float(para_ent[id], EV_FL_animtime, 0.0)
entity_set_float(para_ent[id], EV_FL_framerate, 0.0)
return
}
 
frame = entity_get_float(para_ent[id],EV_FL_fuser1) + 2.0
entity_set_float(para_ent[id],EV_FL_fuser1,frame)
entity_set_float(para_ent[id],EV_FL_frame,frame)
 
if (frame > 254.0) {
remove_entity(para_ent[id])
para_ent[id] = 0
}
}
else {
remove_entity(para_ent[id])
set_user_gravity(id, 1.0)
para_ent[id] = 0
}
 
return
}
 
if (button & IN_USE) {
 
new Float:velocity[3]
entity_get_vector(id, EV_VEC_velocity, velocity)
 
if (velocity[2] < 0.0) {
 
if(para_ent[id] <= 0) {
para_ent[id] = create_entity("info_target")
if(para_ent[id] > 0) {
entity_set_string(para_ent[id],EV_SZ_classname,"parachute")
entity_set_edict(para_ent[id], EV_ENT_aiment, id)
entity_set_edict(para_ent[id], EV_ENT_owner, id)
entity_set_int(para_ent[id], EV_INT_movetype, MOVETYPE_FOLLOW)
entity_set_model(para_ent[id], "models/parachute.mdl")
entity_set_int(para_ent[id], EV_INT_sequence, 0)
entity_set_int(para_ent[id], EV_INT_gaitsequence, 1)
entity_set_float(para_ent[id], EV_FL_frame, 0.0)
entity_set_float(para_ent[id], EV_FL_fuser1, 0.0)
}
}
 
if (para_ent[id] > 0) {
 
entity_set_int(id, EV_INT_sequence, 3)
entity_set_int(id, EV_INT_gaitsequence, 1)
entity_set_float(id, EV_FL_frame, 1.0)
entity_set_float(id, EV_FL_framerate, 1.0)
set_user_gravity(id, 0.1)
 
velocity[2] = (velocity[2] + 40.0 < fallspeed) ? velocity[2] + 40.0 : fallspeed
entity_set_vector(id, EV_VEC_velocity, velocity)
 
if (entity_get_int(para_ent[id],EV_INT_sequence) == 0) {
 
frame = entity_get_float(para_ent[id],EV_FL_fuser1) + 1.0
entity_set_float(para_ent[id],EV_FL_fuser1,frame)
entity_set_float(para_ent[id],EV_FL_frame,frame)
 
if (frame > 100.0) {
entity_set_float(para_ent[id], EV_FL_animtime, 0.0)
entity_set_float(para_ent[id], EV_FL_framerate, 0.4)
entity_set_int(para_ent[id], EV_INT_sequence, 1)
entity_set_int(para_ent[id], EV_INT_gaitsequence, 1)
entity_set_float(para_ent[id], EV_FL_frame, 0.0)
entity_set_float(para_ent[id], EV_FL_fuser1, 0.0)
}
}
}
}
else if (para_ent[id] > 0) {
remove_entity(para_ent[id])
set_user_gravity(id, 1.0)
para_ent[id] = 0
}
}
else if ((oldbutton & IN_USE) && para_ent[id] > 0 ) {
remove_entity(para_ent[id])
set_user_gravity(id, 1.0)
para_ent[id] = 0
}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1038\\ f0\\ fs16 \n\\ par }
*/
 


Ez ejtőernyő ő pedig dupla ugrást kért!

_________________
https://www.youtube.com/watch?v=UAg0wCTanbM


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: 2ugrásos Knife Mod
HozzászólásElküldve: 2015.01.04. 14:53 
Offline
Nagyúr
Avatar

Csatlakozott: 2014.04.10. 15:32
Hozzászólások: 776
Megköszönt másnak: 122 alkalommal
Megköszönték neki: 60 alkalommal
Hydra ツ írta:
NuD[!]e írta:
Csatolom hozzá akkor!:)
SMA Forráskód: [ Mindet kijelol ]#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <cstrike>
#include <fun>
 
new bool:has_parachute[33]
new para_ent[33]
new gCStrike = 0
new pDetach, pFallSpeed, pEnabled, pCost, pPayback
 
#define PARACHUTE_LEVEL ADMIN_LEVEL_A
 
public plugin_init()
{
register_plugin("Parachute", "1.3", "KRoT@L/JTP10181")
pEnabled = register_cvar("sv_parachute", "1" )
pFallSpeed = register_cvar("parachute_fallspeed", "100")
pDetach = register_cvar("parachute_detach", "1")
 
if (cstrike_running()) gCStrike = true
 
if (gCStrike) {
 
pCost = register_cvar("parachute_cost", "1000")
pPayback = register_cvar("parachute_payback", "75")
 
register_concmd("amx_parachute", "admin_give_parachute", PARACHUTE_LEVEL, "<nick, #userid or @team>" )
}
 
register_clcmd("say", "HandleSay")
register_clcmd("say_team", "HandleSay")
 
register_event("ResetHUD", "newSpawn", "be")
register_event("DeathMsg", "death_event", "a")
 
//Setup jtp10181 CVAR
new cvarString[256], shortName[16]
copy(shortName,15,"chute")
 
register_cvar("jtp10181","",FCVAR_SERVER|FCVAR_SPONLY)
get_cvar_string("jtp10181",cvarString,255)
 
if (strlen(cvarString) == 0) {
formatex(cvarString,255,shortName)
set_cvar_string("jtp10181",cvarString)
}
else if (contain(cvarString,shortName) == -1) {
format(cvarString,255,"%s,%s",cvarString, shortName)
set_cvar_string("jtp10181",cvarString)
}
}
 
public plugin_natives()
{
set_module_filter("module_filter")
set_native_filter("native_filter")
}
 
public module_filter(const module[])
{
if (!cstrike_running() && equali(module, "cstrike")) {
return PLUGIN_HANDLED
}
 
return PLUGIN_CONTINUE
}
 
public native_filter(const name[], index, trap)
{
if (!trap) return PLUGIN_HANDLED
 
return PLUGIN_CONTINUE
}
 
public plugin_precache()
{
precache_model("models/parachute.mdl")
}
 
public client_connect(id)
{
parachute_reset(id)
}
 
public client_disconnect(id)
{
parachute_reset(id)
}
 
public death_event()
{
new id = read_data(2)
parachute_reset(id)
}
 
parachute_reset(id)
{
if(para_ent[id] > 0) {
if (is_valid_ent(para_ent[id])) {
remove_entity(para_ent[id])
}
}
 
if (is_user_alive(id)) set_user_gravity(id, 1.0)
 
has_parachute[id] = false
para_ent[id] = 0
}
 
public newSpawn(id)
{
if(para_ent[id] > 0) {
remove_entity(para_ent[id])
set_user_gravity(id, 1.0)
para_ent[id] = 0
}
 
if (!gCStrike || access(id,PARACHUTE_LEVEL) || get_pcvar_num(pCost) <= 0) {
has_parachute[id] = true
//set_view(id, CAMERA_3RDPERSON)
}
}
 
public HandleSay(id)
{
if(!is_user_connected(id)) return PLUGIN_CONTINUE
 
new args[128]
read_args(args, 127)
remove_quotes(args)
 
if (gCStrike) {
if (equali(args, "buy_parachute")) {
buy_parachute(id)
return PLUGIN_HANDLED
}
else if (equali(args, "sell_parachute")) {
sell_parachute(id)
return PLUGIN_HANDLED
}
else if (containi(args, "give_parachute") == 0) {
give_parachute(id,args[15])
return PLUGIN_HANDLED
}
}
 
if (containi(args, "parachute") != -1) {
if (gCStrike) client_print(id, print_chat, "[AMXX] Ejt�erny� parancsok: buy_parachute, sell_parachute, give_parachute")
client_print(id, print_chat, "[AMXX] Az ejt�erny� haszn�lat�hoz nyomd meg az E bet�t")
}
 
return PLUGIN_CONTINUE
}
 
public buy_parachute(id)
{
if (!gCStrike) return PLUGIN_CONTINUE
if (!is_user_connected(id)) return PLUGIN_CONTINUE
 
if (!get_pcvar_num(pEnabled)) {
client_print(id, print_chat, "[AMXX] Ejt�erny� plugin kikapcsolva")
return PLUGIN_HANDLED
}
 
if (has_parachute[id]) {
client_print(id, print_chat, "[AMXX] Neked m�r van ejt�erny�d")
return PLUGIN_HANDLED
}
 
new money = cs_get_user_money(id)
new cost = get_pcvar_num(pCost)
 
if (money < cost) {
client_print(id, print_chat, "[AMXX] Nincs el�g p�nzed az ejt�erny� v�s�rl�s�hoz - Costs $%i", cost)
return PLUGIN_HANDLED
}
 
cs_set_user_money(id, money - cost)
client_print(id, print_chat, "[AMXX] Vett�l egy ejt�erny�t Haszn�lathoz nyomd meg az E bet�t")
has_parachute[id] = true
 
return PLUGIN_HANDLED
}
 
public sell_parachute(id)
{
if (!gCStrike) return PLUGIN_CONTINUE
if (!is_user_connected(id)) return PLUGIN_CONTINUE
 
if (!get_pcvar_num(pEnabled)) {
client_print(id, print_chat, "[AMXX] Ejt�erny� plugin kikapcsolva")
return PLUGIN_HANDLED
}
 
if (!has_parachute[id]) {
client_print(id, print_chat, "[AMXX] Neked nincs ejt�erny�d ez�rt nem tudod eladni")
return PLUGIN_HANDLED
}
 
if (access(id,PARACHUTE_LEVEL)) {
client_print(id, print_chat, "[AMXX] Te nem adhatod el az admin �ltal adott ingyen ejt�erny�t!")
return PLUGIN_HANDLED
}
 
parachute_reset(id)
 
new money = cs_get_user_money(id)
new cost = get_pcvar_num(pCost)
 
new sellamt = floatround(cost * (get_pcvar_num(pPayback) / 100.0))
cs_set_user_money(id, money + sellamt)
 
client_print(id, print_chat, "[AMX] Eladtad a haszn�lt ejt�erny�d ennyi�rt: $%d", sellamt)
 
return PLUGIN_CONTINUE
}
 
public give_parachute(id,args[])
{
if (!gCStrike) return PLUGIN_CONTINUE
if (!is_user_connected(id)) return PLUGIN_CONTINUE
 
if (!get_pcvar_num(pEnabled)) {
client_print(id, print_chat, "[AMXX] Ejt�erny� plugin bekapcsolva")
return PLUGIN_HANDLED
}
 
if (!has_parachute[id]) {
client_print(id, print_chat, "[AMXX] Te nem tudod haszn�lni az ejt�erny�d mert nincs.")
return PLUGIN_HANDLED
}
 
new player = cmd_target(id, args, 4)
if (!player) return PLUGIN_HANDLED
 
new id_name[32], pl_name[32]
get_user_name(id, id_name, 31)
get_user_name(player, pl_name, 31)
 
if(has_parachute[player]) {
client_print(id, print_chat, "[AMXX] %s m�r van ejt�erny�je.", pl_name)
return PLUGIN_HANDLED
}
 
parachute_reset(id)
has_parachute[player] = true
 
client_print(id, print_chat, "[AMXX] Adt�l ejt�erny�t neki : %s.", pl_name)
client_print(player, print_chat, "[AMXX] %s haszn�lja az ejt�erny�t amit te adt�l neki.", id_name)
 
return PLUGIN_HANDLED
}
 
public admin_give_parachute(id, level, cid) {
 
if (!gCStrike) return PLUGIN_CONTINUE
 
if(!cmd_access(id,level,cid,2)) return PLUGIN_HANDLED
 
if (!get_pcvar_num(pEnabled)) {
client_print(id, print_chat, "[AMXX] ejt�erny� plugin kikapcsolva")
return PLUGIN_HANDLED
}
 
new arg[32], name[32], name2[32], authid[35], authid2[35]
read_argv(1,arg,31)
get_user_name(id,name,31)
get_user_authid(id,authid,34)
 
if (arg[0]=='@'){
new players[32], inum
if (equali("T",arg[1])) copy(arg[1],31,"TERRORIST")
if (equali("ALL",arg[1])) get_players(players,inum)
else get_players(players,inum,"e",arg[1])
 
if (inum == 0) {
console_print(id,"No clients in such team")
return PLUGIN_HANDLED
}
 
for(new a = 0; a < inum; a++) {
has_parachute[players[a]] = true
}
 
switch(get_cvar_num("amx_show_activity")) {
case 2: client_print(0,print_chat,"ADMIN %s: adott egy ejt�erny�t ^"%s^" playernek",name,arg[1])
case 1: client_print(0,print_chat,"ADMIN: Adott egy ejt�erny�t ^"%s^" playernek",arg[1])
}
 
console_print(id,"[AMXX] Te adt�l egy ejt�erny�t ^"%s^" playernek",arg[1])
log_amx("^"%s<%d><%s><>^" adt�l ejt�erny�t ^"%s^"", name,get_user_userid(id),authid,arg[1])
}
else {
 
new player = cmd_target(id,arg,6)
if (!player) return PLUGIN_HANDLED
 
has_parachute[player] = true
 
get_user_name(player,name2,31)
get_user_authid(player,authid2,34)
 
switch(get_cvar_num("amx_show_activity")) {
case 2: client_print(0,print_chat,"ADMIN %s: adt�l ejt�erny�t ^"%s^"",name,name2)
case 1: client_print(0,print_chat,"ADMIN: adt�l ejt�erny�t ^"%s^"",name2)
}
 
console_print(id,"[AMXX] te adt�l ejt�erny�t ^"%s^"", name2)
log_amx("^"%s<%d><%s><>^" adt�l ejt�erny�t ^"%s<%d><%s><>^"", name,get_user_userid(id),authid,name2,get_user_userid(player),authid2)
}
return PLUGIN_HANDLED
}
 
public client_PreThink(id)
{
//parachute.mdl animation information
//0 - deploy - 84 frames
//1 - idle - 39 frames
//2 - detach - 29 frames
 
if (!get_pcvar_num(pEnabled)) return
if (!is_user_alive(id) || !has_parachute[id]) return
 
new Float:fallspeed = get_pcvar_float(pFallSpeed) * -1.0
new Float:frame
 
new button = get_user_button(id)
new oldbutton = get_user_oldbutton(id)
new flags = get_entity_flags(id)
 
if (para_ent[id] > 0 && (flags & FL_ONGROUND)) {
 
if (get_pcvar_num(pDetach)) {
 
if (get_user_gravity(id) == 0.1) set_user_gravity(id, 1.0)
 
if (entity_get_int(para_ent[id],EV_INT_sequence) != 2) {
entity_set_int(para_ent[id], EV_INT_sequence, 2)
entity_set_int(para_ent[id], EV_INT_gaitsequence, 1)
entity_set_float(para_ent[id], EV_FL_frame, 0.0)
entity_set_float(para_ent[id], EV_FL_fuser1, 0.0)
entity_set_float(para_ent[id], EV_FL_animtime, 0.0)
entity_set_float(para_ent[id], EV_FL_framerate, 0.0)
return
}
 
frame = entity_get_float(para_ent[id],EV_FL_fuser1) + 2.0
entity_set_float(para_ent[id],EV_FL_fuser1,frame)
entity_set_float(para_ent[id],EV_FL_frame,frame)
 
if (frame > 254.0) {
remove_entity(para_ent[id])
para_ent[id] = 0
}
}
else {
remove_entity(para_ent[id])
set_user_gravity(id, 1.0)
para_ent[id] = 0
}
 
return
}
 
if (button & IN_USE) {
 
new Float:velocity[3]
entity_get_vector(id, EV_VEC_velocity, velocity)
 
if (velocity[2] < 0.0) {
 
if(para_ent[id] <= 0) {
para_ent[id] = create_entity("info_target")
if(para_ent[id] > 0) {
entity_set_string(para_ent[id],EV_SZ_classname,"parachute")
entity_set_edict(para_ent[id], EV_ENT_aiment, id)
entity_set_edict(para_ent[id], EV_ENT_owner, id)
entity_set_int(para_ent[id], EV_INT_movetype, MOVETYPE_FOLLOW)
entity_set_model(para_ent[id], "models/parachute.mdl")
entity_set_int(para_ent[id], EV_INT_sequence, 0)
entity_set_int(para_ent[id], EV_INT_gaitsequence, 1)
entity_set_float(para_ent[id], EV_FL_frame, 0.0)
entity_set_float(para_ent[id], EV_FL_fuser1, 0.0)
}
}
 
if (para_ent[id] > 0) {
 
entity_set_int(id, EV_INT_sequence, 3)
entity_set_int(id, EV_INT_gaitsequence, 1)
entity_set_float(id, EV_FL_frame, 1.0)
entity_set_float(id, EV_FL_framerate, 1.0)
set_user_gravity(id, 0.1)
 
velocity[2] = (velocity[2] + 40.0 < fallspeed) ? velocity[2] + 40.0 : fallspeed
entity_set_vector(id, EV_VEC_velocity, velocity)
 
if (entity_get_int(para_ent[id],EV_INT_sequence) == 0) {
 
frame = entity_get_float(para_ent[id],EV_FL_fuser1) + 1.0
entity_set_float(para_ent[id],EV_FL_fuser1,frame)
entity_set_float(para_ent[id],EV_FL_frame,frame)
 
if (frame > 100.0) {
entity_set_float(para_ent[id], EV_FL_animtime, 0.0)
entity_set_float(para_ent[id], EV_FL_framerate, 0.4)
entity_set_int(para_ent[id], EV_INT_sequence, 1)
entity_set_int(para_ent[id], EV_INT_gaitsequence, 1)
entity_set_float(para_ent[id], EV_FL_frame, 0.0)
entity_set_float(para_ent[id], EV_FL_fuser1, 0.0)
}
}
}
}
else if (para_ent[id] > 0) {
remove_entity(para_ent[id])
set_user_gravity(id, 1.0)
para_ent[id] = 0
}
}
else if ((oldbutton & IN_USE) && para_ent[id] > 0 ) {
remove_entity(para_ent[id])
set_user_gravity(id, 1.0)
para_ent[id] = 0
}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1038\\ f0\\ fs16 \n\\ par }
*/
 


Ez ejtőernyő ő pedig dupla ugrást kért!


Hagyd,nem érti,nem tudja felfogni

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: 2ugrásos Knife Mod
HozzászólásElküldve: 2015.01.04. 14:56 
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
jah xd bocsi félre nézem
1.
Kód:
callfunc_begin ("amx_maxjumps" , "MultiJump")
    callfunc_push_int (id)
    callfunc_push_int (0)
    callfunc_end ()




2.
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <engine>
  4.  
  5. #define ADMINACCESS ADMIN_CHAT
  6.  
  7. new jumpnum[33] = 0
  8. new bool:dojump[33] = false
  9.  
  10. public plugin_init()
  11. {
  12. register_plugin("MultiJump","1.1","twistedeuphoria")
  13. register_cvar("amx_maxjumps","1")
  14. register_cvar("amx_mjadminonly","0")
  15. }
  16.  
  17. public client_putinserver(id)
  18. {
  19. jumpnum[id] = 0
  20. dojump[id] = false
  21. }
  22.  
  23. public client_disconnect(id)
  24. {
  25. jumpnum[id] = 0
  26. dojump[id] = false
  27. }
  28.  
  29. public client_PreThink(id)
  30. {
  31. if(!is_user_alive(id)) return PLUGIN_CONTINUE
  32. if(get_cvar_num("amx_mjadminonly") && (!access(id,ADMINACCESS))) return PLUGIN_CONTINUE
  33. new nbut = get_user_button(id)
  34. new obut = get_user_oldbutton(id)
  35. if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
  36. {
  37. if(jumpnum[id] < get_cvar_num("amx_maxjumps"))
  38. {
  39. dojump[id] = true
  40. jumpnum[id]++
  41. return PLUGIN_CONTINUE
  42. }
  43. }
  44. if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
  45. {
  46. jumpnum[id] = 0
  47. return PLUGIN_CONTINUE
  48. }
  49. return PLUGIN_CONTINUE
  50. }
  51.  
  52. public client_PostThink(id)
  53. {
  54. if(!is_user_alive(id)) return PLUGIN_CONTINUE
  55. if(get_cvar_num("amx_mjadminonly") && (!access(id,ADMINACCESS))) return PLUGIN_CONTINUE
  56. if(dojump[id] == true)
  57. {
  58. new Float:velocity[3]
  59. entity_get_vector(id,EV_VEC_velocity,velocity)
  60. velocity[2] = random_float(265.0,285.0)
  61. entity_set_vector(id,EV_VEC_velocity,velocity)
  62. dojump[id] = false
  63. return PLUGIN_CONTINUE
  64. }
  65. return PLUGIN_CONTINUE
  66. }


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: 2ugrásos Knife Mod
HozzászólásElküldve: 2015.01.04. 15:23 
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
Köszi csináltam új menü pontot de hova írjam amit írtál?

_________________
NEW IP:
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: 2ugrásos Knife Mod
HozzászólásElküldve: 2015.01.04. 16:01 
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
a menüpont alá..

pl
case 2:{
és ide


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: 2ugrásos Knife Mod
HozzászólásElküldve: 2015.01.04. 23:04 
Offline
Veterán
Avatar

Csatlakozott: 2013.03.26. 20:20
Hozzászólások: 1846
Megköszönt másnak: 27 alkalommal
Megköszönték neki: 120 alkalommal
Ez így nem jó
SMA Forráskód: [ Mindet kijelol ]
  1. callfunc_begin("amx_maxjumps" , "MultiJump")


1. paraméter a függvény, amit meghívunk (csakis publikus lehet (public))
2. paraméter a plugin neve .amxx kiterjesztéssel

_________________
Projektem:

[CSO2] Ghost Mod
CSO2 GamePlay video: https://www.youtube.com/watch?feature=p ... iOS4Ik1Yrk


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  [ 13 hozzászólás ]  Oldal 1 2 Következő


Ki van itt

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