hlmod.hu

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



Jelenlévő felhasználók

Jelenleg 199 felhasználó van jelen :: 0 regisztrált, 0 rejtett és 199 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: Ejtőernyő Átírása!
HozzászólásElküldve: 2015.04.03. 14:43 
Offline
Jómunkásember
Avatar

Csatlakozott: 2014.10.31. 14:51
Hozzászólások: 462
Megköszönt másnak: 73 alkalommal
Megköszönték neki: 29 alkalommal
Sziasztok!
A modeelt átírnátok erre : explosive_ejto.mdl ? Mert nekem mindig kifagy és nem tudom miért.!

SMA:
SMA Forráskód: [ Mindet kijelol ]
  1. /*******************************************************************************
  2.  
  3.   Parachute
  4.  
  5.   Version: 1.3
  6.   Author: KRoTaL/JTP10181
  7.  
  8.   0.1 Release
  9.   0.1.1 Players can't buy a parachute if they already own one
  10.   0.1.2 Release for AMX MOD X
  11.   0.1.3 Minor changes
  12.   0.1.4 Players lose their parachute if they die
  13.   0.1.5 Added amx_parachute cvar
  14.   0.1.6 Changed set_origin to movetype_follow (you won't see your own parachute)
  15.   0.1.7 Added amx_parachute <name> | admins with admin level a get a free parachute
  16.   0.1.8 JTP - Cleaned up code, fixed runtime error
  17.   1.0 JTP - Should be final version, made it work on basically any mod
  18.   1.1 JTP - Added Changes from AMX Version 0.1.8
  19. Added say give_parachute and parachute_fallspeed cvar
  20.   Plays the release animation when you touch the ground
  21.   Added chat responder for automatic help
  22.   1.2 JTP - Added cvar to disable the detach animation
  23.   Redid animation code to improve organization
  24.   Force "walk" animation on players when falling
  25.   Change users gravity when falling to avoid choppiness
  26.   1.3 JTP - Upgraded to pCVARs
  27.  
  28.   Commands:
  29.  
  30. say buy_parachute - buys a parachute (CStrike ONLY)
  31. saw sell_parachute - sells your parachute (75% of the purchase price)
  32. say give_parachute <nick, #userid or @team> - gives your parachute to the player
  33.  
  34. amx_parachute <nick, #userid or @team> - gives a player a free parachute (CStrike ONLY)
  35. amx_parachute @all - gives everyone a free parachute (CStrike ONLY)
  36.  
  37. Press +use to slow down your fall.
  38.  
  39.   Cvars:
  40.  
  41. sv_parachute "1" - 0: disables the plugin - 1: enables the plugin
  42.  
  43. parachute_cost "1000" - cost of the parachute (CStrike ONLY)
  44.  
  45. parachute_payback "75" - how many percent of the parachute cost you get when you sell your parachute
  46. (ie. (75/100) * 1000 = 750$)
  47.  
  48. parachute_fallspeed "100" - speed of the fall when you use the parachute
  49.  
  50.  
  51.   Setup (AMXX 1.x):
  52.  
  53. Install the amxx file.
  54. Enable engine and cstrike (for cs only) in the amxx modules.ini
  55. Put the parachute.mdl file in the modname/models/ folder
  56.  
  57. *******************************************************************************/
  58.  
  59. #include <amxmodx>
  60. #include <amxmisc>
  61. #include <engine>
  62. #include <cstrike>
  63. #include <fun>
  64.  
  65. new bool:has_parachute[33]
  66. new para_ent[33]
  67. new gCStrike = 0
  68. new pDetach, pFallSpeed, pEnabled, pCost, pPayback
  69.  
  70. #define PARACHUTE_LEVEL ADMIN_LEVEL_A
  71.  
  72. public plugin_init()
  73. {
  74. register_plugin("Parachute", "1.3", "KRoT@L/JTP10181")
  75. pEnabled = register_cvar("sv_parachute", "1" )
  76. pFallSpeed = register_cvar("parachute_fallspeed", "100")
  77. pDetach = register_cvar("parachute_detach", "1")
  78.  
  79. if (cstrike_running()) gCStrike = true
  80.  
  81. if (gCStrike) {
  82.  
  83. pCost = register_cvar("parachute_cost", "1000")
  84. pPayback = register_cvar("parachute_payback", "75")
  85.  
  86. register_concmd("amx_parachute", "admin_give_parachute", PARACHUTE_LEVEL, "<nick, #userid or @team>" )
  87. }
  88.  
  89. register_clcmd("say", "HandleSay")
  90. register_clcmd("say_team", "HandleSay")
  91.  
  92. register_event("ResetHUD", "newSpawn", "be")
  93. register_event("DeathMsg", "death_event", "a")
  94.  
  95. //Setup jtp10181 CVAR
  96. new cvarString[256], shortName[16]
  97. copy(shortName,15,"chute")
  98.  
  99. register_cvar("jtp10181","",FCVAR_SERVER|FCVAR_SPONLY)
  100. get_cvar_string("jtp10181",cvarString,255)
  101.  
  102. if (strlen(cvarString) == 0) {
  103. formatex(cvarString,255,shortName)
  104. set_cvar_string("jtp10181",cvarString)
  105. }
  106. else if (contain(cvarString,shortName) == -1) {
  107. format(cvarString,255,"%s,%s",cvarString, shortName)
  108. set_cvar_string("jtp10181",cvarString)
  109. }
  110. }
  111.  
  112. public plugin_natives()
  113. {
  114. set_module_filter("module_filter")
  115. set_native_filter("native_filter")
  116. }
  117.  
  118. public module_filter(const module[])
  119. {
  120. if (!cstrike_running() && equali(module, "cstrike")) {
  121. return PLUGIN_HANDLED
  122. }
  123.  
  124. return PLUGIN_CONTINUE
  125. }
  126.  
  127. public native_filter(const name[], index, trap)
  128. {
  129. if (!trap) return PLUGIN_HANDLED
  130.  
  131. return PLUGIN_CONTINUE
  132. }
  133.  
  134. public plugin_precache()
  135. {
  136. precache_model("models/parachute.mdl")
  137. }
  138.  
  139. public client_connect(id)
  140. {
  141. parachute_reset(id)
  142. }
  143.  
  144. public client_disconnect(id)
  145. {
  146. parachute_reset(id)
  147. }
  148.  
  149. public death_event()
  150. {
  151. new id = read_data(2)
  152. parachute_reset(id)
  153. }
  154.  
  155. parachute_reset(id)
  156. {
  157. if(para_ent[id] > 0) {
  158. if (is_valid_ent(para_ent[id])) {
  159. remove_entity(para_ent[id])
  160. }
  161. }
  162.  
  163. if (is_user_alive(id)) set_user_gravity(id, 1.0)
  164.  
  165. has_parachute[id] = false
  166. para_ent[id] = 0
  167. }
  168.  
  169. public newSpawn(id)
  170. {
  171. if(para_ent[id] > 0) {
  172. remove_entity(para_ent[id])
  173. set_user_gravity(id, 1.0)
  174. para_ent[id] = 0
  175. }
  176.  
  177. if (!gCStrike || access(id,PARACHUTE_LEVEL) || get_pcvar_num(pCost) <= 0) {
  178. has_parachute[id] = true
  179. //set_view(id, CAMERA_3RDPERSON)
  180. }
  181. }
  182.  
  183. public HandleSay(id)
  184. {
  185. if(!is_user_connected(id)) return PLUGIN_CONTINUE
  186.  
  187. new args[128]
  188. read_args(args, 127)
  189. remove_quotes(args)
  190.  
  191. if (gCStrike) {
  192. if (equali(args, "buy_parachute")) {
  193. buy_parachute(id)
  194. return PLUGIN_HANDLED
  195. }
  196. else if (equali(args, "sell_parachute")) {
  197. sell_parachute(id)
  198. return PLUGIN_HANDLED
  199. }
  200. else if (containi(args, "give_parachute") == 0) {
  201. give_parachute(id,args[15])
  202. return PLUGIN_HANDLED
  203. }
  204. }
  205.  
  206. if (containi(args, "parachute") != -1) {
  207. if (gCStrike) client_print(id, print_chat, "[AMXX] Ejt�erny� parancsok: buy_parachute, sell_parachute, give_parachute")
  208. client_print(id, print_chat, "[AMXX] Az ejt�erny� haszn�lat�hoz nyomd meg az E bet�t")
  209. }
  210.  
  211. return PLUGIN_CONTINUE
  212. }
  213.  
  214. public buy_parachute(id)
  215. {
  216. if (!gCStrike) return PLUGIN_CONTINUE
  217. if (!is_user_connected(id)) return PLUGIN_CONTINUE
  218.  
  219. if (!get_pcvar_num(pEnabled)) {
  220. client_print(id, print_chat, "[AMXX] Ejt�erny� plugin kikapcsolva")
  221. return PLUGIN_HANDLED
  222. }
  223.  
  224. if (has_parachute[id]) {
  225. client_print(id, print_chat, "[AMXX] Neked m�r van ejt�erny�d")
  226. return PLUGIN_HANDLED
  227. }
  228.  
  229. new money = cs_get_user_money(id)
  230. new cost = get_pcvar_num(pCost)
  231.  
  232. if (money < cost) {
  233. client_print(id, print_chat, "[AMXX] Nincs el�g p�nzed az ejt�erny� v�s�rl�s�hoz - Costs $%i", cost)
  234. return PLUGIN_HANDLED
  235. }
  236.  
  237. cs_set_user_money(id, money - cost)
  238. client_print(id, print_chat, "[AMXX] Vett�l egy ejt�erny�t Haszn�lathoz nyomd meg az E bet�t")
  239. has_parachute[id] = true
  240.  
  241. return PLUGIN_HANDLED
  242. }
  243.  
  244. public sell_parachute(id)
  245. {
  246. if (!gCStrike) return PLUGIN_CONTINUE
  247. if (!is_user_connected(id)) return PLUGIN_CONTINUE
  248.  
  249. if (!get_pcvar_num(pEnabled)) {
  250. client_print(id, print_chat, "[AMXX] Ejt�erny� plugin kikapcsolva")
  251. return PLUGIN_HANDLED
  252. }
  253.  
  254. if (!has_parachute[id]) {
  255. client_print(id, print_chat, "[AMXX] Neked nincs ejt�erny�d ez�rt nem tudod eladni")
  256. return PLUGIN_HANDLED
  257. }
  258.  
  259. if (access(id,PARACHUTE_LEVEL)) {
  260. client_print(id, print_chat, "[AMXX] Te nem adhatod el az admin �ltal adott ingyen ejt�erny�t!")
  261. return PLUGIN_HANDLED
  262. }
  263.  
  264. parachute_reset(id)
  265.  
  266. new money = cs_get_user_money(id)
  267. new cost = get_pcvar_num(pCost)
  268.  
  269. new sellamt = floatround(cost * (get_pcvar_num(pPayback) / 100.0))
  270. cs_set_user_money(id, money + sellamt)
  271.  
  272. client_print(id, print_chat, "[AMX] Eladtad a haszn�lt ejt�erny�d ennyi�rt: $%d", sellamt)
  273.  
  274. return PLUGIN_CONTINUE
  275. }
  276.  
  277. public give_parachute(id,args[])
  278. {
  279. if (!gCStrike) return PLUGIN_CONTINUE
  280. if (!is_user_connected(id)) return PLUGIN_CONTINUE
  281.  
  282. if (!get_pcvar_num(pEnabled)) {
  283. client_print(id, print_chat, "[AMXX] Ejt�erny� plugin bekapcsolva")
  284. return PLUGIN_HANDLED
  285. }
  286.  
  287. if (!has_parachute[id]) {
  288. client_print(id, print_chat, "[AMXX] Te nem tudod haszn�lni az ejt�erny�d mert nincs.")
  289. return PLUGIN_HANDLED
  290. }
  291.  
  292. new player = cmd_target(id, args, 4)
  293. if (!player) return PLUGIN_HANDLED
  294.  
  295. new id_name[32], pl_name[32]
  296. get_user_name(id, id_name, 31)
  297. get_user_name(player, pl_name, 31)
  298.  
  299. if(has_parachute[player]) {
  300. client_print(id, print_chat, "[AMXX] %s m�r van ejt�erny�je.", pl_name)
  301. return PLUGIN_HANDLED
  302. }
  303.  
  304. parachute_reset(id)
  305. has_parachute[player] = true
  306.  
  307. client_print(id, print_chat, "[AMXX] Adt�l ejt�erny�t neki : %s.", pl_name)
  308. client_print(player, print_chat, "[AMXX] %s haszn�lja az ejt�erny�t amit te adt�l neki.", id_name)
  309.  
  310. return PLUGIN_HANDLED
  311. }
  312.  
  313. public admin_give_parachute(id, level, cid) {
  314.  
  315. if (!gCStrike) return PLUGIN_CONTINUE
  316.  
  317. if(!cmd_access(id,level,cid,2)) return PLUGIN_HANDLED
  318.  
  319. if (!get_pcvar_num(pEnabled)) {
  320. client_print(id, print_chat, "[AMXX] ejt�erny� plugin kikapcsolva")
  321. return PLUGIN_HANDLED
  322. }
  323.  
  324. new arg[32], name[32], name2[32], authid[35], authid2[35]
  325. read_argv(1,arg,31)
  326. get_user_name(id,name,31)
  327. get_user_authid(id,authid,34)
  328.  
  329. if (arg[0]=='@'){
  330. new players[32], inum
  331. if (equali("T",arg[1])) copy(arg[1],31,"TERRORIST")
  332. if (equali("ALL",arg[1])) get_players(players,inum)
  333. else get_players(players,inum,"e",arg[1])
  334.  
  335. if (inum == 0) {
  336. console_print(id,"No clients in such team")
  337. return PLUGIN_HANDLED
  338. }
  339.  
  340. for(new a = 0; a < inum; a++) {
  341. has_parachute[players[a]] = true
  342. }
  343.  
  344. switch(get_cvar_num("amx_show_activity")) {
  345. case 2: client_print(0,print_chat,"ADMIN %s: adott egy ejt�erny�t ^"%s^" playernek",name,arg[1])
  346. case 1: client_print(0,print_chat,"ADMIN: Adott egy ejt�erny�t ^"%s^" playernek",arg[1])
  347. }
  348.  
  349. console_print(id,"[AMXX] Te adt�l egy ejt�erny�t ^"%s^" playernek",arg[1])
  350. log_amx("^"%s<%d><%s><>^" adt�l ejt�erny�t ^"%s^"", name,get_user_userid(id),authid,arg[1])
  351. }
  352. else {
  353.  
  354. new player = cmd_target(id,arg,6)
  355. if (!player) return PLUGIN_HANDLED
  356.  
  357. has_parachute[player] = true
  358.  
  359. get_user_name(player,name2,31)
  360. get_user_authid(player,authid2,34)
  361.  
  362. switch(get_cvar_num("amx_show_activity")) {
  363. case 2: client_print(0,print_chat,"ADMIN %s: adt�l ejt�erny�t ^"%s^"",name,name2)
  364. case 1: client_print(0,print_chat,"ADMIN: adt�l ejt�erny�t ^"%s^"",name2)
  365. }
  366.  
  367. console_print(id,"[AMXX] te adt�l ejt�erny�t ^"%s^"", name2)
  368. 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)
  369. }
  370. return PLUGIN_HANDLED
  371. }
  372.  
  373. public client_PreThink(id)
  374. {
  375. //parachute.mdl animation information
  376. //0 - deploy - 84 frames
  377. //1 - idle - 39 frames
  378. //2 - detach - 29 frames
  379.  
  380. if (!get_pcvar_num(pEnabled)) return
  381. if (!is_user_alive(id) || !has_parachute[id]) return
  382.  
  383. new Float:fallspeed = get_pcvar_float(pFallSpeed) * -1.0
  384. new Float:frame
  385.  
  386. new button = get_user_button(id)
  387. new oldbutton = get_user_oldbutton(id)
  388. new flags = get_entity_flags(id)
  389.  
  390. if (para_ent[id] > 0 && (flags & FL_ONGROUND)) {
  391.  
  392. if (get_pcvar_num(pDetach)) {
  393.  
  394. if (get_user_gravity(id) == 0.1) set_user_gravity(id, 1.0)
  395.  
  396. if (entity_get_int(para_ent[id],EV_INT_sequence) != 2) {
  397. entity_set_int(para_ent[id], EV_INT_sequence, 2)
  398. entity_set_int(para_ent[id], EV_INT_gaitsequence, 1)
  399. entity_set_float(para_ent[id], EV_FL_frame, 0.0)
  400. entity_set_float(para_ent[id], EV_FL_fuser1, 0.0)
  401. entity_set_float(para_ent[id], EV_FL_animtime, 0.0)
  402. entity_set_float(para_ent[id], EV_FL_framerate, 0.0)
  403. return
  404. }
  405.  
  406. frame = entity_get_float(para_ent[id],EV_FL_fuser1) + 2.0
  407. entity_set_float(para_ent[id],EV_FL_fuser1,frame)
  408. entity_set_float(para_ent[id],EV_FL_frame,frame)
  409.  
  410. if (frame > 254.0) {
  411. remove_entity(para_ent[id])
  412. para_ent[id] = 0
  413. }
  414. }
  415. else {
  416. remove_entity(para_ent[id])
  417. set_user_gravity(id, 1.0)
  418. para_ent[id] = 0
  419. }
  420.  
  421. return
  422. }
  423.  
  424. if (button & IN_USE) {
  425.  
  426. new Float:velocity[3]
  427. entity_get_vector(id, EV_VEC_velocity, velocity)
  428.  
  429. if (velocity[2] < 0.0) {
  430.  
  431. if(para_ent[id] <= 0) {
  432. para_ent[id] = create_entity("info_target")
  433. if(para_ent[id] > 0) {
  434. entity_set_string(para_ent[id],EV_SZ_classname,"parachute")
  435. entity_set_edict(para_ent[id], EV_ENT_aiment, id)
  436. entity_set_edict(para_ent[id], EV_ENT_owner, id)
  437. entity_set_int(para_ent[id], EV_INT_movetype, MOVETYPE_FOLLOW)
  438. entity_set_model(para_ent[id], "models/parachute.mdl")
  439. entity_set_int(para_ent[id], EV_INT_sequence, 0)
  440. entity_set_int(para_ent[id], EV_INT_gaitsequence, 1)
  441. entity_set_float(para_ent[id], EV_FL_frame, 0.0)
  442. entity_set_float(para_ent[id], EV_FL_fuser1, 0.0)
  443. }
  444. }
  445.  
  446. if (para_ent[id] > 0) {
  447.  
  448. entity_set_int(id, EV_INT_sequence, 3)
  449. entity_set_int(id, EV_INT_gaitsequence, 1)
  450. entity_set_float(id, EV_FL_frame, 1.0)
  451. entity_set_float(id, EV_FL_framerate, 1.0)
  452. set_user_gravity(id, 0.1)
  453.  
  454. velocity[2] = (velocity[2] + 40.0 < fallspeed) ? velocity[2] + 40.0 : fallspeed
  455. entity_set_vector(id, EV_VEC_velocity, velocity)
  456.  
  457. if (entity_get_int(para_ent[id],EV_INT_sequence) == 0) {
  458.  
  459. frame = entity_get_float(para_ent[id],EV_FL_fuser1) + 1.0
  460. entity_set_float(para_ent[id],EV_FL_fuser1,frame)
  461. entity_set_float(para_ent[id],EV_FL_frame,frame)
  462.  
  463. if (frame > 100.0) {
  464. entity_set_float(para_ent[id], EV_FL_animtime, 0.0)
  465. entity_set_float(para_ent[id], EV_FL_framerate, 0.4)
  466. entity_set_int(para_ent[id], EV_INT_sequence, 1)
  467. entity_set_int(para_ent[id], EV_INT_gaitsequence, 1)
  468. entity_set_float(para_ent[id], EV_FL_frame, 0.0)
  469. entity_set_float(para_ent[id], EV_FL_fuser1, 0.0)
  470. }
  471. }
  472. }
  473. }
  474. else if (para_ent[id] > 0) {
  475. remove_entity(para_ent[id])
  476. set_user_gravity(id, 1.0)
  477. para_ent[id] = 0
  478. }
  479. }
  480. else if ((oldbutton & IN_USE) && para_ent[id] > 0 ) {
  481. remove_entity(para_ent[id])
  482. set_user_gravity(id, 1.0)
  483. para_ent[id] = 0
  484. }
  485. }
  486. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  487. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1038\\ f0\\ fs16 \n\\ par }
  488. */
  489.  


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Ejtőernyő Átírása!
HozzászólásElküldve: 2015.04.03. 14:46 
Offline
Fanatikus
Avatar

Csatlakozott: 2015.01.19. 20:54
Hozzászólások: 170
Megköszönt másnak: 13 alkalommal
Megköszönték neki: 3 alkalommal
Próbáld:
SMA Forráskód: [ Mindet kijelol ]
  1. /*******************************************************************************
  2.  
  3.   Parachute
  4.  
  5.   Version: 1.3
  6.   Author: KRoTaL/JTP10181
  7.  
  8.   0.1 Release
  9.   0.1.1 Players can't buy a parachute if they already own one
  10.   0.1.2 Release for AMX MOD X
  11.   0.1.3 Minor changes
  12.   0.1.4 Players lose their parachute if they die
  13.   0.1.5 Added amx_parachute cvar
  14.   0.1.6 Changed set_origin to movetype_follow (you won't see your own parachute)
  15.   0.1.7 Added amx_parachute <name> | admins with admin level a get a free parachute
  16.   0.1.8 JTP - Cleaned up code, fixed runtime error
  17.   1.0 JTP - Should be final version, made it work on basically any mod
  18.   1.1 JTP - Added Changes from AMX Version 0.1.8
  19. Added say give_parachute and parachute_fallspeed cvar
  20.   Plays the release animation when you touch the ground
  21.   Added chat responder for automatic help
  22.   1.2 JTP - Added cvar to disable the detach animation
  23.   Redid animation code to improve organization
  24.   Force "walk" animation on players when falling
  25.   Change users gravity when falling to avoid choppiness
  26.   1.3 JTP - Upgraded to pCVARs
  27.  
  28.   Commands:
  29.  
  30. say buy_parachute - buys a parachute (CStrike ONLY)
  31. saw sell_parachute - sells your parachute (75% of the purchase price)
  32. say give_parachute <nick, #userid or @team> - gives your parachute to the player
  33.  
  34. amx_parachute <nick, #userid or @team> - gives a player a free parachute (CStrike ONLY)
  35. amx_parachute @all - gives everyone a free parachute (CStrike ONLY)
  36.  
  37. Press +use to slow down your fall.
  38.  
  39.   Cvars:
  40.  
  41. sv_parachute "1" - 0: disables the plugin - 1: enables the plugin
  42.  
  43. parachute_cost "1000" - cost of the parachute (CStrike ONLY)
  44.  
  45. parachute_payback "75" - how many percent of the parachute cost you get when you sell your parachute
  46. (ie. (75/100) * 1000 = 750$)
  47.  
  48. parachute_fallspeed "100" - speed of the fall when you use the parachute
  49.  
  50.  
  51.   Setup (AMXX 1.x):
  52.  
  53. Install the amxx file.
  54. Enable engine and cstrike (for cs only) in the amxx modules.ini
  55. Put the parachute.mdl file in the modname/models/ folder
  56.  
  57. *******************************************************************************/
  58.  
  59. #include <amxmodx>
  60. #include <amxmisc>
  61. #include <engine>
  62. #include <cstrike>
  63. #include <fun>
  64.  
  65. new bool:has_parachute[33]
  66. new para_ent[33]
  67. new gCStrike = 0
  68. new pDetach, pFallSpeed, pEnabled, pCost, pPayback
  69.  
  70. #define PARACHUTE_LEVEL ADMIN_LEVEL_A
  71.  
  72. public plugin_init()
  73. {
  74. register_plugin("Parachute", "1.3", "KRoT@L/JTP10181")
  75. pEnabled = register_cvar("sv_parachute", "1" )
  76. pFallSpeed = register_cvar("parachute_fallspeed", "100")
  77. pDetach = register_cvar("parachute_detach", "1")
  78.  
  79. if (cstrike_running()) gCStrike = true
  80.  
  81. if (gCStrike) {
  82.  
  83. pCost = register_cvar("parachute_cost", "1000")
  84. pPayback = register_cvar("parachute_payback", "75")
  85.  
  86. register_concmd("amx_parachute", "admin_give_parachute", PARACHUTE_LEVEL, "<nick, #userid or @team>" )
  87. }
  88.  
  89. register_clcmd("say", "HandleSay")
  90. register_clcmd("say_team", "HandleSay")
  91.  
  92. register_event("ResetHUD", "newSpawn", "be")
  93. register_event("DeathMsg", "death_event", "a")
  94.  
  95. //Setup jtp10181 CVAR
  96. new cvarString[256], shortName[16]
  97. copy(shortName,15,"chute")
  98.  
  99. register_cvar("jtp10181","",FCVAR_SERVER|FCVAR_SPONLY)
  100. get_cvar_string("jtp10181",cvarString,255)
  101.  
  102. if (strlen(cvarString) == 0) {
  103. formatex(cvarString,255,shortName)
  104. set_cvar_string("jtp10181",cvarString)
  105. }
  106. else if (contain(cvarString,shortName) == -1) {
  107. format(cvarString,255,"%s,%s",cvarString, shortName)
  108. set_cvar_string("jtp10181",cvarString)
  109. }
  110. }
  111.  
  112. public plugin_natives()
  113. {
  114. set_module_filter("module_filter")
  115. set_native_filter("native_filter")
  116. }
  117.  
  118. public module_filter(const module[])
  119. {
  120. if (!cstrike_running() && equali(module, "cstrike")) {
  121. return PLUGIN_HANDLED
  122. }
  123.  
  124. return PLUGIN_CONTINUE
  125. }
  126.  
  127. public native_filter(const name[], index, trap)
  128. {
  129. if (!trap) return PLUGIN_HANDLED
  130.  
  131. return PLUGIN_CONTINUE
  132. }
  133.  
  134. public plugin_precache()
  135. {
  136. precache_model("models/explosive_ejto.mdl")
  137. }
  138.  
  139. public client_connect(id)
  140. {
  141. parachute_reset(id)
  142. }
  143.  
  144. public client_disconnect(id)
  145. {
  146. parachute_reset(id)
  147. }
  148.  
  149. public death_event()
  150. {
  151. new id = read_data(2)
  152. parachute_reset(id)
  153. }
  154.  
  155. parachute_reset(id)
  156. {
  157. if(para_ent[id] > 0) {
  158. if (is_valid_ent(para_ent[id])) {
  159. remove_entity(para_ent[id])
  160. }
  161. }
  162.  
  163. if (is_user_alive(id)) set_user_gravity(id, 1.0)
  164.  
  165. has_parachute[id] = false
  166. para_ent[id] = 0
  167. }
  168.  
  169. public newSpawn(id)
  170. {
  171. if(para_ent[id] > 0) {
  172. remove_entity(para_ent[id])
  173. set_user_gravity(id, 1.0)
  174. para_ent[id] = 0
  175. }
  176.  
  177. if (!gCStrike || access(id,PARACHUTE_LEVEL) || get_pcvar_num(pCost) <= 0) {
  178. has_parachute[id] = true
  179. //set_view(id, CAMERA_3RDPERSON)
  180. }
  181. }
  182.  
  183. public HandleSay(id)
  184. {
  185. if(!is_user_connected(id)) return PLUGIN_CONTINUE
  186.  
  187. new args[128]
  188. read_args(args, 127)
  189. remove_quotes(args)
  190.  
  191. if (gCStrike) {
  192. if (equali(args, "buy_parachute")) {
  193. buy_parachute(id)
  194. return PLUGIN_HANDLED
  195. }
  196. else if (equali(args, "sell_parachute")) {
  197. sell_parachute(id)
  198. return PLUGIN_HANDLED
  199. }
  200. else if (containi(args, "give_parachute") == 0) {
  201. give_parachute(id,args[15])
  202. return PLUGIN_HANDLED
  203. }
  204. }
  205.  
  206. if (containi(args, "parachute") != -1) {
  207. if (gCStrike) client_print(id, print_chat, "[AMXX] Ejt?erny? parancsok: buy_parachute, sell_parachute, give_parachute")
  208. client_print(id, print_chat, "[AMXX] Az ejt?erny? haszn?lat?hoz nyomd meg az E bet?t")
  209. }
  210.  
  211. return PLUGIN_CONTINUE
  212. }
  213.  
  214. public buy_parachute(id)
  215. {
  216. if (!gCStrike) return PLUGIN_CONTINUE
  217. if (!is_user_connected(id)) return PLUGIN_CONTINUE
  218.  
  219. if (!get_pcvar_num(pEnabled)) {
  220. client_print(id, print_chat, "[AMXX] Ejt?erny? plugin kikapcsolva")
  221. return PLUGIN_HANDLED
  222. }
  223.  
  224. if (has_parachute[id]) {
  225. client_print(id, print_chat, "[AMXX] Neked m?r van ejt?erny?d")
  226. return PLUGIN_HANDLED
  227. }
  228.  
  229. new money = cs_get_user_money(id)
  230. new cost = get_pcvar_num(pCost)
  231.  
  232. if (money < cost) {
  233. client_print(id, print_chat, "[AMXX] Nincs el?g p?nzed az ejt?erny? v?s?rl?s?hoz - Costs $%i", cost)
  234. return PLUGIN_HANDLED
  235. }
  236.  
  237. cs_set_user_money(id, money - cost)
  238. client_print(id, print_chat, "[AMXX] Vett?l egy ejt?erny?t Haszn?lathoz nyomd meg az E bet?t")
  239. has_parachute[id] = true
  240.  
  241. return PLUGIN_HANDLED
  242. }
  243.  
  244. public sell_parachute(id)
  245. {
  246. if (!gCStrike) return PLUGIN_CONTINUE
  247. if (!is_user_connected(id)) return PLUGIN_CONTINUE
  248.  
  249. if (!get_pcvar_num(pEnabled)) {
  250. client_print(id, print_chat, "[AMXX] Ejt?erny? plugin kikapcsolva")
  251. return PLUGIN_HANDLED
  252. }
  253.  
  254. if (!has_parachute[id]) {
  255. client_print(id, print_chat, "[AMXX] Neked nincs ejt?erny?d ez?rt nem tudod eladni")
  256. return PLUGIN_HANDLED
  257. }
  258.  
  259. if (access(id,PARACHUTE_LEVEL)) {
  260. client_print(id, print_chat, "[AMXX] Te nem adhatod el az admin ?ltal adott ingyen ejt?erny?t!")
  261. return PLUGIN_HANDLED
  262. }
  263.  
  264. parachute_reset(id)
  265.  
  266. new money = cs_get_user_money(id)
  267. new cost = get_pcvar_num(pCost)
  268.  
  269. new sellamt = floatround(cost * (get_pcvar_num(pPayback) / 100.0))
  270. cs_set_user_money(id, money + sellamt)
  271.  
  272. client_print(id, print_chat, "[AMX] Eladtad a haszn?lt ejt?erny?d ennyi?rt: $%d", sellamt)
  273.  
  274. return PLUGIN_CONTINUE
  275. }
  276.  
  277. public give_parachute(id,args[])
  278. {
  279. if (!gCStrike) return PLUGIN_CONTINUE
  280. if (!is_user_connected(id)) return PLUGIN_CONTINUE
  281.  
  282. if (!get_pcvar_num(pEnabled)) {
  283. client_print(id, print_chat, "[AMXX] Ejt?erny? plugin bekapcsolva")
  284. return PLUGIN_HANDLED
  285. }
  286.  
  287. if (!has_parachute[id]) {
  288. client_print(id, print_chat, "[AMXX] Te nem tudod haszn?lni az ejt?erny?d mert nincs.")
  289. return PLUGIN_HANDLED
  290. }
  291.  
  292. new player = cmd_target(id, args, 4)
  293. if (!player) return PLUGIN_HANDLED
  294.  
  295. new id_name[32], pl_name[32]
  296. get_user_name(id, id_name, 31)
  297. get_user_name(player, pl_name, 31)
  298.  
  299. if(has_parachute[player]) {
  300. client_print(id, print_chat, "[AMXX] %s m?r van ejt?erny?je.", pl_name)
  301. return PLUGIN_HANDLED
  302. }
  303.  
  304. parachute_reset(id)
  305. has_parachute[player] = true
  306.  
  307. client_print(id, print_chat, "[AMXX] Adt?l ejt?erny?t neki : %s.", pl_name)
  308. client_print(player, print_chat, "[AMXX] %s haszn?lja az ejt?erny?t amit te adt?l neki.", id_name)
  309.  
  310. return PLUGIN_HANDLED
  311. }
  312.  
  313. public admin_give_parachute(id, level, cid) {
  314.  
  315. if (!gCStrike) return PLUGIN_CONTINUE
  316.  
  317. if(!cmd_access(id,level,cid,2)) return PLUGIN_HANDLED
  318.  
  319. if (!get_pcvar_num(pEnabled)) {
  320. client_print(id, print_chat, "[AMXX] ejt?erny? plugin kikapcsolva")
  321. return PLUGIN_HANDLED
  322. }
  323.  
  324. new arg[32], name[32], name2[32], authid[35], authid2[35]
  325. read_argv(1,arg,31)
  326. get_user_name(id,name,31)
  327. get_user_authid(id,authid,34)
  328.  
  329. if (arg[0]=='@'){
  330. new players[32], inum
  331. if (equali("T",arg[1])) copy(arg[1],31,"TERRORIST")
  332. if (equali("ALL",arg[1])) get_players(players,inum)
  333. else get_players(players,inum,"e",arg[1])
  334.  
  335. if (inum == 0) {
  336. console_print(id,"No clients in such team")
  337. return PLUGIN_HANDLED
  338. }
  339.  
  340. for(new a = 0; a < inum; a++) {
  341. has_parachute[players[a]] = true
  342. }
  343.  
  344. switch(get_cvar_num("amx_show_activity")) {
  345. case 2: client_print(0,print_chat,"ADMIN %s: adott egy ejt?erny?t ^"%s^" playernek",name,arg[1])
  346. case 1: client_print(0,print_chat,"ADMIN: Adott egy ejt?erny?t ^"%s^" playernek",arg[1])
  347. }
  348.  
  349. console_print(id,"[AMXX] Te adt?l egy ejt?erny?t ^"%s^" playernek",arg[1])
  350. log_amx("^"%s<%d><%s><>^" adt?l ejt?erny?t ^"%s^"", name,get_user_userid(id),authid,arg[1])
  351. }
  352. else {
  353.  
  354. new player = cmd_target(id,arg,6)
  355. if (!player) return PLUGIN_HANDLED
  356.  
  357. has_parachute[player] = true
  358.  
  359. get_user_name(player,name2,31)
  360. get_user_authid(player,authid2,34)
  361.  
  362. switch(get_cvar_num("amx_show_activity")) {
  363. case 2: client_print(0,print_chat,"ADMIN %s: adt?l ejt?erny?t ^"%s^"",name,name2)
  364. case 1: client_print(0,print_chat,"ADMIN: adt?l ejt?erny?t ^"%s^"",name2)
  365. }
  366.  
  367. console_print(id,"[AMXX] te adt?l ejt?erny?t ^"%s^"", name2)
  368. 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)
  369. }
  370. return PLUGIN_HANDLED
  371. }
  372.  
  373. public client_PreThink(id)
  374. {
  375. //parachute.mdl animation information
  376. //0 - deploy - 84 frames
  377. //1 - idle - 39 frames
  378. //2 - detach - 29 frames
  379.  
  380. if (!get_pcvar_num(pEnabled)) return
  381. if (!is_user_alive(id) || !has_parachute[id]) return
  382.  
  383. new Float:fallspeed = get_pcvar_float(pFallSpeed) * -1.0
  384. new Float:frame
  385.  
  386. new button = get_user_button(id)
  387. new oldbutton = get_user_oldbutton(id)
  388. new flags = get_entity_flags(id)
  389.  
  390. if (para_ent[id] > 0 && (flags & FL_ONGROUND)) {
  391.  
  392. if (get_pcvar_num(pDetach)) {
  393.  
  394. if (get_user_gravity(id) == 0.1) set_user_gravity(id, 1.0)
  395.  
  396. if (entity_get_int(para_ent[id],EV_INT_sequence) != 2) {
  397. entity_set_int(para_ent[id], EV_INT_sequence, 2)
  398. entity_set_int(para_ent[id], EV_INT_gaitsequence, 1)
  399. entity_set_float(para_ent[id], EV_FL_frame, 0.0)
  400. entity_set_float(para_ent[id], EV_FL_fuser1, 0.0)
  401. entity_set_float(para_ent[id], EV_FL_animtime, 0.0)
  402. entity_set_float(para_ent[id], EV_FL_framerate, 0.0)
  403. return
  404. }
  405.  
  406. frame = entity_get_float(para_ent[id],EV_FL_fuser1) + 2.0
  407. entity_set_float(para_ent[id],EV_FL_fuser1,frame)
  408. entity_set_float(para_ent[id],EV_FL_frame,frame)
  409.  
  410. if (frame > 254.0) {
  411. remove_entity(para_ent[id])
  412. para_ent[id] = 0
  413. }
  414. }
  415. else {
  416. remove_entity(para_ent[id])
  417. set_user_gravity(id, 1.0)
  418. para_ent[id] = 0
  419. }
  420.  
  421. return
  422. }
  423.  
  424. if (button & IN_USE) {
  425.  
  426. new Float:velocity[3]
  427. entity_get_vector(id, EV_VEC_velocity, velocity)
  428.  
  429. if (velocity[2] < 0.0) {
  430.  
  431. if(para_ent[id] <= 0) {
  432. para_ent[id] = create_entity("info_target")
  433. if(para_ent[id] > 0) {
  434. entity_set_string(para_ent[id],EV_SZ_classname,"parachute")
  435. entity_set_edict(para_ent[id], EV_ENT_aiment, id)
  436. entity_set_edict(para_ent[id], EV_ENT_owner, id)
  437. entity_set_int(para_ent[id], EV_INT_movetype, MOVETYPE_FOLLOW)
  438. entity_set_model(para_ent[id], "models/explosive_ejto.mdl")
  439. entity_set_int(para_ent[id], EV_INT_sequence, 0)
  440. entity_set_int(para_ent[id], EV_INT_gaitsequence, 1)
  441. entity_set_float(para_ent[id], EV_FL_frame, 0.0)
  442. entity_set_float(para_ent[id], EV_FL_fuser1, 0.0)
  443. }
  444. }
  445.  
  446. if (para_ent[id] > 0) {
  447.  
  448. entity_set_int(id, EV_INT_sequence, 3)
  449. entity_set_int(id, EV_INT_gaitsequence, 1)
  450. entity_set_float(id, EV_FL_frame, 1.0)
  451. entity_set_float(id, EV_FL_framerate, 1.0)
  452. set_user_gravity(id, 0.1)
  453.  
  454. velocity[2] = (velocity[2] + 40.0 < fallspeed) ? velocity[2] + 40.0 : fallspeed
  455. entity_set_vector(id, EV_VEC_velocity, velocity)
  456.  
  457. if (entity_get_int(para_ent[id],EV_INT_sequence) == 0) {
  458.  
  459. frame = entity_get_float(para_ent[id],EV_FL_fuser1) + 1.0
  460. entity_set_float(para_ent[id],EV_FL_fuser1,frame)
  461. entity_set_float(para_ent[id],EV_FL_frame,frame)
  462.  
  463. if (frame > 100.0) {
  464. entity_set_float(para_ent[id], EV_FL_animtime, 0.0)
  465. entity_set_float(para_ent[id], EV_FL_framerate, 0.4)
  466. entity_set_int(para_ent[id], EV_INT_sequence, 1)
  467. entity_set_int(para_ent[id], EV_INT_gaitsequence, 1)
  468. entity_set_float(para_ent[id], EV_FL_frame, 0.0)
  469. entity_set_float(para_ent[id], EV_FL_fuser1, 0.0)
  470. }
  471. }
  472. }
  473. }
  474. else if (para_ent[id] > 0) {
  475. remove_entity(para_ent[id])
  476. set_user_gravity(id, 1.0)
  477. para_ent[id] = 0
  478. }
  479. }
  480. else if ((oldbutton & IN_USE) && para_ent[id] > 0 ) {
  481. remove_entity(para_ent[id])
  482. set_user_gravity(id, 1.0)
  483. para_ent[id] = 0
  484. }
  485. }
  486. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  487. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1038\\ f0\\ fs16 \n\\ par }
  488. */

_________________
Kép

˘^Kezdő vagyok!!^ˇ


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Ejtőernyő Átírása!
HozzászólásElküldve: 2015.04.03. 15:39 
Offline
Nagyúr

Csatlakozott: 2015.02.01. 11:40
Hozzászólások: 670
Megköszönt másnak: 16 alkalommal
Megköszönték neki: 99 alkalommal
be van téve a model? :D

_________________
http://steamcommunity.com/id/floxay/


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Ejtőernyő Átírása!
HozzászólásElküldve: 2015.04.03. 18:55 
Offline
Jómunkásember
Avatar

Csatlakozott: 2014.10.31. 14:51
Hozzászólások: 462
Megköszönt másnak: 73 alkalommal
Megköszönték neki: 29 alkalommal
be be csak alúl nem vettem észre :( XD


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