Witamy w Nieoficjalnym polskim support'cie AMX Mod X
Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
|
Guest Message by DevFuse
Wklejka 1la33t9cl04xx dodana przez Najarany., 19.03.2014 10:49
xxx
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83. 84. 85. 86. 87. 88. 89. 90. 91. 92. 93. 94. 95. 96. 97. 98. 99. 100. 101. 102. 103. 104. 105. 106. 107. 108. 109. 110. 111. 112. 113. 114. 115. 116. 117. 118. 119. 120. 121. 122. 123. 124. 125. 126. 127. 128. 129. 130. 131. 132. 133. 134. 135. 136. 137. 138. 139. 140. 141. 142. 143. 144. 145. 146. 147. 148. 149. 150. 151. 152. 153. 154. 155. 156. 157. 158. 159. 160. 161. 162. 163. 164. 165. 166. 167. 168. 169. 170. 171. 172. 173. 174. 175. 176. 177. 178. 179. 180. 181. 182. 183. 184. 185. 186. 187. 188. 189. 190. 191. 192. 193. 194. 195. 196. 197. 198. 199. 200. 201. 202. 203. 204. 205. 206. 207. 208. 209. 210. 211. 212. 213. 214. 215. 216. 217. 218. 219. 220. 221. 222. 223. 224. 225. 226. 227. 228. 229. 230. 231. 232. 233. 234. 235. 236. 237. 238. 239. 240. 241. 242. 243. 244. 245. 246. 247. 248. 249. 250. 251. 252. 253. 254. 255. 256. 257. 258. 259. 260. 261. 262. 263. 264. 265. 266. 267. 268. 269. 270. 271. 272. 273. 274. 275. 276. 277. 278. 279. 280. 281. 282. 283. 284. 285. 286. 287. 288. 289. 290. 291. 292. 293. 294. 295. 296. 297. 298. 299. 300. 301. 302. 303. 304. 305. 306. 307. 308. 309. 310. 311. 312. 313. 314. 315. 316. 317. 318. 319. 320. 321. 322. 323. 324. 325. 326. 327. 328. 329. 330. 331. 332. 333. 334. 335. 336. 337. 338. 339. 340. 341. 342. 343. 344. 345. 346. 347. 348. 349. 350. 351. 352. 353. 354. 355. 356. 357. 358. 359. 360. 361. 362. 363. 364. 365. 366. 367. 368. 369. 370. 371. 372. 373. 374. 375. 376. 377. 378. 379. 380. 381. 382. 383. 384. 385. 386. 387. 388. 389. 390. 391. 392. 393. 394. 395. 396. 397. 398. 399. 400. 401. 402. 403. 404. 405. 406. 407. 408. 409. 410. 411. 412. 413. 414. 415. 416. 417. 418. 419. 420. 421. 422. 423. 424. 425. 426. 427. 428. 429. 430. 431. 432. 433. 434. 435. 436. 437. 438. 439. 440. 441. 442. 443. 444. 445. 446. 447. 448. 449. 450. 451. 452. 453. 454. 455. 456. 457. 458. 459. 460. 461. 462. 463. 464. 465. 466. 467. 468. 469. 470. 471. 472. 473. 474. 475. 476. 477. 478. 479. 480. 481. 482. 483. 484. 485. 486. 487. 488. 489. 490. 491. 492. 493. 494. 495. 496. 497. 498. 499. 500. 501. 502. 503. 504. 505. 506. 507. 508. 509. 510. 511. 512. 513. 514. 515. 516. 517. 518. 519. 520. 521. 522. 523. 524. 525. 526. 527. 528. 529. 530. 531. 532. 533. 534. 535. 536.
#include <amxmodx>
#include <cstrike>
#include <fakemeta_util>
#include <codmod>
#include <engine>
#include <hamsandwich>
#define pev_zorigin pev_fuser4
#define seconds(%1) ((1<<12) * (%1))
new SOUND_START[] = "items/medshot4.wav"
new SOUND_FINISHED[] = "items/smallmedkit2.wav"
new SOUND_FAILED[] = "items/medshotno1.wav"
enum
{
ICON_HIDE = 0,
ICON_SHOW,
ICON_FLASH
}
enum
{
TASKID_REVIVE = 1337,
TASKID_RESPAWN,
TASKID_CHECKRE,
TASKID_CHECKST,
TASKID_ORIGIN,
TASKID_SETUSER
}
new g_haskit[33], ile_ma[33];
new Float:g_revive_delay[33]
new Float:g_body_origin[33][3]
new bool:g_wasducking[33]
new g_msg_bartime, g_msg_statusicon, g_msg_screenfade, g_msg_clcorpse;
new const nazwa[] = "Super Medyk (Klasa Premium)";
new const opis[] = "Moze wskrzeszac innych graczy (za wskrzeszenie dostaje XP i zdrowie). Posiada 100hp, 100% biegu.";
new const bronie = 1<<CSW_MP5NAVY | 1<<CSW_GLOCK18;
new const zdrowie = 0;
new const kondycja = 0;
new const inteligencja = 0;
new const wytrzymalosc = 0;
public plugin_init()
{
register_plugin(nazwa, "1.0", "amxx.pl");
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
register_event("HLTV", "event_hltv", "a", "1=0", "2=0")
register_event("DeathMsg","DeathMsg","ade")
register_event("ResetHUD", "ResetHUD", "abe")
register_forward(FM_EmitSound, "fwd_emitsound")
register_forward(FM_PlayerPostThink, "fwd_playerpostthink")
g_msg_bartime = get_user_msgid("BarTime")
g_msg_clcorpse = get_user_msgid("ClCorpse")
g_msg_screenfade= get_user_msgid("ScreenFade")
g_msg_statusicon = get_user_msgid("StatusIcon")
register_message(g_msg_clcorpse, "message_clcorpse")
}
public cod_class_enabled(id)
{
if(get_user_flags(id) & ADMIN_LEVEL_C)
{
g_haskit[id] = 1;
ile_ma[id] = 0;
reset_player(id)
return COD_CONTINUE;
}
else
{
client_print(id, print_chat, "[COD:MW] Nie masz uprawnien dla Klasy Premium!");
client_cmd(id, "spk sound/buttons/button2.wav");
return COD_STOP;
}
return COD_STOP;
}
public cod_class_disabled(id)
{
g_haskit[id] = 0;
ile_ma[id] = 0;
reset_player(id)
}
public plugin_precache()
{
precache_model("models/player/arctic/arctic.mdl")
precache_model("models/player/leet/leet.mdl")
precache_model("models/player/guerilla/guerilla.mdl")
precache_model("models/player/terror/terror.mdl")
precache_model("models/player/urban/urban.mdl")
precache_model("models/player/sas/sas.mdl")
precache_model("models/player/gsg9/gsg9.mdl")
precache_model("models/player/gign/gign.mdl")
precache_model("models/player/vip/vip.mdl")
precache_sound(SOUND_START)
precache_sound(SOUND_FINISHED)
precache_sound(SOUND_FAILED)
}
public client_disconnect(id)
{
new ent
while((ent = fm_find_ent_by_owner(ent, "fake_corpse", id)) != 0)
fm_remove_entity(ent)
}
public DeathMsg()
{
new vid = read_data(2)
reset_player(vid)
msg_bartime(vid, 0)
static Float:minsize[3]
pev(vid, pev_mins, minsize)
if(minsize[2] == -18.0)
g_wasducking[vid] = true
else
g_wasducking[vid] = false
set_task(0.5, "task_check_dead_flag", vid)
}
public ResetHUD(id)
{
ile_ma[id] = 0;
}
public event_hltv()
{
fm_remove_entity_name("fake_corpse")
static players[32], num
get_players(players, num, "a")
for(new i = 0; i < num; i++)
{
if(is_user_connected(players[i]))
{
reset_player(players[i])
msg_bartime(players[i], 0)
}
}
}
public reset_player(id)
{
remove_task(TASKID_REVIVE + id)
remove_task(TASKID_RESPAWN + id)
remove_task(TASKID_CHECKRE + id)
remove_task(TASKID_CHECKST + id)
remove_task(TASKID_ORIGIN + id)
remove_task(TASKID_SETUSER + id)
g_revive_delay[id] = 0.0
g_wasducking[id] = false
g_body_origin[id] = Float:{0.0, 0.0, 0.0}
}
public fwd_playerpostthink(id)
{
if(!is_user_connected(id))
return FMRES_IGNORED
if(g_haskit[id]==0)
return FMRES_IGNORED
if(!is_user_alive(id))
{
Display_Icon(id, ICON_HIDE , "dmg_shock")
return FMRES_IGNORED
}
new body = find_dead_body(id)
if(fm_is_valid_ent(body))
{
new lucky_bastard = pev(body, pev_owner)
if(!is_user_connected(lucky_bastard))
return FMRES_IGNORED
new lb_team = get_user_team(lucky_bastard)
if(lb_team == 1 || lb_team == 2 )
Display_Icon(id, ICON_FLASH , "dmg_shock")
}
else
Display_Icon(id, ICON_SHOW , "dmg_shock")
return FMRES_IGNORED
}
public task_check_dead_flag(id)
{
if(!is_user_connected(id))
return
if(pev(id, pev_deadflag) == DEAD_DEAD)
create_fake_corpse(id)
else
set_task(0.5, "task_check_dead_flag", id)
}
public create_fake_corpse(id)
{
set_pev(id, pev_effects, EF_NODRAW)
static model[32]
cs_get_user_model(id, model, 31)
static player_model[64]
format(player_model, 63, "models/player/%s/%s.mdl", model, model)
static Float: player_origin[3]
pev(id, pev_origin, player_origin)
static Float:mins[3]
mins[0] = -16.0
mins[1] = -16.0
mins[2] = -34.0
static Float:maxs[3]
maxs[0] = 16.0
maxs[1] = 16.0
maxs[2] = 34.0
if(g_wasducking[id])
{
mins[2] /= 2
maxs[2] /= 2
}
static Float:player_angles[3]
pev(id, pev_angles, player_angles)
player_angles[2] = 0.0
new sequence = pev(id, pev_sequence)
new ent = fm_create_entity("info_target")
if(ent)
{
set_pev(ent, pev_classname, "fake_corpse")
engfunc(EngFunc_SetModel, ent, player_model)
engfunc(EngFunc_SetOrigin, ent, player_origin)
engfunc(EngFunc_SetSize, ent, mins, maxs)
set_pev(ent, pev_solid, SOLID_TRIGGER)
set_pev(ent, pev_movetype, MOVETYPE_TOSS)
set_pev(ent, pev_owner, id)
set_pev(ent, pev_angles, player_angles)
set_pev(ent, pev_sequence, sequence)
set_pev(ent, pev_frame, 9999.9)
}
}
public fwd_emitsound(id, channel, sound[])
{
if(!is_user_alive(id) || !g_haskit[id])
return FMRES_IGNORED
if(!equali(sound, "common/wpn_denyselect.wav"))
return FMRES_IGNORED
if(task_exists(TASKID_REVIVE + id))
return FMRES_IGNORED
if(!(fm_get_user_button(id) & IN_USE))
return FMRES_IGNORED
new body = find_dead_body(id)
if(!fm_is_valid_ent(body))
return FMRES_IGNORED
new lucky_bastard = pev(body, pev_owner)
new lb_team = get_user_team(lucky_bastard)
if(lb_team != 1 && lb_team != 2)
return FMRES_IGNORED
new revivaltime = 3
msg_bartime(id, revivaltime)
new Float:gametime = get_gametime()
g_revive_delay[id] = gametime + float(revivaltime) - 0.01
emit_sound(id, CHAN_AUTO, SOUND_START, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
set_task(0.0, "task_revive", TASKID_REVIVE + id)
return FMRES_SUPERCEDE
}
public task_revive(taskid)
{
new id = taskid - TASKID_REVIVE
if(!is_user_alive(id))
{
failed_revive(id)
return FMRES_IGNORED
}
if(!(fm_get_user_button(id) & IN_USE))
{
failed_revive(id)
return FMRES_IGNORED
}
new body = find_dead_body(id)
if(!fm_is_valid_ent(body))
{
failed_revive(id)
return FMRES_IGNORED
}
new lucky_bastard = pev(body, pev_owner)
if(!is_user_connected(lucky_bastard))
{
failed_revive(id)
return FMRES_IGNORED
}
new lb_team = get_user_team(lucky_bastard)
if(lb_team != 1 && lb_team != 2)
{
failed_revive(id)
return FMRES_IGNORED
}
static Float:velocity[3]
pev(id, pev_velocity, velocity)
velocity[0] = 0.0
velocity[1] = 0.0
set_pev(id, pev_velocity, velocity)
new Float:gametime = get_gametime()
if(g_revive_delay[id] < gametime)
{
if(findemptyloc(body, 10.0))
{
fm_remove_entity(body)
emit_sound(id, CHAN_AUTO, SOUND_FINISHED, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
ile_ma[id]++;
if(ile_ma[id] == 10)
off(id)
new args[2]
args[0]=lucky_bastard
if(get_user_team(id)!=get_user_team(lucky_bastard))
{
args[1]=1
new za_zbeszczeszczenie = 75
new za_hpdefiling = 5
new health = 100+cod_get_user_health(id);
new nowe_zdrowie = (get_user_health(id)+za_hpdefiling<health)? get_user_health(id)+za_hpdefiling: health;
fm_set_user_health(id, nowe_zdrowie);
cod_set_user_xp(id, cod_get_user_xp(id)+za_zbeszczeszczenie)
client_print(id, print_center, "Dostales +%i doswiadczenia za zbeszczeszczenie zwlok wroga!", za_zbeszczeszczenie);
}
else
{
args[1]=0
new za_wskrzeszenie = 150
cod_set_user_xp(id, cod_get_user_xp(id)+za_wskrzeszenie)
client_print(id, print_center, "Dostales +%i doswiadczenia za wskrzeszenie kolegi z teamu!", za_wskrzeszenie);
set_task(0.1, "task_respawn", TASKID_RESPAWN + lucky_bastard,args,2)
}
}
else
failed_revive(id)
}
else
set_task(0.1, "task_revive", TASKID_REVIVE + id)
return FMRES_IGNORED
}
public failed_revive(id)
{
msg_bartime(id, 0)
emit_sound(id, CHAN_AUTO, SOUND_FAILED, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
}
public off(id)
{
g_haskit[id] = 0
msg_bartime(id, 0)
reset_player(id)
Display_Icon(id, ICON_HIDE , "dmg_shock")
}
public task_origin(args[])
{
new id = args[0]
engfunc(EngFunc_SetOrigin, id, g_body_origin[id])
static Float:origin[3]
pev(id, pev_origin, origin)
set_pev(id, pev_zorigin, origin[2])
set_task(0.1, "task_stuck_check", TASKID_CHECKST + id,args,2)
}
stock find_dead_body(id)
{
static Float:origin[3]
pev(id, pev_origin, origin)
new ent
static classname[32]
while((ent = fm_find_ent_in_sphere(ent, origin, 100.0)) != 0)
{
pev(ent, pev_classname, classname, 31)
if(equali(classname, "fake_corpse") && fm_is_ent_visible(id, ent))
return ent
}
return 0
}
stock msg_bartime(id, seconds)
{
if(is_user_bot(id)||!is_user_alive(id)||!is_user_connected(id))
return
message_begin(MSG_ONE, g_msg_bartime, _, id)
write_byte(seconds)
write_byte(0)
message_end()
}
public task_respawn(args[])
{
new id = args[0]
if (!is_user_connected(id) || is_user_alive(id) || cs_get_user_team(id) == CS_TEAM_SPECTATOR)
return
set_pev(id, pev_deadflag, DEAD_RESPAWNABLE)
dllfunc(DLLFunc_Think, id)
dllfunc(DLLFunc_Spawn, id)
set_pev(id, pev_iuser1, 0)
set_task(0.1, "task_check_respawn", TASKID_CHECKRE + id,args,2)
}
public task_check_respawn(args[])
{
new id = args[0]
if(pev(id, pev_iuser1))
set_task(0.1, "task_respawn", TASKID_RESPAWN + id,args,2)
else
set_task(0.1, "task_origin", TASKID_ORIGIN + id,args,2)
}
public task_stuck_check(args[])
{
new id = args[0]
static Float:origin[3]
pev(id, pev_origin, origin)
if(origin[2] == pev(id, pev_zorigin))
set_task(0.1, "task_respawn", TASKID_RESPAWN + id,args,2)
else
set_task(0.1, "task_setplayer", TASKID_SETUSER + id,args,2)
}
public task_setplayer(args[])
{
new id = args[0]
fm_set_user_health(id, 75)
Display_Fade(id,seconds(2),seconds(2),0,0,0,0,255)
}
stock bool:findemptyloc(ent, Float:radius)
{
if(!fm_is_valid_ent(ent))
return false
static Float:origin[3]
pev(ent, pev_origin, origin)
origin[2] += 2.0
new owner = pev(ent, pev_owner)
new num = 0, bool:found = false
while(num <= 100)
{
if(is_hull_vacant(origin))
{
g_body_origin[owner][0] = origin[0]
g_body_origin[owner][1] = origin[1]
g_body_origin[owner][2] = origin[2]
found = true
break
}
else
{
origin[0] += random_float(-radius, radius)
origin[1] += random_float(-radius, radius)
origin[2] += random_float(-radius, radius)
num++
}
}
return found
}
stock bool:is_hull_vacant(const Float:origin[3])
{
new tr = 0
engfunc(EngFunc_TraceHull, origin, origin, 0, HULL_HUMAN, 0, tr)
if(!get_tr2(tr, TR_StartSolid) && !get_tr2(tr, TR_AllSolid) && get_tr2(tr, TR_InOpen))
return true
return false
}
stock Display_Fade(id,duration,holdtime,fadetype,red,green,blue,alpha)
{
message_begin(MSG_ONE, g_msg_screenfade,{0,0,0},id)
write_short(duration)
write_short(holdtime)
write_short(fadetype)
write_byte(red)
write_byte(green)
write_byte(blue)
write_byte(alpha)
message_end()
}
stock Display_Icon(id ,enable ,name[])
{
if(!pev_valid(id) || is_user_bot(id))
return PLUGIN_HANDLED
message_begin(MSG_ONE, g_msg_statusicon, {0,0,0}, id)
write_byte(enable)
write_string(name)
write_byte(42)
write_byte(42)
write_byte(255)
message_end()
return PLUGIN_CONTINUE
}
public message_clcorpse()
{
return PLUGIN_HANDLED
}
Dodanych wklejek: 12861
Powered By (Pav32) Pastebin © 2011


Dodatki SourceMod


