Advertisement
IdoGame

Amxx Cmd Advanced Access

Aug 28th, 2014
900
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 35.92 KB | None | 0 0
  1. #include < amxmodx >
  2. #include < fakemeta >
  3.  
  4. #pragma semicolon 1
  5.  
  6. #define MAX_COLORS 11
  7.  
  8. #define TASKID_RESTART 1000
  9.  
  10. // Drug ...
  11.  
  12. #define XO_PLAYER 5
  13. #define m_iFOV 363
  14. new AdminMyAccess[33];
  15. enum _:Teams
  16. {
  17. FM_TEAM_UNASSIGNED,
  18. FM_TEAM_T,
  19. FM_TEAM_CT,
  20. FM_TEAM_SPECTATOR
  21. };
  22.  
  23. enum _:Weapons
  24. {
  25. WEAPON_USP,
  26. WEAPON_GLOCK18,
  27. WEAPON_DEAGLE,
  28. WEAPON_P228,
  29. WEAPON_ELITE,
  30. WEAPON_FIVESEVEN,
  31. WEAPON_M3,
  32. WEAPON_XM1014,
  33. WEAPON_TMP,
  34. WEAPON_MAC10,
  35. WEAPON_MP5NAVY,
  36. WEAPON_P90,
  37. WEAPON_UMP45,
  38. WEAPON_FAMAS,
  39. WEAPON_GALIL,
  40. WEAPON_AK47,
  41. WEAPON_M4A1,
  42. WEAPON_SG552,
  43. WEAPON_AUG,
  44. WEAPON_SCOUT,
  45. WEAPON_SG550,
  46. WEAPON_AWP,
  47. WEAPON_G3SG1,
  48. WEAPON_M249,
  49. WEAPON_HEGRENADE,
  50. WEAPON_SMOKEGRENADE,
  51. WEAPON_FLASHBANG,
  52. WEAPON_SHIELD,
  53. WEAPON_C4,
  54. WEAPON_KNIFE,
  55. ITEM_KEVLAR,
  56. ITEM_ASSAULTSUIT,
  57. ITEM_THIGHPACK
  58. }
  59.  
  60. enum _:Commands
  61. {
  62. RESTART_ROUND,
  63. T_TRANSFER,
  64. CT_TRANSFER,
  65. SPEC_TRANSFER,
  66. TEAM_TRANSFER,
  67. ROUND_TIME,
  68. FREEZE_TIME,
  69. REVIVE,
  70. AIR_ACCELERATE,
  71. BURY,
  72. UNBURY,
  73. GRAVITY,
  74. PASSWORD,
  75. NO_PASSWORD,
  76. SLAY,
  77. SLAP,
  78. GLOW,
  79. FRIENDLY_FIRE,
  80. NOCLIP,
  81. GODMODE,
  82. HEAL,
  83. WEAPON,
  84. ALLTALK,
  85. BUY_TIME,
  86. MONEY,
  87. KICK,
  88. BAN,
  89. AMXX_MENU,
  90. MAP_MENU,
  91. KICK_MENU,
  92. BAN_MENU,
  93. SLAP_MENU,
  94. TEAM_MENU,
  95. MAP_CHANGE,
  96. MULTI_CVAR,
  97. START_MONEY,
  98. PAUSE,
  99. RESTART,
  100. TELEPORT,
  101. VOTEMAP,
  102. SPEED,
  103. UBERSLAP,
  104. DRUG,
  105. FLASH,
  106. ROCKET,
  107. FIRE,
  108. GAG
  109. };
  110. new Gisha[ ][ ] =
  111. {
  112. "",
  113. "Owner",
  114. "Manager",
  115. "Super-Admin",
  116. "Admin",
  117. "VIP"
  118.  
  119. };
  120. new const CommandsName[ Commands ] [ ] =
  121. {
  122. "Round Restart",
  123. "Terrorist Transfer",
  124. "Counter Terrorist Transfer",
  125. "Spectator Transfer",
  126. "Team Transfer",
  127. "Round Time",
  128. "Freeze Time",
  129. "Revive",
  130. "Air Accelerate",
  131. "Bury",
  132. "Un Bury",
  133. "Gravity",
  134. "Password",
  135. "No Password",
  136. "Slay",
  137. "Slap",
  138. "Glow",
  139. "Friendly Fire",
  140. "Noclip",
  141. "Godmode",
  142. "Heal",
  143. "Weapon",
  144. "Alltalk",
  145. "Buy Time",
  146. "Money",
  147. "Kick",
  148. "Ban",
  149. "AMXX Menu",
  150. "Map Menu",
  151. "Kick Menu",
  152. "Ban Menu",
  153. "Slap Menu",
  154. "Team Menu",
  155. "Map Change",
  156. "Multi Cvar",
  157. "Start Money",
  158. "Pause",
  159. "Restart Server",
  160. "Teleport",
  161. "Votemap",
  162. "Speed",
  163. "Uberslap",
  164. "Drug",
  165. "Flash",
  166. "Rocket",
  167. "Fire",
  168. "Gag"
  169. };
  170.  
  171. new const CommandsInChat[ Commands ] [ ] =
  172. {
  173. "rr",
  174. "t",
  175. "ct",
  176. "spec",
  177. "team",
  178. "rt",
  179. "ft",
  180. "revive",
  181. "aa",
  182. "bury",
  183. "unbury",
  184. "gravity",
  185. "pass",
  186. "nopass",
  187. "slay",
  188. "slap",
  189. "glow",
  190. "ff",
  191. "noclip",
  192. "godmode",
  193. "heal",
  194. "weapon",
  195. "alltalk",
  196. "buytime",
  197. "money",
  198. "kick",
  199. "ban",
  200. "amxx",
  201. "mmenu",
  202. "kmenu",
  203. "bmenu",
  204. "smenu",
  205. "tmenu",
  206. "map",
  207. "cvar",
  208. "startmoney",
  209. "pause",
  210. "restart",
  211. "teleport",
  212. "votemap",
  213. "speed",
  214. "uberslap",
  215. "drug",
  216. "flash",
  217. "rocket",
  218. "fire",
  219. "gag"
  220. };
  221.  
  222. new const CommandsLevel[ Commands ] =
  223. {
  224. ADMIN_CVAR,
  225. ADMIN_LEVEL_D,
  226. ADMIN_LEVEL_D,
  227. ADMIN_LEVEL_D,
  228. ADMIN_LEVEL_D,
  229. ADMIN_CVAR,
  230. ADMIN_CVAR,
  231. ADMIN_LEVEL_C,
  232. ADMIN_CVAR,
  233. ADMIN_LEVEL_B,
  234. ADMIN_LEVEL_B,
  235. ADMIN_CVAR,
  236. ADMIN_PASSWORD,
  237. ADMIN_PASSWORD,
  238. ADMIN_SLAY,
  239. ADMIN_LEVEL_B,
  240. ADMIN_LEVEL_D,
  241. ADMIN_CVAR,
  242. ADMIN_LEVEL_C,
  243. ADMIN_LEVEL_C,
  244. ADMIN_LEVEL_A,
  245. ADMIN_LEVEL_C,
  246. ADMIN_CVAR,
  247. ADMIN_CVAR,
  248. ADMIN_LEVEL_C,
  249. ADMIN_KICK,
  250. ADMIN_BAN,
  251. ADMIN_MENU,
  252. ADMIN_MENU,
  253. ADMIN_MENU,
  254. ADMIN_MENU,
  255. ADMIN_MENU,
  256. ADMIN_MENU,
  257. ADMIN_MAP,
  258. ADMIN_CVAR,
  259. ADMIN_CVAR,
  260. ADMIN_CVAR,
  261. ADMIN_BAN,
  262. ADMIN_LEVEL_A,
  263. ADMIN_VOTE,
  264. ADMIN_LEVEL_C,
  265. ADMIN_LEVEL_B,
  266. ADMIN_LEVEL_C,
  267. ADMIN_LEVEL_B,
  268. ADMIN_LEVEL_B,
  269. ADMIN_LEVEL_B,
  270. ADMIN_KICK
  271. };
  272.  
  273. new const GlowColorNames[ MAX_COLORS ] [ ] =
  274. {
  275. "Blue",
  276. "Green",
  277. "Red",
  278. "White",
  279. "Yellow",
  280. "Aqua",
  281. "Purple",
  282. "Pink",
  283. "Silver",
  284. "Gold",
  285. "Off"
  286. };
  287.  
  288. new const GlowInChat[ MAX_COLORS ] [ ] =
  289. {
  290. "blue",
  291. "green",
  292. "red",
  293. "white",
  294. "yellow",
  295. "aqua",
  296. "purple",
  297. "pink",
  298. "silver",
  299. "gold",
  300. "off"
  301. };
  302.  
  303. new const GlowColors[ MAX_COLORS ] [ 3 ] =
  304. {
  305. { 0, 0, 255 },
  306. { 0, 255, 0 },
  307. { 255, 0, 0 },
  308. { 255, 255, 255 },
  309. { 255, 255, 0 },
  310. { 0, 150, 255 },
  311. { 255, 0, 255 },
  312. { 255, 190, 190 },
  313. { 192, 192, 192 },
  314. { 220, 220, 0 },
  315. { 0, 0, 0 }
  316. };
  317.  
  318. new const weapons[ Weapons ][ ] = {
  319. "weapon_usp",
  320. "weapon_glock18",
  321. "weapon_deagle",
  322. "weapon_p228",
  323. "weapon_elite",
  324. "weapon_fiveseven",
  325. "weapon_m3",
  326. "weapon_xm1014",
  327. "weapon_tmp",
  328. "weapon_mac10",
  329. "weapon_mp5navy",
  330. "weapon_p90",
  331. "weapon_ump45",
  332. "weapon_famas",
  333. "weapon_galil",
  334. "weapon_ak47",
  335. "weapon_m4a1",
  336. "weapon_sg552",
  337. "weapon_aug",
  338. "weapon_scout",
  339. "weapon_sg550",
  340. "weapon_awp",
  341. "weapon_g3sg1",
  342. "weapon_m249",
  343. "weapon_hegrenade",
  344. "weapon_smokegrenade",
  345. "weapon_flashbang",
  346. "weapon_shield",
  347. "weapon_c4",
  348. "weapon_knife",
  349. "item_kevlar",
  350. "item_assaultsuit",
  351. "item_thighpack"
  352. };
  353.  
  354. new CvarOnOff;
  355. new CvarHelp;
  356. new CvarFireIginite;
  357.  
  358. new bool:g_freezetime = true;
  359.  
  360. new g_speed[ 33 ];
  361. new rocket_z[ 33 ];
  362. new bool:onfire[ 33 ];
  363.  
  364. new msgid_SetFOV;
  365. new msgid_ScreenFade;
  366. new msgid_Damage;
  367.  
  368. new mflash;
  369. new smoke;
  370. new blueflare2;
  371. new white;
  372.  
  373. public plugin_precache( )
  374. {
  375. /* Flash */
  376.  
  377. precache_sound( "weapons/flashbang-2.wav" );
  378.  
  379. /* Rocket */
  380.  
  381. precache_sound( "weapons/rocketfire1.wav" );
  382. precache_sound( "weapons/rocket1.wav" );
  383.  
  384. /* Fire */
  385.  
  386. precache_sound( "ambience/flameburst1.wav" );
  387. precache_sound( "scientist/scream21.wav" );
  388. precache_sound( "scientist/scream07.wav" );
  389.  
  390. /* Effects */
  391.  
  392. mflash = precache_model( "sprites/muzzleflash.spr" );
  393. smoke = precache_model( "sprites/steam1.spr" );
  394. blueflare2 = precache_model( "sprites/blueflare2.spr" );
  395. white = precache_model( "sprites/white.spr" );
  396. }
  397.  
  398. public plugin_init( )
  399. {
  400. register_plugin( "Amxx Cmd Advanced", "1.4", "ImNativus" );
  401.  
  402. register_clcmd( "say", "HandleSay" );
  403. register_clcmd( "say_team", "HandleSay" );
  404.  
  405. register_event( "CurWeapon", "EventCurWeapon", "be", "1=1" );
  406. register_event( "HLTV", "EventNewRound", "a", "1=0", "2=0" );
  407.  
  408. register_logevent( "LogEventNewRound", 2, "1=Round_Start" );
  409.  
  410. msgid_SetFOV = get_user_msgid( "SetFOV" );
  411. msgid_ScreenFade = get_user_msgid( "ScreenFade" );
  412. msgid_Damage = get_user_msgid("Damage");
  413.  
  414. CvarOnOff = register_cvar( "amxx_cmd", "1" );
  415. CvarHelp = register_cvar( "amxx_help", "1" );
  416. CvarFireIginite = register_cvar( "amxx_fireignite", "0" );
  417.  
  418. set_task( 300.0, "TaskHelpMessage", _, _, _, "b" );
  419. }
  420.  
  421. public TaskHelpMessage( )
  422. {
  423. ColorChat( 0, "This Plugin built by^3 ImNativus" );
  424.  
  425. if ( !get_pcvar_num( CvarHelp ) )
  426. return;
  427.  
  428. new message[ 192 ];
  429.  
  430. formatex( message, sizeof( message ) - 1, "^3Need Help ?^1 Type:^4 " );
  431.  
  432. for ( new i = 0; i < Commands; i += 20 )
  433. {
  434. add( message, sizeof( message ) - 1, "!help" );
  435.  
  436. if ( i != 0 )
  437. {
  438. new number[ 3 ];
  439. formatex( number, sizeof( number ) - 1, "%d ", i / 20 + 1 );
  440.  
  441. add( message, sizeof( message ) - 1, number );
  442. }
  443.  
  444. else
  445. {
  446. add( message, sizeof( message ) - 1, " " );
  447. }
  448. }
  449.  
  450. ColorChat( 0, "%s", message );
  451. }
  452.  
  453. public HandleSay( client )
  454. {
  455. new message[ 192 ], arg[ 64 ], cmd[ 64 ];
  456.  
  457. read_argv( 1, message, sizeof( message ) - 1 );
  458.  
  459. parse( message, arg, sizeof( arg ) - 1 );
  460.  
  461. new num = str_to_num( arg[ strlen( arg ) - 1 ] ) < 0 ? 0 : str_to_num( arg[ strlen( arg ) - 1 ] );
  462.  
  463. if ( get_user_flags( client ) & ADMIN_CVAR )
  464. {
  465. if ( equali( message, "!toggle" ) )
  466. {
  467. set_pcvar_num( CvarOnOff, get_pcvar_num( CvarOnOff ) == 0 ? 1 : 0 );
  468.  
  469. ColorChat( client, "The plugin is now:^3 %s", get_pcvar_num( CvarOnOff ) == 1 ? "On" : "Off" );
  470.  
  471. return PLUGIN_HANDLED;
  472. }
  473. }
  474.  
  475. if ( get_pcvar_num( CvarHelp ) && containi( message, "!help" ) != -1 )
  476. {
  477. ShowMOTD( client, ( ( num * 2 ) * 10 ) - 20 > 0 ? ( ( num * 2 ) * 10 ) - 20 : 0, ( ( num * 2 ) * 10 ) > Commands ? Commands : num * 10 + 20 );
  478. }
  479.  
  480. else
  481. {
  482. for ( new i = 0; i < Commands; i++ )
  483. {
  484. formatex( cmd, sizeof( cmd ) - 1, "!%s", CommandsInChat[ i ] );
  485.  
  486. if ( equali( arg, cmd ) )
  487. {
  488. if ( get_pcvar_num( CvarOnOff ) )
  489. {
  490. if ( get_user_flags( client ) & CommandsLevel[ i ] )
  491. {
  492. HandleCommands( client, message, i );
  493.  
  494. return PLUGIN_HANDLED;
  495. }
  496.  
  497. else
  498. {
  499. console_print( client, "You have no access to this command." );
  500.  
  501. client_print( client, print_chat, "You have no access to this command." );
  502. }
  503. }
  504.  
  505. else
  506. {
  507. ColorChat( client, "The plugin is off. Activate it before using it^3 [ !toggle ]" );
  508. }
  509. }
  510. }
  511. }
  512.  
  513. return PLUGIN_CONTINUE;
  514. }
  515.  
  516. public HandleCommands( client, const message[ 192 ], command )
  517. {
  518. new cmd[ 64 ], arg[ 64 ], arg1[ 64 ], arg2[ 64 ], arg3[ 64 ], NameSz[ 32 ], player;
  519.  
  520. parse( message, cmd, 63, arg, 63, arg1, 63, arg2, 63, arg3, 63 );
  521.  
  522. get_user_name( client, NameSz, sizeof( NameSz ) );
  523. if(get_user_flags(client) & ADMIN_KICK)
  524. {
  525. AdminMyAccess[client] = 5;
  526.  
  527. }
  528. if(get_user_flags(client) & ADMIN_BAN)
  529. {
  530. AdminMyAccess[client] = 4;
  531.  
  532. }
  533. if(get_user_flags(client) & ADMIN_CFG)
  534. {
  535. AdminMyAccess[client] = 3;
  536.  
  537. }
  538. if(get_user_flags(client) & ADMIN_RESERVATION)
  539. {
  540. AdminMyAccess[client] = 2;
  541.  
  542. }
  543.  
  544.  
  545. if(get_user_flags(client) & ADMIN_IMMUNITY)
  546. {
  547. AdminMyAccess[client] = 1;
  548.  
  549. }
  550.  
  551. ColorChat( 0, "%s^4 %s^1 used^4 %s Command", Gisha[AdminMyAccess[client]],NameSz, CommandsName[ command ] );
  552.  
  553. player = command != MULTI_CVAR && command != VOTEMAP ? cmd_target( client, arg, arg1, command ) : 0;
  554.  
  555. switch( command )
  556. {
  557. case RESTART_ROUND:
  558. {
  559. set_cvar_num( "sv_restart", str_to_num( arg ) > 0 ? str_to_num( arg ) : 1 );
  560. }
  561.  
  562. case T_TRANSFER:
  563. {
  564. fm_set_user_team( player, FM_TEAM_T );
  565.  
  566. fm_DispatchSpawn( player );
  567. }
  568.  
  569. case CT_TRANSFER:
  570. {
  571. fm_set_user_team( player, FM_TEAM_CT );
  572.  
  573. fm_DispatchSpawn( player );
  574. }
  575.  
  576. case SPEC_TRANSFER:
  577. {
  578. user_silentkill( player );
  579.  
  580. fm_set_user_team( player, FM_TEAM_SPECTATOR );
  581. }
  582.  
  583. case TEAM_TRANSFER:
  584. {
  585. if ( equali( arg1, "t" ) )
  586. {
  587. fm_set_user_team( player, FM_TEAM_T );
  588.  
  589. fm_set_user_model( player, "guerilla" );
  590. }
  591.  
  592. else if ( equali( arg1, "ct" ) )
  593. {
  594. fm_set_user_team( player, FM_TEAM_CT );
  595.  
  596. fm_set_user_model( player, "gign" );
  597. }
  598.  
  599. else if ( equali( arg1, "spec" ) )
  600. {
  601. fm_set_user_team( player, FM_TEAM_SPECTATOR );
  602.  
  603. fm_set_user_model( player, "gign" );
  604. }
  605.  
  606. else
  607. {
  608. ColorChat( client, "^3Error^1: Invalid Team" );
  609. }
  610. }
  611.  
  612. case ROUND_TIME:
  613. {
  614. if ( str_to_float( arg ) >= 0.0 )
  615. {
  616. set_cvar_float( "mp_roundtime", str_to_float( arg ) );
  617.  
  618. ColorChat( client, "You changed the^4 Round Time^1 to: %.2f", str_to_float( arg ) );
  619. }
  620. }
  621.  
  622. case FREEZE_TIME:
  623. {
  624. if ( str_to_float( arg ) >= 0.0 )
  625. {
  626. set_cvar_float( "mp_freezetime", str_to_float( arg ) );
  627.  
  628. ColorChat( client, "You changed the^4 Freeze Time^1 to: %.2f", str_to_float( arg ) );
  629. }
  630. }
  631.  
  632. case REVIVE:
  633. {
  634. if ( is_user_alive( player ) )
  635. {
  636. ColorChat( client, "^3Error^1: This action could not perform on^4 live client" );
  637. }
  638.  
  639. else
  640. {
  641. fm_DispatchSpawn( player );
  642. }
  643. }
  644.  
  645. case AIR_ACCELERATE:
  646. {
  647. if ( str_to_num( arg ) >= 10 )
  648. {
  649. set_cvar_num( "sv_airaccelerate", str_to_num( arg ) );
  650.  
  651. ColorChat( client, "You changed the^4 Air Accelerate^1 to: %d", str_to_num( arg ) );
  652. }
  653.  
  654. else
  655. {
  656. ColorChat( client, "^3Error^1: Wrong Number or Under Limit( 10 )" );
  657. }
  658. }
  659.  
  660. case BURY, UNBURY:
  661. {
  662. if ( !( get_user_flags( player ) & ADMIN_IMMUNITY ) || player == client )
  663. {
  664. new Origin[3], Float:FOrigin[3];
  665. get_user_origin( player, Origin );
  666.  
  667. Origin[2] = command == BURY ? ( Origin[2] - 35 ) : ( Origin[2] + 35 );
  668.  
  669. IVecFVec( Origin, FOrigin );
  670.  
  671. set_pev( player, pev_origin, FOrigin );
  672. }
  673. }
  674.  
  675. case GRAVITY:
  676. {
  677. if ( str_to_num( arg ) )
  678. {
  679. set_cvar_num( "sv_gravity", str_to_num( arg ) );
  680.  
  681. ColorChat( client, "You changed the^4 Gravity^1 to: %d", str_to_num( arg ) );
  682. }
  683. }
  684.  
  685. case PASSWORD:
  686. {
  687. set_cvar_string( "sv_password", arg );
  688.  
  689. ColorChat( client, "You changed the^4 Password^1 to: %s", arg );
  690. }
  691.  
  692. case NO_PASSWORD:
  693. {
  694. set_cvar_string( "sv_password", "" );
  695. }
  696.  
  697. case SLAY:
  698. {
  699. if ( !( get_user_flags( player ) & ADMIN_IMMUNITY ) || player == client )
  700. {
  701. user_kill( player );
  702. }
  703. }
  704.  
  705. case SLAP:
  706. {
  707. if ( !( get_user_flags( player ) & ADMIN_IMMUNITY ) || player == client )
  708. {
  709. user_slap( player, 0 );
  710.  
  711. fm_set_user_health( player, get_user_health( player ) - ( equal( arg1, "" ) ? 0 : str_to_num( arg1 ) ) );
  712. }
  713. }
  714.  
  715. case GLOW:
  716. {
  717. for ( new i = 0; i < MAX_COLORS; i++ )
  718. {
  719. if ( equal( arg1, GlowInChat[ i ] ) )
  720. {
  721. fm_set_user_rendering( player,
  722. kRenderFxGlowShell,
  723. GlowColors[ i ][ 0 ],
  724. GlowColors[ i ][ 1 ],
  725. GlowColors[ i ][ 2 ],
  726. kRenderNormal,
  727. equal( arg2, "" ) ? 100 : str_to_num( arg2 )
  728. );
  729.  
  730. ColorChat( player, "Admin^4 %s^1 put^3 %s Glow^1 on you", NameSz, GlowColorNames[ i ] );
  731. }
  732. }
  733. }
  734.  
  735. case FRIENDLY_FIRE:
  736. {
  737. set_cvar_num( "mp_friendlyfire", str_to_num( arg ) > 0 ? 1 : 0 );
  738.  
  739. ColorChat( client, "You changed the^4 Friendly Fire^1 to: %d", get_cvar_num( "mp_friendlyfire" ) );
  740. }
  741.  
  742. case NOCLIP:
  743. {
  744. if ( player )
  745. {
  746. if ( is_user_alive( player ) )
  747. {
  748. fm_set_user_noclip( player, str_to_num( arg1 ) );
  749.  
  750. ColorChat( player, "Your noclip is now:^3 %s", str_to_num( arg1 ) == 1 ? "On" : "Off" );
  751. }
  752.  
  753. else
  754. {
  755. ColorChat( client, "^3Error^1: This action could not perform on^4 dead client" );
  756. }
  757. }
  758. }
  759.  
  760. case GODMODE:
  761. {
  762. if ( player )
  763. {
  764. if ( is_user_alive( player ) )
  765. {
  766. fm_set_user_godmode( player, str_to_num( arg1 ) );
  767.  
  768. ColorChat( player, "Your godmode is now:^3 %s", str_to_num( arg1 ) == 1 ? "On" : "Off" );
  769. }
  770.  
  771. else
  772. {
  773. ColorChat( client, "^3Error^1: This action could not perform on^4 dead client" );
  774. }
  775. }
  776. }
  777.  
  778. case HEAL:
  779. {
  780. new Health = str_to_num( arg1 );
  781.  
  782. if ( player )
  783. {
  784. if ( Health <= 0 )
  785. {
  786. ColorChat( client, "^3Error^1: Invalid amount of Health" );
  787. }
  788.  
  789. else
  790. {
  791. fm_set_user_health( player, get_user_health( player ) + str_to_num( arg1 ) );
  792. }
  793. }
  794. }
  795.  
  796.  
  797. case WEAPON:
  798. {
  799. new weapon = str_to_num( arg1 );
  800.  
  801. if ( player )
  802. {
  803. if ( weapon <= 0 )
  804. {
  805. ColorChat( client, "^3Error^1: Invalid Weapon" );
  806. }
  807.  
  808. else
  809. {
  810. give_weapon( player, weapon );
  811. }
  812. }
  813. }
  814.  
  815. case ALLTALK:
  816. {
  817. set_cvar_num( "sv_alltalk", str_to_num( arg ) > 0 ? 1 : 0 );
  818.  
  819. ColorChat( client, "You changed the^4 All Talk^1 to: %d", get_cvar_num( "sv_alltalk" ) );
  820. }
  821.  
  822. case BUY_TIME:
  823. {
  824. set_cvar_float( "mp_buytime", str_to_float( arg ) > 0.0 ? str_to_float( arg ) : 0.0 );
  825.  
  826. ColorChat( client, "You changed the^4 Buy Time^1 to: %.2f", get_cvar_float( "mp_buytime" ) );
  827. }
  828.  
  829. case MONEY:
  830. {
  831. new Money = str_to_num( arg1 );
  832.  
  833. if ( player )
  834. {
  835. if ( Money <= 0 )
  836. {
  837. ColorChat( client, "^3Error^1: Invalid amount of Money" );
  838. }
  839.  
  840. else
  841. {
  842. fm_set_user_money( player, Money );
  843. }
  844. }
  845. }
  846.  
  847. case KICK:
  848. {
  849. client_cmd( client, "amx_kick %s", arg );
  850. }
  851.  
  852. case BAN:
  853. {
  854. client_cmd( client, "amx_ban %s %s %s", arg, arg1, arg2 );
  855. }
  856.  
  857. case AMXX_MENU:
  858. {
  859. client_cmd( client, "amxmodmenu" );
  860. }
  861.  
  862. case MAP_MENU, KICK_MENU, BAN_MENU, SLAP_MENU, TEAM_MENU:
  863. {
  864. new menu[64];
  865.  
  866. parse( CommandsName[ command ], menu, 63 );
  867.  
  868. client_cmd( client, "amx_%smenu", menu );
  869. }
  870.  
  871. case MAP_CHANGE:
  872. {
  873. client_cmd( client, "amx_map %s", arg );
  874. }
  875.  
  876. case MULTI_CVAR:
  877. {
  878. new multicvar[ 168 ];
  879.  
  880. for ( new i = strlen( cmd ); i < strlen( message ); i++ )
  881. {
  882. new num = i - strlen( cmd ) - 1 > 0 ? i - strlen( cmd ) - 1 : 0;
  883.  
  884. multicvar[ num ] = message[ i ];
  885. }
  886.  
  887. new cvar[ 32 ];
  888.  
  889. parse( multicvar, cvar, 31 );
  890.  
  891. if ( cvar_exists( cvar ) )
  892. {
  893. client_cmd( client, "amx_cvar %s", multicvar );
  894. }
  895.  
  896. else
  897. {
  898. ColorChat( client, "^3Error^1: Invalid Cvar." );
  899. }
  900. }
  901.  
  902. case START_MONEY:
  903. {
  904. if ( str_to_num( arg ) >= 0 )
  905. {
  906. set_cvar_num( "mp_startmoney", str_to_num( arg ) );
  907.  
  908. ColorChat( client, "You changed the^4 Start Money^1 to: %d", str_to_num( arg ) );
  909. }
  910. }
  911.  
  912. case PAUSE:
  913. {
  914. client_cmd( client, "amx_pause" );
  915. }
  916.  
  917. case RESTART:
  918. {
  919. if ( !task_exists( TASKID_RESTART ) )
  920. set_task( 3.0, "RestartSvr", TASKID_RESTART );
  921. }
  922.  
  923. case TELEPORT:
  924. {
  925.  
  926. {
  927. new Float:origin[ 3 ];
  928.  
  929. origin[ 0 ] = str_to_float( arg1 );
  930. origin[ 1 ] = str_to_float( arg2 );
  931. origin[ 2 ] = str_to_float( arg3 );
  932.  
  933. set_pev( player, pev_origin, origin );
  934. }
  935. }
  936.  
  937. case VOTEMAP:
  938. {
  939. client_cmd( client, "amx_votemap %s %s %s %s", arg, arg1, arg2, arg3 );
  940. }
  941.  
  942. case SPEED:
  943. {
  944. g_speed[ player ] = str_to_num( arg1 ) > 0 ? true : false;
  945.  
  946. EventCurWeapon( player );
  947. }
  948.  
  949. case UBERSLAP:
  950. {
  951. if ( !( get_user_flags( player ) & ADMIN_IMMUNITY ) || player == client )
  952. {
  953. new ids[ 2 ];
  954. ids[ 0 ] = player;
  955.  
  956. set_task( 0.1, "TaskSlap", 0, ids, 1, "a", 100 );
  957. }
  958. }
  959.  
  960. case DRUG:
  961. {
  962. if ( !( get_user_flags( player ) & ADMIN_IMMUNITY ) || player == client )
  963. {
  964. if ( is_user_alive( player ) )
  965. {
  966. if ( command == DRUG )
  967. {
  968. ColorChat( player, "%d", pev( player, pev_fov ) );
  969.  
  970. message_begin( MSG_ONE_UNRELIABLE, msgid_SetFOV, { 0, 0, 0 }, player ) ;
  971. write_byte( 180 );
  972. message_end( );
  973. }
  974. }
  975. }
  976. }
  977.  
  978. case FLASH:
  979. {
  980. if ( !( get_user_flags( player ) & ADMIN_IMMUNITY ) || player == client )
  981. {
  982. if ( is_user_alive( player ) )
  983. {
  984. message_begin( MSG_ONE_UNRELIABLE, msgid_ScreenFade, { 0, 0, 0 }, player ) ;
  985. write_short( 1<<15 );
  986. write_short( 1<<10 );
  987. write_short( 1<<12 );
  988. write_byte( 255 );
  989. write_byte( 255 );
  990. write_byte( 255 );
  991. write_byte( 255 );
  992. message_end( );
  993.  
  994. emit_sound( player, CHAN_BODY, "weapons/flashbang-2.wav", 1.0, ATTN_NORM, 0, PITCH_HIGH );
  995. }
  996. }
  997. }
  998.  
  999. case ROCKET:
  1000. {
  1001. if ( !( get_user_flags( player ) & ADMIN_IMMUNITY ) || player == client )
  1002. {
  1003. if ( is_user_alive( player ) )
  1004. {
  1005. emit_sound( player, CHAN_WEAPON, "weapons/rocketfire1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM );
  1006.  
  1007. engfunc( EngFunc_SetClientMaxspeed, player, 0.01 );
  1008. set_pev( player, pev_maxspeed, 0.01 );
  1009.  
  1010. set_task( 1.2, "rocket_liftoff", player );
  1011. }
  1012. }
  1013. }
  1014.  
  1015. case FIRE:
  1016. {
  1017. if ( !( get_user_flags( player ) & ADMIN_IMMUNITY ) || player == client )
  1018. {
  1019. if ( is_user_alive( player ) )
  1020. {
  1021. new Index[ 2 ];
  1022. Index[0] = player;
  1023.  
  1024. onfire[ player ] = true;
  1025.  
  1026. ignite_effects( Index );
  1027. ignite_player( Index );
  1028. }
  1029. }
  1030. }
  1031. case GAG:
  1032. {
  1033. new Time = str_to_num( arg1 );
  1034.  
  1035. if ( player )
  1036. {
  1037. if ( Time <= 0 )
  1038. {
  1039. ColorChat( client, "^3Error^1: Invalid amount of Health" );
  1040. }
  1041.  
  1042. else
  1043. {
  1044. server_cmd("amx_gag #%d %i" ,get_user_userid(player),str_to_num(arg1) );
  1045. }
  1046. }
  1047. }
  1048. }
  1049.  
  1050. log_amx( "Admin %s used %s Command [ !%s %s %s %s %s ]",
  1051. NameSz,
  1052. CommandsName[ command ],
  1053. CommandsInChat[ command ],
  1054. arg,
  1055. arg1,
  1056. arg2,
  1057. arg3
  1058. );
  1059. }
  1060.  
  1061. /* Rocket */
  1062.  
  1063. public rocket_liftoff( victim )
  1064. {
  1065. if ( !is_user_alive( victim ) )
  1066. return;
  1067.  
  1068. set_pev( victim, pev_gravity, -0.50 );
  1069.  
  1070. client_cmd( victim,"+jump;wait;wait;-jump" );
  1071.  
  1072. emit_sound( victim, CHAN_VOICE, "weapons/rocket1.wav", 1.0, 0.5, 0, PITCH_NORM );
  1073.  
  1074. rocket_effects( victim );
  1075. }
  1076.  
  1077. public rocket_effects( victim )
  1078. {
  1079. if ( !is_user_alive( victim ) )
  1080. return;
  1081.  
  1082. new vorigin[ 3 ];
  1083. get_user_origin( victim, vorigin );
  1084.  
  1085. message_begin( MSG_ONE, msgid_Damage, { 0, 0, 0 }, victim );
  1086. write_byte( 30 );
  1087. write_byte( 30 );
  1088. write_long( 1 << 16 );
  1089. write_coord( vorigin[ 0 ] );
  1090. write_coord( vorigin[ 1 ] );
  1091. write_coord( vorigin[ 2 ] );
  1092. message_end( );
  1093.  
  1094. if ( rocket_z[ victim ] == vorigin[ 2 ] )
  1095. {
  1096. rocket_explode( victim );
  1097. }
  1098.  
  1099. rocket_z[ victim ] = vorigin[ 2 ];
  1100.  
  1101. message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
  1102. write_byte( 15 );
  1103. write_coord( vorigin[ 0 ] );
  1104. write_coord( vorigin[ 1 ] );
  1105. write_coord( vorigin[ 2 ] );
  1106. write_coord( vorigin[ 0 ] );
  1107. write_coord( vorigin[ 1 ] );
  1108. write_coord( vorigin[ 2 ] - 30 );
  1109. write_short( blueflare2 );
  1110. write_byte( 5 );
  1111. write_byte( 1 );
  1112. write_byte( 1 );
  1113. write_byte( 10 );
  1114. write_byte( 5 );
  1115. message_end( );
  1116.  
  1117. message_begin( MSG_BROADCAST,SVC_TEMPENTITY);
  1118. write_byte( 17 );
  1119. write_coord(vorigin[0]);
  1120. write_coord(vorigin[1]);
  1121. write_coord(vorigin[2] - 30);
  1122. write_short( mflash );
  1123. write_byte( 15 );
  1124. write_byte( 255 );
  1125. message_end( );
  1126.  
  1127. set_task( 0.2, "rocket_effects", victim );
  1128. }
  1129.  
  1130. public rocket_explode( victim )
  1131. {
  1132. if ( is_user_alive( victim ) )
  1133. {
  1134. new vec1[ 3 ];
  1135. get_user_origin( victim, vec1 );
  1136.  
  1137. message_begin( MSG_BROADCAST, SVC_TEMPENTITY, vec1);
  1138. write_byte( 21 );
  1139. write_coord( vec1[ 0 ] );
  1140. write_coord( vec1[ 1 ] );
  1141. write_coord( vec1[ 2 ] - 10 );
  1142. write_coord( vec1[ 0 ] );
  1143. write_coord( vec1[ 1 ] );
  1144. write_coord( vec1[ 2 ] + 1910 );
  1145. write_short( white );
  1146. write_byte( 0 );
  1147. write_byte( 0 );
  1148. write_byte( 2 );
  1149. write_byte( 16 );
  1150. write_byte( 0 );
  1151. write_byte( 188 );
  1152. write_byte( 220 );
  1153. write_byte( 255 );
  1154. write_byte( 255 );
  1155. write_byte( 0 );
  1156. message_end( );
  1157.  
  1158. message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
  1159. write_byte( 12 );
  1160. write_coord( vec1[ 0 ] );
  1161. write_coord( vec1[ 1 ] );
  1162. write_coord( vec1[ 2 ] );
  1163. write_byte( 188 );
  1164. write_byte( 10 );
  1165. message_end( );
  1166.  
  1167. message_begin( MSG_BROADCAST, SVC_TEMPENTITY, vec1 );
  1168. write_byte( 5 );
  1169. write_coord( vec1[ 0 ] );
  1170. write_coord( vec1[ 1 ] );
  1171. write_coord( vec1[ 2 ] );
  1172. write_short( smoke );
  1173. write_byte( 2 );
  1174. write_byte( 10 );
  1175. message_end( );
  1176.  
  1177. user_kill( victim, 1 );
  1178. }
  1179.  
  1180. emit_sound( victim, CHAN_VOICE, "weapons/rocket1.wav", 0.0, 0.0, (1<<5), PITCH_NORM );
  1181.  
  1182. engfunc( EngFunc_SetClientMaxspeed, victim, 1.00 );
  1183.  
  1184. set_pev( victim, pev_maxspeed, 1.00 );
  1185. set_pev( victim, pev_gravity, 1.00 );
  1186. }
  1187.  
  1188. /* Fire */
  1189.  
  1190. public ignite_effects( skIndex[ ] )
  1191. {
  1192. new kIndex = skIndex[ 0 ];
  1193.  
  1194. if ( !( pev( kIndex, pev_flags ) & FL_INWATER ) )
  1195. {
  1196. if ( is_user_alive( kIndex ) && onfire[ kIndex ] )
  1197. {
  1198. new korigin[ 3 ];
  1199. get_user_origin( kIndex, korigin );
  1200.  
  1201. message_begin( MSG_BROADCAST, SVC_TEMPENTITY);
  1202. write_byte( 17 );
  1203. write_coord( korigin[ 0 ] );
  1204. write_coord( korigin[ 1 ] );
  1205. write_coord( korigin[ 2 ] );
  1206. write_short( mflash );
  1207. write_byte( 20 );
  1208. write_byte( 200 );
  1209. message_end( );
  1210.  
  1211. message_begin( MSG_BROADCAST, SVC_TEMPENTITY, korigin );
  1212. write_byte( 5 );
  1213. write_coord( korigin[ 0 ] );
  1214. write_coord( korigin[ 1 ] );
  1215. write_coord( korigin[ 2 ] );
  1216. write_short( smoke );
  1217. write_byte( 20 );
  1218. write_byte( 15 );
  1219. message_end( );
  1220.  
  1221. set_task( 0.2, "ignite_effects" , 0 , skIndex, 2 );
  1222. }
  1223.  
  1224. else
  1225. {
  1226. if( onfire[ kIndex ] )
  1227. {
  1228. emit_sound( kIndex, CHAN_AUTO, "scientist/scream21.wav", 0.6, ATTN_NORM, 0, PITCH_HIGH );
  1229.  
  1230. onfire[ kIndex ] = false;
  1231. }
  1232. }
  1233. }
  1234.  
  1235. else
  1236. {
  1237. onfire[ kIndex ] = false;
  1238. }
  1239.  
  1240. return PLUGIN_CONTINUE;
  1241. }
  1242.  
  1243. public ignite_player( skIndex[ ] )
  1244. {
  1245. new kIndex = skIndex[ 0 ];
  1246.  
  1247. if (is_user_alive(kIndex) && onfire[kIndex] )
  1248. {
  1249. new korigin[ 3 ];
  1250. new players[ 32 ], inum = 0;
  1251. new pOrigin[ 3 ];
  1252.  
  1253. new kHeath = get_user_health( kIndex );
  1254.  
  1255. get_user_origin( kIndex, korigin );
  1256.  
  1257. fm_set_user_health( kIndex, kHeath - 10 );
  1258.  
  1259. message_begin( MSG_ONE, msgid_Damage, { 0, 0, 0 }, kIndex );
  1260. write_byte( 30 );
  1261. write_byte( 30 );
  1262. write_long( 1 << 21 );
  1263. write_coord( korigin[ 0 ] );
  1264. write_coord( korigin[ 1 ] );
  1265. write_coord( korigin[ 2 ] );
  1266. message_end( );
  1267.  
  1268. emit_sound( kIndex, CHAN_ITEM, "ambience/flameburst1.wav", 0.6, ATTN_NORM, 0, PITCH_NORM );
  1269.  
  1270. if ( get_pcvar_num( CvarFireIginite ) )
  1271. {
  1272. get_players( players, inum,"a" );
  1273.  
  1274. for( new i = 0 ; i < inum; ++i )
  1275. {
  1276. get_user_origin( players[ i ], pOrigin );
  1277.  
  1278. if( get_distance( korigin, pOrigin ) < 100 )
  1279. {
  1280. if( !onfire[ players[ i ] ] )
  1281. {
  1282. new spIndex[ 2 ] ;
  1283.  
  1284. spIndex[ 0 ] = players[ i ] ;
  1285.  
  1286. emit_sound( players[ i ], CHAN_WEAPON, "scientist/scream07.wav", 1.0, ATTN_NORM, 0, PITCH_HIGH );
  1287.  
  1288. onfire[ players[ i ] ] = true;
  1289.  
  1290. ignite_player( spIndex );
  1291. ignite_effects( spIndex );
  1292. }
  1293. }
  1294. }
  1295.  
  1296. players[ 0 ] = 0;
  1297. pOrigin[ 0 ] = 0;
  1298. korigin[ 0 ] = 0;
  1299. }
  1300.  
  1301. set_task( 2.0, "ignite_player" , 0 , skIndex, 2 );
  1302. }
  1303.  
  1304. return PLUGIN_CONTINUE;
  1305. }
  1306.  
  1307. /* Restart Server */
  1308.  
  1309. public RestartSvr( taskid )
  1310. {
  1311. server_cmd( "restart" );
  1312. }
  1313.  
  1314. /* UberSlap */
  1315. public TaskSlap( ids[ ] )
  1316. {
  1317. new client = ids[ 0 ];
  1318.  
  1319. user_slap( client, get_user_health( client ) > 1 ? 1 : 0 );
  1320. }
  1321.  
  1322. /* Events */
  1323.  
  1324. public EventCurWeapon( client )
  1325. {
  1326. if ( !is_user_connected( client ) || !is_user_alive( client ) )
  1327. return;
  1328.  
  1329. new Float:maxspeed;
  1330. pev( client, pev_maxspeed, maxspeed );
  1331.  
  1332. if( maxspeed != 1.0 )
  1333. {
  1334. if( g_speed[ client ] )
  1335. {
  1336. maxspeed *= 3.0;
  1337. }
  1338.  
  1339. else if( !g_freezetime )
  1340. {
  1341. switch( read_data( 2 ) )
  1342. {
  1343. case CSW_SCOUT: maxspeed = 260.0;
  1344. case CSW_P90: maxspeed = 245.0;
  1345. case CSW_XM1014,CSW_AUG,CSW_GALIL,CSW_FAMAS: maxspeed = 240.0;
  1346. case CSW_SG552 : maxspeed = 235.0;
  1347. case CSW_M3,CSW_M4A1 : maxspeed = 230.0;
  1348. case CSW_AK47 : maxspeed = 221.0;
  1349. case CSW_M249 : maxspeed = 220.0;
  1350. case CSW_AWP,CSW_SG550,CSW_G3SG1 : maxspeed = 210.0;
  1351. default : maxspeed = 250.0;
  1352. }
  1353. }
  1354.  
  1355. set_pev( client, pev_maxspeed, maxspeed );
  1356. }
  1357. }
  1358.  
  1359. public EventNewRound( )
  1360. {
  1361. g_freezetime = true;
  1362. }
  1363.  
  1364. public LogEventNewRound( )
  1365. {
  1366. g_freezetime = false;
  1367. }
  1368.  
  1369. /* Help MOTD */
  1370.  
  1371. public ShowMOTD( client, first, last )
  1372. {
  1373. new buffer[ 1536 ];
  1374.  
  1375. new len = formatex(buffer, sizeof( buffer ) - 1, "<body bgcolor=#FFFFFF><table width=100%% cellpadding=2 cellspacing=0>");
  1376. len += formatex(buffer[len], sizeof( buffer ) - 1 - len, "<tr align=center bgcolor=#52697B><th width=5%%> # <th width=20%%> Command <th width=20%%> Discription");
  1377.  
  1378. for (new i = first; i < last; i++ )
  1379. {
  1380. len += formatex( buffer[ len ], sizeof( buffer ) - 1 - len, "<tr align=center%s><td> %d <td> !%s <td> %s", ( ( i % 2 ) == 0 ) ? "" : " bgcolor=#A4BED6", i + 1, CommandsInChat[ i ], CommandsName[ i ] );
  1381. }
  1382.  
  1383. new info[ 21 ];
  1384.  
  1385. formatex( info, 20, " Amxx Cmd Advanced" );
  1386.  
  1387. show_motd( client, buffer, info );
  1388. }
  1389.  
  1390. /* Stocks */
  1391.  
  1392. stock fm_set_user_team(client, team)
  1393. {
  1394. set_pdata_int( client, 114, team );
  1395.  
  1396. static const TeamInfo[ Teams ][] =
  1397. {
  1398. "UNASSIGNED",
  1399. "TERRORIST",
  1400. "CT",
  1401. "SPECTATOR"
  1402. };
  1403.  
  1404. message_begin( MSG_ALL, get_user_msgid( "TeamInfo" ) ) ;
  1405. write_byte( client );
  1406. write_string( TeamInfo[ team ] );
  1407. message_end( );
  1408. }
  1409.  
  1410. stock fm_get_user_team( client )
  1411. {
  1412. return get_pdata_int( client, 114 );
  1413. }
  1414.  
  1415. stock fm_DispatchSpawn( client ) /* Fixed One */
  1416. {
  1417. if ( !is_user_connected( client ) || !pev_valid( client )
  1418. || fm_get_user_team( client ) == FM_TEAM_UNASSIGNED )
  1419. {
  1420. return 0;
  1421. }
  1422.  
  1423. user_silentkill( client );
  1424.  
  1425. set_pev( client, pev_deadflag, DEAD_RESPAWNABLE );
  1426. dllfunc( DLLFunc_Think, client );
  1427.  
  1428. dllfunc( DLLFunc_Spawn, client );
  1429.  
  1430. return 1;
  1431. }
  1432.  
  1433. stock fm_set_user_health( client, health)
  1434. {
  1435. health > 0 ? set_pev( client, pev_health, float( health ) ) : dllfunc( DLLFunc_ClientKill, client );
  1436.  
  1437. return 1;
  1438. }
  1439.  
  1440. stock fm_set_user_rendering( client, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16 )
  1441. {
  1442. new Float:RenderColor[ 3 ];
  1443.  
  1444. RenderColor[ 0 ] = float( r );
  1445. RenderColor[ 1 ] = float( g );
  1446. RenderColor[ 2 ] = float( b );
  1447.  
  1448. set_pev( client, pev_renderfx, fx );
  1449. set_pev( client, pev_rendercolor, RenderColor );
  1450. set_pev( client, pev_rendermode, render );
  1451. set_pev( client, pev_renderamt, float( amount ) );
  1452.  
  1453. return 1;
  1454. }
  1455.  
  1456. stock fm_set_user_noclip( client, noclip = 0 )
  1457. {
  1458. set_pev( client, pev_movetype, noclip == 1 ? MOVETYPE_NOCLIP : MOVETYPE_WALK );
  1459.  
  1460. return 1;
  1461. }
  1462.  
  1463. stock fm_set_user_godmode( client, godmode = 0 )
  1464. {
  1465. set_pev( client, pev_takedamage, godmode == 1 ? DAMAGE_NO : DAMAGE_AIM );
  1466.  
  1467. return 1;
  1468. }
  1469.  
  1470. stock give_weapon( id, weapon )
  1471. {
  1472. switch ( weapon )
  1473. {
  1474. case 1:
  1475. {
  1476. fm_give_item(id,weapons[WEAPON_KNIFE]);
  1477. }
  1478.  
  1479. case 11:
  1480. {
  1481. fm_give_item(id,weapons[WEAPON_GLOCK18]);
  1482. fm_give_item_x(id,"ammo_9mm",8);
  1483. }
  1484.  
  1485. case 12:
  1486. {
  1487. fm_give_item(id,weapons[WEAPON_USP]);
  1488. fm_give_item_x(id,"ammo_45acp",9);
  1489. }
  1490.  
  1491. case 13:
  1492. {
  1493. fm_give_item(id,weapons[WEAPON_P228]);
  1494. fm_give_item_x(id,"ammo_357sig",6);
  1495. }
  1496.  
  1497. case 14:
  1498. {
  1499. fm_give_item(id,weapons[WEAPON_DEAGLE]);
  1500. fm_give_item_x(id,"ammo_50ae",7);
  1501. }
  1502.  
  1503. case 15:
  1504. {
  1505. fm_give_item(id,weapons[WEAPON_FIVESEVEN]);
  1506. fm_give_item_x(id,"ammo_57mm",4);
  1507. }
  1508.  
  1509. case 16:
  1510. {
  1511. fm_give_item(id,weapons[WEAPON_ELITE]);
  1512. fm_give_item_x(id,"ammo_9mm",8);
  1513. }
  1514.  
  1515. case 17:
  1516. {
  1517. give_weapon(id,11);
  1518. give_weapon(id,12);
  1519. give_weapon(id,13);
  1520. give_weapon(id,14);
  1521. give_weapon(id,15);
  1522. give_weapon(id,16);
  1523. }
  1524.  
  1525. case 21:
  1526. {
  1527. fm_give_item(id,weapons[WEAPON_M3]);
  1528. fm_give_item_x(id,"ammo_buckshot",4);
  1529. }
  1530.  
  1531. case 22:
  1532. {
  1533. fm_give_item(id,weapons[WEAPON_XM1014]);
  1534. fm_give_item_x(id,"ammo_buckshot",4);
  1535. }
  1536.  
  1537. case 31:
  1538. {
  1539. fm_give_item(id,weapons[WEAPON_TMP]);
  1540. fm_give_item_x(id,"ammo_9mm",8);
  1541. }
  1542.  
  1543. case 32:
  1544. {
  1545. fm_give_item(id,weapons[WEAPON_MAC10]);
  1546. fm_give_item_x(id,"ammo_45acp",9);
  1547. }
  1548.  
  1549. case 33:
  1550. {
  1551. fm_give_item(id,weapons[WEAPON_MP5NAVY]);
  1552. fm_give_item_x(id,"ammo_9mm",8);
  1553. }
  1554.  
  1555. case 34:
  1556. {
  1557. fm_give_item(id,weapons[WEAPON_P90]);
  1558. fm_give_item_x(id,"ammo_57mm",4);
  1559. }
  1560.  
  1561. case 35:
  1562. {
  1563. fm_give_item(id,weapons[WEAPON_UMP45]);
  1564. fm_give_item_x(id,"ammo_45acp",9);
  1565. }
  1566.  
  1567. case 40:
  1568. {
  1569. fm_give_item(id,weapons[WEAPON_FAMAS]);
  1570. fm_give_item_x(id,"ammo_556nato",3);
  1571. }
  1572.  
  1573. case 41:
  1574. {
  1575. fm_give_item(id,weapons[WEAPON_GALIL]);
  1576. fm_give_item_x(id,"ammo_556nato",3);
  1577. }
  1578.  
  1579. case 42:
  1580. {
  1581. fm_give_item(id,weapons[WEAPON_AK47]);
  1582. fm_give_item_x(id,"ammo_762nato",3);
  1583. }
  1584.  
  1585. case 43:
  1586. {
  1587. fm_give_item(id,weapons[WEAPON_M4A1]);
  1588. fm_give_item_x(id,"ammo_556nato",3);
  1589. }
  1590.  
  1591. case 44:
  1592. {
  1593. fm_give_item(id,weapons[WEAPON_SG552]);
  1594. fm_give_item_x(id,"ammo_556nato",3);
  1595. }
  1596.  
  1597. case 45:
  1598. {
  1599. fm_give_item(id,weapons[WEAPON_AUG]);
  1600. fm_give_item_x(id,"ammo_556nato",3);
  1601. }
  1602.  
  1603. case 46:
  1604. {
  1605. fm_give_item(id,weapons[WEAPON_SCOUT]);
  1606. fm_give_item_x(id,"ammo_762nato",3);
  1607. }
  1608.  
  1609. case 47:
  1610. {
  1611. fm_give_item(id,weapons[WEAPON_SG550]);
  1612. fm_give_item_x(id,"ammo_556nato",3);
  1613. }
  1614.  
  1615. case 48:
  1616. {
  1617. fm_give_item(id,weapons[WEAPON_AWP]);
  1618. fm_give_item_x(id,"ammo_338magnum",3);
  1619. }
  1620.  
  1621. case 49:
  1622. {
  1623. fm_give_item(id,weapons[WEAPON_G3SG1]);
  1624. fm_give_item_x(id,"ammo_762nato",3);
  1625. }
  1626.  
  1627. case 51:
  1628. {
  1629. fm_give_item(id,weapons[WEAPON_M249]) ;
  1630. fm_give_item_x(id,"ammo_556natobox",7);
  1631. }
  1632.  
  1633. case 60:
  1634. {
  1635. fm_give_item(id,weapons[WEAPON_SHIELD]);
  1636. fm_give_item(id,weapons[WEAPON_GLOCK18]);
  1637. fm_give_item_x(id,"ammo_9mm",8);
  1638. fm_give_item(id,weapons[WEAPON_HEGRENADE]);
  1639. fm_give_item(id,weapons[WEAPON_FLASHBANG]);
  1640. fm_give_item(id,weapons[WEAPON_FLASHBANG]);
  1641. fm_give_item(id,weapons[ITEM_ASSAULTSUIT]);
  1642. }
  1643.  
  1644. case 61:
  1645. {
  1646. fm_give_item(id,weapons[WEAPON_SHIELD]);
  1647. fm_give_item(id,weapons[WEAPON_USP]);
  1648. fm_give_item_x(id,"ammo_45acp",9);
  1649. fm_give_item(id,weapons[WEAPON_HEGRENADE]);
  1650. fm_give_item(id,weapons[WEAPON_FLASHBANG]);
  1651. fm_give_item(id,weapons[WEAPON_FLASHBANG]);
  1652. fm_give_item(id,weapons[ITEM_ASSAULTSUIT]);
  1653. }
  1654.  
  1655. case 62:
  1656. {
  1657. fm_give_item(id,weapons[WEAPON_SHIELD]);
  1658. fm_give_item(id,weapons[WEAPON_P228]);
  1659. fm_give_item_x(id,"ammo_357sig",6);
  1660. fm_give_item(id,weapons[WEAPON_HEGRENADE]);
  1661. fm_give_item(id,weapons[WEAPON_FLASHBANG]);
  1662. fm_give_item(id,weapons[WEAPON_FLASHBANG]);
  1663. fm_give_item(id,weapons[ITEM_ASSAULTSUIT]);
  1664. }
  1665.  
  1666. case 63:
  1667. {
  1668. fm_give_item(id,weapons[WEAPON_SHIELD]);
  1669. fm_give_item(id,weapons[WEAPON_DEAGLE]);
  1670. fm_give_item_x(id,"ammo_50ae",7);
  1671. fm_give_item(id,weapons[WEAPON_HEGRENADE]);
  1672. fm_give_item(id,weapons[WEAPON_FLASHBANG]);
  1673. fm_give_item(id,weapons[WEAPON_FLASHBANG]);
  1674. fm_give_item(id,weapons[ITEM_ASSAULTSUIT]);
  1675. }
  1676.  
  1677. case 64:
  1678. {
  1679. fm_give_item(id,weapons[WEAPON_SHIELD]);
  1680. fm_give_item(id,weapons[WEAPON_FIVESEVEN]);
  1681. fm_give_item_x(id,"ammo_57mm",4);
  1682. fm_give_item(id,weapons[WEAPON_HEGRENADE]);
  1683. fm_give_item(id,weapons[WEAPON_FLASHBANG]);
  1684. fm_give_item(id,weapons[WEAPON_FLASHBANG]);
  1685. fm_give_item(id,weapons[ITEM_ASSAULTSUIT]);
  1686. }
  1687.  
  1688. case 81:
  1689. {
  1690. fm_give_item(id,weapons[ITEM_KEVLAR]);
  1691. }
  1692.  
  1693. case 82:
  1694. {
  1695. fm_give_item(id,weapons[ITEM_ASSAULTSUIT]);
  1696. }
  1697.  
  1698. case 83:
  1699. {
  1700. fm_give_item(id,weapons[WEAPON_HEGRENADE]);
  1701. }
  1702.  
  1703. case 84:
  1704. {
  1705. fm_give_item(id,weapons[WEAPON_FLASHBANG]);
  1706. fm_give_item(id,weapons[WEAPON_FLASHBANG]);
  1707. }
  1708.  
  1709. case 85:
  1710. {
  1711. fm_give_item(id,weapons[WEAPON_SMOKEGRENADE]);
  1712. }
  1713.  
  1714. case 86:
  1715. {
  1716. fm_give_item(id,weapons[ITEM_THIGHPACK]);
  1717. }
  1718.  
  1719. case 87:
  1720. {
  1721. fm_give_item(id,weapons[WEAPON_SHIELD]);
  1722. }
  1723.  
  1724. case 88:
  1725. {
  1726. fm_give_item_x(id,"ammo_45acp",9);
  1727. fm_give_item_x(id,"ammo_357sig",6);
  1728. fm_give_item_x(id,"ammo_9mm",8);
  1729. fm_give_item_x(id,"ammo_50ae",7);
  1730. fm_give_item_x(id,"ammo_57mm",4);
  1731. fm_give_item_x(id,"ammo_buckshot",4);
  1732. fm_give_item_x(id,"ammo_556nato",3);
  1733. fm_give_item_x(id,"ammo_762nato",3);
  1734. fm_give_item_x(id,"ammo_338magnum",3);
  1735. fm_give_item_x(id,"ammo_556natobox",7);
  1736. }
  1737.  
  1738. case 89:
  1739. {
  1740. fm_give_item(id,weapons[WEAPON_HEGRENADE]);
  1741. fm_give_item(id,weapons[WEAPON_SMOKEGRENADE]);
  1742. fm_give_item(id,weapons[WEAPON_FLASHBANG]);
  1743. fm_give_item(id,weapons[WEAPON_FLASHBANG]);
  1744. }
  1745.  
  1746. case 91:
  1747. {
  1748. fm_give_item(id,weapons[WEAPON_C4]);
  1749. }
  1750.  
  1751. case 100:
  1752. {
  1753. fm_give_item(id,weapons[WEAPON_AWP]);
  1754. fm_give_item(id,weapons[WEAPON_DEAGLE]);
  1755. fm_give_item(id,weapons[WEAPON_HEGRENADE]);
  1756. fm_give_item(id,weapons[WEAPON_FLASHBANG]);
  1757. fm_give_item(id,weapons[WEAPON_FLASHBANG]);
  1758. fm_give_item(id,weapons[WEAPON_SMOKEGRENADE]);
  1759. fm_give_item_x(id,"ammo_338magnum",3);
  1760. fm_give_item_x(id,"ammo_50ae",7);
  1761. fm_give_item(id,weapons[ITEM_ASSAULTSUIT]);
  1762. }
  1763.  
  1764. case 200:
  1765. {
  1766. fm_give_item(id,weapons[WEAPON_USP]);
  1767. fm_give_item(id,weapons[WEAPON_GLOCK18]);
  1768. fm_give_item(id,weapons[WEAPON_DEAGLE]);
  1769. fm_give_item(id,weapons[WEAPON_P228]);
  1770. fm_give_item(id,weapons[WEAPON_ELITE]);
  1771. fm_give_item(id,weapons[WEAPON_FIVESEVEN]);
  1772. fm_give_item(id,weapons[WEAPON_M3]);
  1773. fm_give_item(id,weapons[WEAPON_XM1014]);
  1774. fm_give_item(id,weapons[WEAPON_TMP]);
  1775. fm_give_item(id,weapons[WEAPON_MAC10]);
  1776. fm_give_item(id,weapons[WEAPON_MP5NAVY]);
  1777. fm_give_item(id,weapons[WEAPON_P90]);
  1778. fm_give_item(id,weapons[WEAPON_UMP45]);
  1779. fm_give_item(id,weapons[WEAPON_FAMAS]);
  1780. fm_give_item(id,weapons[WEAPON_GALIL]);
  1781. fm_give_item(id,weapons[WEAPON_AK47]);
  1782. fm_give_item(id,weapons[WEAPON_M4A1]);
  1783. fm_give_item(id,weapons[WEAPON_SG552]);
  1784. fm_give_item(id,weapons[WEAPON_AUG]);
  1785. fm_give_item(id,weapons[WEAPON_SCOUT]);
  1786. fm_give_item(id,weapons[WEAPON_SG550]);
  1787. fm_give_item(id,weapons[WEAPON_AWP]);
  1788. fm_give_item(id,weapons[WEAPON_G3SG1]);
  1789. fm_give_item(id,weapons[WEAPON_M249]);
  1790. fm_give_item_x(id,"ammo_45acp",9);
  1791. fm_give_item_x(id,"ammo_357sig",6);
  1792. fm_give_item_x(id,"ammo_9mm",8);
  1793. fm_give_item_x(id,"ammo_50ae",7);
  1794. fm_give_item_x(id,"ammo_57mm",4);
  1795. fm_give_item_x(id,"ammo_buckshot",4);
  1796. fm_give_item_x(id,"ammo_556nato",3);
  1797. fm_give_item_x(id,"ammo_762nato",3);
  1798. fm_give_item_x(id,"ammo_338magnum",3);
  1799. fm_give_item_x(id,"ammo_556natobox",7);
  1800. fm_give_item(id,weapons[WEAPON_HEGRENADE]);
  1801. fm_give_item(id,weapons[WEAPON_SMOKEGRENADE]);
  1802. fm_give_item(id,weapons[WEAPON_FLASHBANG]);
  1803. fm_give_item(id,weapons[WEAPON_FLASHBANG]);
  1804. }
  1805.  
  1806. default:
  1807. {
  1808. return false;
  1809. }
  1810. }
  1811.  
  1812. return true;
  1813. }
  1814.  
  1815. stock fm_give_item_x( client, const item[], x )
  1816. {
  1817. for ( new i = 0; i <= x; i++ )
  1818. {
  1819. fm_give_item( client, item );
  1820. }
  1821. }
  1822.  
  1823. stock fm_give_item( client, const item[] )
  1824. {
  1825. if ( !equal( item, "weapon_", 7 ) && !equal( item, "ammo_", 5 )
  1826. && !equal( item, "item_", 5 ) && !equal( item, "tf_weapon_", 10 ) )
  1827. return 0;
  1828.  
  1829. new ent = fm_create_entity( item );
  1830.  
  1831. if ( !pev_valid( ent ) )
  1832. return 0;
  1833.  
  1834. new Float:origin[3];
  1835.  
  1836. pev( client, pev_origin, origin );
  1837.  
  1838. set_pev( ent, pev_origin, origin );
  1839. set_pev( ent, pev_spawnflags, pev( ent, pev_spawnflags ) | SF_NORESPAWN );
  1840.  
  1841. dllfunc( DLLFunc_Spawn, ent );
  1842.  
  1843. new save = pev( ent, pev_solid );
  1844.  
  1845. dllfunc( DLLFunc_Touch, ent, client );
  1846.  
  1847. if ( pev( ent, pev_solid ) != save )
  1848. return ent;
  1849.  
  1850. engfunc( EngFunc_RemoveEntity, ent );
  1851.  
  1852. return -1;
  1853. }
  1854.  
  1855. stock fm_create_entity( const classname[] )
  1856. {
  1857. return engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, classname ) );
  1858. }
  1859.  
  1860. stock cmd_target( client, const arg[], const arg1[], command )
  1861. {
  1862. if ( !equal( arg1, "" )
  1863. || command == T_TRANSFER
  1864. || command == CT_TRANSFER
  1865. || command == SPEC_TRANSFER
  1866. || command == REVIVE
  1867. || command == BURY
  1868. || command == UNBURY
  1869. || command == SLAY
  1870. || command == SLAP
  1871. || command == UBERSLAP
  1872. || command == DRUG
  1873. || command == FLASH
  1874. || command == ROCKET
  1875. || command == FIRE )
  1876. {
  1877. new player = find_player( "bl",arg );
  1878.  
  1879. if ( player )
  1880. {
  1881. if ( player != find_player( "blj",arg ) )
  1882. {
  1883. ColorChat( client, "^3Error^1: There are more than 1 player with that name" );
  1884.  
  1885. return 0;
  1886. }
  1887. }
  1888.  
  1889. else if ( ( player = find_player( "c",arg ) ) ==0 && arg[ 0 ] == '#' && arg[ 1 ] )
  1890. {
  1891. player = find_player( "k",str_to_num( arg[ 1 ] ) );
  1892. }
  1893.  
  1894. if ( !player )
  1895. {
  1896. ColorChat( client, "^3Error^1: There is no such a player" );
  1897.  
  1898. return 0;
  1899. }
  1900.  
  1901. return player;
  1902. }
  1903. return 0;
  1904. }
  1905.  
  1906. stock fm_set_user_money( client, money, flash = 0 )
  1907. {
  1908. new CSMONEY;
  1909.  
  1910. #if cellbits == 32
  1911. CSMONEY = 115;
  1912. #else
  1913. CSMONEY = 140;
  1914. #endif
  1915.  
  1916. set_pdata_int( client, CSMONEY, money, 5 );
  1917.  
  1918. message_begin( MSG_ONE,get_user_msgid( "Money" ), { 0, 0, 0 }, client );
  1919. write_long( money );
  1920. write_byte( flash );
  1921. message_end( );
  1922. }
  1923.  
  1924. stock fm_set_user_model( const client, const model[] )
  1925. {
  1926. engfunc( EngFunc_SetClientKeyValue, client, engfunc( EngFunc_GetInfoKeyBuffer, client ), "model", model );
  1927. }
  1928.  
  1929. stock ColorChat( const client, const string[ ], { Float, Sql, Resul,_ }:... )
  1930. {
  1931. new msg[191], players[32], count = 1;
  1932.  
  1933. static len; len = formatex( msg, charsmax( msg ), "^4[ Amxx Cmd Advanced ]^1 " );
  1934. vformat( msg[ len ], charsmax( msg ) - len, string, 3 );
  1935.  
  1936. if( client )
  1937. {
  1938. players[ 0 ] = client;
  1939. }
  1940.  
  1941. else
  1942. {
  1943. get_players( players,count,"ch" );
  1944. }
  1945.  
  1946. for ( new i = 0; i < count; i++ )
  1947. {
  1948. if( is_user_connected( players[ i ] ) )
  1949. {
  1950. message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, players[ i ] );
  1951. write_byte( players[ i ] );
  1952. write_string( msg );
  1953. message_end( );
  1954. }
  1955. }
  1956. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement