Advertisement
Mr-Co0L

Untitled

May 2nd, 2019
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.32 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <fun>
  4. #include <cstrike>
  5. #include <hamsandwich>
  6. #include <fakemeta>
  7. #include <fcs>
  8. #include <engine>
  9. #include <xs>
  10.  
  11. //Gloante infinite
  12. new bool:g_bInfiniteBullets[ 33 ]
  13. enum
  14. {
  15. CurWeapon_IsActive = 1, // byte
  16. CurWeapon_WeaponID, // byte
  17. CurWeapon_ClipAmmo // byte
  18. }
  19.  
  20. #define XO_WEAPON 4
  21. #define m_iClip 51
  22. #define m_iClientClip 52
  23. #define SLOT "b"
  24. #define m_pActiveItem 373
  25.  
  26. new const g_iMaxClip[CSW_P90+1] =
  27. {
  28. -1, 13, -1, 10, 1, 7, 1, 30, 30, 1, 30,
  29. 20, 25, 30, 35, 25, 12, 20, 10, 30, 100,
  30. 8 , 30, 30, 20, 2, 7, 30, 30, -1, 50
  31. }
  32.  
  33. enum _:Colors
  34. {
  35. print_team_default,
  36. print_team_red,
  37. print_team_blue,
  38. print_team_grey
  39. };
  40.  
  41. stock const TeamName [Colors] [ ] =
  42. {
  43. "UNASSIGNED",
  44. "TERRORIST",
  45. "CT",
  46. "SPECTATOR"
  47. };
  48.  
  49. new bool:g_slotpass[33];
  50. new g_norecoil[33];
  51. new Float: cl_pushangle[33][3];
  52. new g_maxplayers;
  53. new cvar_hpap, cvar_HESG, cvar_DU, cvar_God, cvar_Ak, cvar_M4, cvar_recoil, cvar_Awp, cvar_unc, cvar_bslot, cvar_energy, cvar_inv, cvar_m249;
  54. const WEAPONS_BITSUM = (1<<CSW_KNIFE|1<<CSW_HEGRENADE|1<<CSW_FLASHBANG|1<<CSW_SMOKEGRENADE|1<<CSW_C4)
  55.  
  56. public plugin_init()
  57. {
  58. register_clcmd ( "chooseteam", "ShowMenu", -1);
  59.  
  60. register_clcmd ( "jointeam", "ShowMenu", -1 );
  61.  
  62. register_clcmd("say /shop", "ShowMenu", -1);
  63.  
  64. RegisterHam( Ham_Spawn, "player", "SpawnCmd", 1 )
  65.  
  66. register_message( get_user_msgid( "CurWeapon" ), "event_curweapon" );
  67.  
  68. register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
  69.  
  70. register_clcmd ( "amx_password_for_slot", "slot" );
  71.  
  72. cvar_hpap = register_cvar("50_HP_+_50_AP", "3");
  73. cvar_HESG = register_cvar("HE", "5");
  74. cvar_DU = register_cvar("Deagle", "10");
  75. cvar_God = register_cvar("GodMode(3_sec)", "30");
  76. cvar_Ak = register_cvar("Ak47", "30");
  77. cvar_M4 = register_cvar("M4A1", "30");
  78. cvar_Awp = register_cvar("AWP", "50");
  79. cvar_recoil = register_cvar("no-recoil", "100");
  80. cvar_m249 = register_cvar("m249", "30");
  81. cvar_unc = register_cvar("Unlimited_Clip", "100");
  82. cvar_bslot = register_cvar("Buy_Slot_&_Super_Knife", "2500");
  83.  
  84. cvar_energy = register_cvar("Energy_Pack", "200");
  85. cvar_inv = register_cvar("Invizibilitate ", "50");
  86.  
  87. new weapon_name[24]
  88. for (new i = 1; i <= 30; i++)
  89. {
  90. if (!(WEAPONS_BITSUM & 1 << i) && get_weaponname(i, weapon_name, 23))
  91. {
  92. RegisterHam(Ham_Weapon_PrimaryAttack, weapon_name, "fw_Weapon_PrimaryAttack_Pre")
  93. RegisterHam(Ham_Weapon_PrimaryAttack, weapon_name, "fw_Weapon_PrimaryAttack_Post", 1)
  94. }
  95. }
  96.  
  97. g_maxplayers = get_maxplayers()
  98. }
  99.  
  100. public client_connect(id)
  101. g_norecoil[id] = false
  102.  
  103. public event_round_start()
  104. for (new id = 1; id <= g_maxplayers; id++)
  105. g_norecoil[id] = false
  106.  
  107. public fw_Weapon_PrimaryAttack_Pre(entity)
  108. {
  109. new id = pev(entity, pev_owner)
  110.  
  111. if (g_norecoil[id])
  112. {
  113. pev(id, pev_punchangle, cl_pushangle[id])
  114. return HAM_IGNORED;
  115. }
  116. return HAM_IGNORED;
  117. }
  118.  
  119. public fw_Weapon_PrimaryAttack_Post(entity)
  120. {
  121. new id = pev(entity, pev_owner)
  122.  
  123. if (g_norecoil[id])
  124. {
  125. new Float: push[3]
  126. pev(id, pev_punchangle, push)
  127. xs_vec_sub(push, cl_pushangle[id], push)
  128. xs_vec_mul_scalar(push, 0.0, push)
  129. xs_vec_add(push, cl_pushangle[id], push)
  130. set_pev(id, pev_punchangle, push)
  131. return HAM_IGNORED;
  132. }
  133. return HAM_IGNORED;
  134. }
  135.  
  136. public SpawnCmd ( id )
  137. {
  138. if(is_user_alive(id) && is_user_connected(id))
  139. {
  140. g_bInfiniteBullets[id] = false;
  141.  
  142. set_user_rendering(id, kRenderFxNone, 255, 255, 255 ,kRenderNormal, 16);
  143. }
  144. }
  145.  
  146. public ShowMenu (id, level, cid)
  147. {
  148. if(cs_get_user_team(id) == CS_TEAM_CT)
  149. {
  150. new menu = menu_create( "\r[DeathRun OutStanding]\yExtra Items CT:", "extract");
  151. menu_additem(menu, "\w50HP + 50AP - \r 3 Points", "1", 0);
  152. menu_additem(menu, "\wHE - \r 5 Points", "2", 0);
  153. menu_additem(menu, "\wDeagle - \r 10 Points", "3", 0);
  154. menu_additem(menu, "\wGodMode(3sec) - \r 30 Points", "4", 0);
  155. menu_additem(menu, "\wAk47 - \r 30 Points", "5", 0);
  156. menu_additem(menu, "\wM4A1 - \r 30 Points", "6", 0);
  157. menu_additem(menu, "\wAWP\r 50 Points", "7", 0);
  158. menu_additem(menu, "\wNo Recoil - \r 100 Points", "8", 0);
  159. menu_additem(menu, "\wUnlimited Clip - \r 100 Points", "9", 0);
  160. menu_additem(menu, "\wBuy SuperKnife + Slot - \r 2500 Points", "10", 0);
  161. menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
  162. menu_display(id, menu, 0);
  163.  
  164. return 1;
  165. }
  166. else
  167. {
  168. new menu = menu_create( "\r[DeathRun OutStanding] \yExtra Items T", "extrat");
  169. menu_additem(menu, "\w50HP + 50AP - \r 3 Points", "1", 0);
  170. menu_additem(menu, "\wEnergy Pack (1000 HP + 1000 AP) - \r 200 Points", "2", 0);
  171. menu_additem(menu, "\wAWP- \r 50 Points", "3", 0);
  172. menu_additem(menu, "\wM249 - \r 50 Points", "4", 0);
  173. menu_additem(menu, "\wAk47 - \r 30 Points", "5", 0);
  174. menu_additem(menu, "\wInvizibilitate 80% - \r 50 Points", "7", 0);
  175. menu_additem(menu, "\wBuy SuperKnife + Slot - \r 2500 Points", "7", 0);
  176.  
  177. menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
  178. menu_display(id, menu, 0);
  179.  
  180.  
  181. return 1;
  182. }
  183. return 1;
  184. }
  185.  
  186. public extract ( id, menu, item )
  187. {
  188. if( item == MENU_EXIT )
  189. {
  190. return 1;
  191. }
  192.  
  193. new data[6], szName[64];
  194. new access, callback;
  195. menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback);
  196. new key = str_to_num(data);
  197.  
  198. switch(key)
  199. {
  200. case 1:
  201. {
  202. if(get_user_credits(id) >= get_pcvar_num(cvar_hpap))
  203. {
  204. set_user_credits(id, get_user_credits(id) - 3);
  205. new viata =get_user_health(id);
  206. set_user_health(id,clamp(viata+50,1,1000));
  207. set_user_armor(id,get_user_armor(id)+50)
  208. return 1
  209. }
  210. else client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You don't have enough points!")
  211. }
  212. case 2:
  213. {
  214. if(get_user_credits(id) >= get_pcvar_num(cvar_HESG))
  215. {
  216. set_user_credits(id, get_user_credits(id) - 5);
  217. give_item(id,"weapon_hegrenade")
  218. }
  219. else client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You don't have enough points!")
  220. }
  221. case 3:
  222. {
  223. if(get_user_credits(id) >= get_pcvar_num(cvar_DU))
  224. {
  225. set_user_credits(id, get_user_credits(id) - 10);
  226. give_item(id,"weapon_deagle")
  227. cs_set_user_bpammo(id,CSW_DEAGLE,100)
  228. }
  229. else client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You don't have enough points!")
  230.  
  231. }
  232. case 4:
  233. {
  234. if(get_user_credits(id) >= get_pcvar_num(cvar_God))
  235. {
  236. set_user_credits(id, get_user_credits(id) - 30);
  237. set_user_godmode(id,1)
  238. set_task(3.0,"RemoveGod",id)
  239. }
  240. else client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You don't have enough points!")
  241. }
  242. case 5:
  243. {
  244. if(get_user_credits(id) >= get_pcvar_num(cvar_Ak))
  245. {
  246. set_user_credits(id, get_user_credits(id) - 30);
  247. give_item(id,"weapon_ak47")
  248. cs_set_user_bpammo(id,CSW_AK47,90)
  249. }
  250. else client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You don't have enough points!")
  251.  
  252. }
  253. case 6:
  254. {
  255. if(get_user_credits(id) >= get_pcvar_num(cvar_M4))
  256. {
  257. set_user_credits(id, get_user_credits(id) - 30);
  258. give_item(id,"weapon_m4a1")
  259. cs_set_user_bpammo(id,CSW_M4A1,90)
  260. }
  261. else client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You don't have enough points!")
  262.  
  263. }
  264. case 7:
  265. {
  266. if(get_user_credits(id) >= get_pcvar_num(cvar_Awp))
  267. {
  268. set_user_credits(id, get_user_credits(id) - 30);
  269. give_item(id,"weapon_awp")
  270. cs_set_user_bpammo(id,CSW_AWP,90)
  271. }
  272. else client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You don't have enough points!")
  273. }
  274. case 8:
  275. {
  276. if(get_user_credits(id) >= get_pcvar_num(cvar_recoil))
  277. {
  278. set_user_credits(id, get_user_credits(id) - 100);
  279. g_norecoil[id] = true
  280. }
  281. else client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You don't have enough points!")
  282.  
  283. }
  284. case 9:
  285. {
  286. if(get_user_credits(id) >= get_pcvar_num(cvar_unc))
  287. {
  288. set_user_credits(id, get_user_credits(id) - 100);
  289. g_bInfiniteBullets[id] = true;
  290. }
  291. else client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You don't have enough points!")
  292. }
  293. case 10:
  294. {
  295. if (get_user_credits(id) >= get_pcvar_num(cvar_bslot))
  296. {
  297. set_user_credits(id, get_user_credits(id) - 2500);
  298. g_slotpass[id] = true;
  299. slot(id);
  300. }
  301. else client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You don't have enough points!")
  302. }
  303. default:
  304. {
  305. }
  306. }
  307. return PLUGIN_CONTINUE;
  308. }
  309.  
  310. public extrat ( id, menu, item )
  311. {
  312. if( item == MENU_EXIT )
  313. {
  314. return 1;
  315. }
  316.  
  317. new data[6], szName[64];
  318. new access, callback;
  319. menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback);
  320. new key = str_to_num(data);
  321.  
  322. switch(key)
  323. {
  324. case 1:
  325. {
  326. if(get_user_credits(id) >= get_pcvar_num(cvar_hpap))
  327. {
  328. set_user_credits(id, get_user_credits(id) - 5);
  329. set_user_health(id,get_user_health(id)+50)
  330. set_user_armor(id,get_user_armor(id)+50)
  331. return 1
  332. }
  333. else client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You don't have enough points!")
  334.  
  335. }
  336. case 2:
  337. {
  338. if(get_user_credits(id) >= get_pcvar_num(cvar_energy))
  339. {
  340. set_user_credits(id, get_user_credits(id) - 200);
  341. set_user_armor(id,get_user_armor(id)+1000)
  342. new viata =get_user_health(id);
  343. set_user_health(id,clamp(viata+1000,1,1000));
  344. }
  345. else client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You don't have enough points!")
  346. }
  347. case 3:
  348. {
  349. if(get_user_credits(id) >= get_pcvar_num(cvar_Awp))
  350. {
  351. set_user_credits(id, get_user_credits(id) - 50);
  352. give_item(id,"weapon_awp")
  353. cs_set_user_bpammo(id,CSW_AWP,90)
  354. }
  355. else client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You don't have enough points!")
  356. }
  357. case 4:
  358. {
  359. if(get_user_credits(id) >= get_pcvar_num(cvar_m249))
  360. {
  361. set_user_credits(id, get_user_credits(id) - 50);
  362. give_item(id,"weapon_m249")
  363. cs_set_user_bpammo(id,CSW_M249,90)
  364. }
  365. else client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You don't have enough points!")
  366. }
  367. case 5:
  368. {
  369. if(get_user_credits(id) >= get_pcvar_num(cvar_Ak))
  370. {
  371. set_user_credits(id, get_user_credits(id) - 30);
  372. give_item(id,"weapon_ak47")
  373. cs_set_user_bpammo(id,CSW_AK47,90)
  374. }
  375. else client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You don't have enough points!")
  376. }
  377. case 6:
  378. {
  379. if(get_user_credits(id) >= get_pcvar_num(cvar_inv))
  380. {
  381. set_user_credits(id, get_user_credits(id) - 50);
  382. set_user_rendering( id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 20 );
  383. }
  384. else client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You don't have enough points!")
  385.  
  386. }
  387. case 7:
  388. {
  389. if (get_user_credits(id) >= get_pcvar_num(cvar_bslot))
  390. {
  391. set_user_credits(id, get_user_credits(id) - 2500);
  392. g_slotpass[id] = true;
  393. slot(id);
  394. }
  395. else client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You don't have enough points!")
  396. }
  397. }
  398. return PLUGIN_CONTINUE;
  399. }
  400.  
  401. public slot(id)
  402. {
  403. if (get_user_flags ( id ) & read_flags ( SLOT ) )
  404. {
  405. client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 You can't buy this item!");
  406. return 1
  407. }
  408.  
  409. client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 PLEASE INSERT THE PASSWORD");
  410. new password[16];
  411. read_args(password, charsmax(password));
  412. remove_quotes(password);
  413.  
  414. if(strlen(password) < 3 || strlen(password) > 15)
  415. {
  416. client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 Password^3 Invalid^1.");
  417. client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 Password must contain between^1 3^x03 si^1 15 characters^3.");
  418. client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 Retype Again^3 Password^1.");
  419.  
  420. client_cmd(id, "messagemode amx_password_for_slot");
  421. return 1
  422. }
  423.  
  424. new configsDir[64];
  425. get_configsdir(configsDir, charsmax(configsDir));
  426. format(configsDir, 63, "%s/users.ini", configsDir);
  427.  
  428. new name[32];
  429. get_user_name(id, name, charsmax(name));
  430.  
  431. new linetoadd[512];
  432. formatex(linetoadd, 511, "^"%s^" ^"%s^" ^"b^"", name, password);
  433. server_print("Adding: %s", linetoadd);
  434.  
  435. if(!write_file(configsDir, linetoadd))
  436. console_print(id, "[DeathRun OutStanding] Failed writing to %s!", configsDir);
  437.  
  438. set_user_info(id, "_pw", password);
  439. server_cmd("amx_reloadadmins");
  440. client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 Congratulations You Have Slot Access (your password:^4 %s^1)", password);
  441. client_print_color ( id, print_team_default, "^4[DeathRun OutStanding]^1 Congratulations You Have Slot Access (your password:^4 %s^1)", password);
  442. g_slotpass[id] = false;
  443. console_print(id, "");
  444. console_print(id, "****************************");
  445. console_print(id, "Done! You have now slot access!");
  446. console_print(id, "Be careful, to login with your account,");
  447. console_print(id, "You should type in your console");
  448. console_print(id, "setinfo _pw ^"password^"");
  449. console_print(id, "We hope you enjoy you have fun!");
  450. console_print(id, "****************************");
  451. console_print(id, "");
  452. server_cmd("kick #%d Check your console!", get_user_userid(id));
  453.  
  454. return PLUGIN_HANDLED
  455. }
  456.  
  457. public RemoveGod(id)
  458. {
  459. set_user_godmode(id,0)
  460. client_print_color ( id, print_team_default, "Numai ai godmode!");
  461. }
  462.  
  463. public event_curweapon( iMsgId, iMsgDest, id )
  464. {
  465. if ( get_msg_arg_int( CurWeapon_IsActive ) && g_bInfiniteBullets[ id ] )
  466. {
  467. new iMaxClip = g_iMaxClip[ get_msg_arg_int( CurWeapon_WeaponID ) ];
  468. if( get_msg_arg_int(CurWeapon_ClipAmmo) < iMaxClip )
  469. {
  470. new iWeapon = get_pdata_cbase( id, m_pActiveItem );
  471. if ( iWeapon > 0 )
  472. {
  473. set_pdata_int( iWeapon, m_iClip, iMaxClip, XO_WEAPON );
  474. set_pdata_int( iWeapon, m_iClientClip, iMaxClip, XO_WEAPON );
  475.  
  476. set_msg_arg_int( CurWeapon_ClipAmmo, ARG_BYTE, iMaxClip );
  477. }
  478. }
  479. }
  480. }
  481.  
  482. stock client_print_color ( id, iColor = print_team_default, const Msg [ ], any:... )
  483. {
  484. if ( id && !is_user_connected ( id ) ) return 0;
  485.  
  486. if ( iColor > print_team_grey ) iColor = print_team_default;
  487.  
  488. new Message [192];
  489.  
  490. if ( iColor == print_team_default )
  491.  
  492. Message [0] = 0x04;
  493. else
  494. Message [0] = 0x03;
  495.  
  496.  
  497. new iParams = numargs ( )
  498.  
  499. if ( id )
  500. {
  501. if ( iParams == 3 )
  502.  
  503. copy ( Message [1], charsmax ( Message ) -1, Msg );
  504. else
  505. vformat ( Message [1], charsmax ( Message ) -1, Msg, 4 );
  506.  
  507. if ( iColor )
  508. {
  509. new GetTeam [11]; get_user_team ( id, GetTeam, charsmax ( GetTeam ) );
  510.  
  511. SendTeamInfo ( id, id, TeamName [iColor] );
  512.  
  513. SendSayText ( id, id, Message );
  514.  
  515. SendTeamInfo ( id, id, GetTeam );
  516. }
  517. else
  518. SendSayText ( id, id, Message );
  519. }
  520. else
  521. {
  522. new iPlayers [32], iNum; get_players ( iPlayers, iNum, "ch" );
  523.  
  524. if ( !iNum ) return 0;
  525.  
  526. new iFool = iPlayers [0];
  527.  
  528. if ( iParams == 3 )
  529.  
  530. copy ( Message [1], charsmax ( Message ) -1, Msg );
  531. else
  532. vformat ( Message [1], charsmax ( Message ) -1, Msg, 4 );
  533.  
  534. if ( iColor )
  535. {
  536. new GetTeam [11]; get_user_team ( iFool, GetTeam, charsmax ( GetTeam ) );
  537.  
  538. SendTeamInfo ( 0, iFool, TeamName [iColor] );
  539.  
  540. SendSayText ( 0, iFool, Message);
  541.  
  542. SendTeamInfo ( 0, iFool, GetTeam );
  543. }
  544. else
  545. SendSayText ( 0, iFool, Message );
  546. }
  547.  
  548. return 1;
  549. }
  550.  
  551. stock SendTeamInfo ( iReceiver, iPlayerId, GetTeam [] )
  552. {
  553. static iTeamInfo = 0;
  554.  
  555. if ( !iTeamInfo )
  556.  
  557. iTeamInfo = get_user_msgid ( "TeamInfo" );
  558.  
  559. message_begin ( iReceiver ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, iTeamInfo, .player = iReceiver );
  560.  
  561. write_byte ( iPlayerId );
  562.  
  563. write_string ( GetTeam );
  564.  
  565. message_end ( );
  566. }
  567.  
  568. stock SendSayText ( iReceiver, iPlayerId, Message [ ] )
  569. {
  570. static iSayText = 0;
  571.  
  572. if ( !iSayText )
  573.  
  574. iSayText = get_user_msgid ( "SayText" );
  575.  
  576. message_begin ( iReceiver ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, iSayText, .player = iReceiver );
  577.  
  578. write_byte ( iPlayerId );
  579.  
  580. write_string ( Message );
  581.  
  582. message_end ( );
  583. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement