Advertisement
Guest User

Untitled

a guest
Jul 13th, 2013
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.39 KB | None | 0 0
  1. #include <amxmodx>
  2.  
  3. #include <colorchat>
  4.  
  5. #include <nvault>
  6.  
  7. #include <amxmisc>
  8.  
  9. #include <hamsandwich>
  10.  
  11. #include <fun>
  12.  
  13. #include <cstrike>
  14.  
  15.  
  16.  
  17. #pragma semicolon 1
  18.  
  19.  
  20.  
  21. new gMaxPlayers, iLevels[33], iKills[33], Levels, g_msg_screenfade;
  22.  
  23. new bool:bPrefix, bool:bLogs, bool:bHud, gMenu, iKNum, iMax, bool:bFade, iLevHe, iLevSlot;
  24.  
  25. new bool:bBuy, bool:bSell, iPrice;
  26.  
  27. new const szgMenuItems[][] = { "Buy Level", "Sell Level", "\yList of Players", "\rInfo" };
  28.  
  29. new const gLogFile[] = "addons/amxmodx/configs/levels/LvlsAdmCmdsLogs.txt";
  30.  
  31. new const gDir[] = "addons/amxmodx/configs/levels/";
  32.  
  33. new const gUsersIni[] = "addons/amxmodx/configs/users.ini";
  34.  
  35. new const gSettingsFile[] = "addons/amxmodx/configs/levels/Settings.cfg";
  36.  
  37. new const gSettingsFileText[][] = {
  38.  
  39.  
  40. "levels_logs ^"1^"
  41.  
  42. "levels_num_to_next ^"50^"
  43.  
  44. "levels_max_levels ^"100^"
  45.  
  46. "levels_chat_prefix ^"1^" //
  47.  
  48. "levels_hud_info ^"1^" //
  49.  
  50. "levels_fade ^"1^" //
  51.  
  52. "levels_he_lvl_num ^"30^" //
  53.  
  54. "levels_slot_lvl_num ^"60^" //
  55.  
  56. "levels_buy ^"1^" //
  57.  
  58. "levels_sell ^"1^" //
  59.  
  60. "levels_level_price ^"16000^" //
  61.  
  62. };
  63.  
  64.  
  65.  
  66. new const gLogFileText[][] = {
  67.  
  68. "Here you will find activity of admins",
  69.  
  70. "logs with commands: amx_setlvl, amx_addlvl and amx_resetlvl",
  71.  
  72. "====================================================================^n "
  73.  
  74. };
  75.  
  76.  
  77.  
  78. enum Cvars {
  79.  
  80. LOGS, KNUM, MAX, CHAT, HUD,
  81.  
  82. FADE, HE, SLOT, KUPOVINA, PRODAJA, CENA
  83.  
  84. }
  85.  
  86.  
  87.  
  88. new const CvarsNames[Cvars][] = {
  89.  
  90. "levels_logs", "levels_num_to_next", "levels_max_levels", "levels_chat_prefix", "levels_hud_info",
  91.  
  92. "levels_fade", "levels_he_lvl_num", "levels_slot_lvl_num", "levels_buy", "levels_sell", "levels_level_price"
  93.  
  94. };
  95.  
  96.  
  97.  
  98. new const CvarsAmmount[Cvars][] = {
  99.  
  100. "1", "50", "100", "1", "1",
  101.  
  102. "1", "30", "60", "1", "1", "16000"
  103.  
  104. };
  105.  
  106.  
  107.  
  108. new pCvars[Cvars];
  109.  
  110.  
  111.  
  112. public plugin_init() {
  113.  
  114. register_plugin("Levels", "1.0", "dEfuseRsBS");
  115.  
  116. Levels = nvault_open("Levels");
  117.  
  118. g_msg_screenfade = get_user_msgid("ScreenFade");
  119.  
  120. RegisterHam(Ham_Spawn, "player", "fw_PlSpawn", 1);
  121.  
  122.  
  123.  
  124. for(new Cvars:i = LOGS; i < Cvars; i++)
  125.  
  126. pCvars[i] = register_cvar(CvarsNames[i], CvarsAmmount[i]);
  127.  
  128.  
  129.  
  130. register_cvar("Levels", "1", FCVAR_SPONLY | FCVAR_SERVER);
  131.  
  132. set_task(0.5, "fw_CvarsCheck");
  133.  
  134. set_task(180.0, "fw_CvarsCheck", _, _, _, "b");
  135.  
  136.  
  137.  
  138. gMaxPlayers = get_maxplayers();
  139.  
  140. register_event("DeathMsg", "fw_Death", "a");
  141.  
  142.  
  143.  
  144. register_concmd("amx_setlvl", "fw_LvlSet", ADMIN_RCON, "<nick> <num> - set level to a player");
  145.  
  146. register_concmd("amx_addlvl", "fw_LvlAdd", ADMIN_RCON, "<nick> <num> - add level to a player");
  147.  
  148. register_concmd("amx_resetlvl", "fw_LvlReset", ADMIN_RCON, "<nick> - reset levels of a player");
  149.  
  150. register_clcmd("say /levels", "fw_LevelsCmd");
  151.  
  152. register_clcmd("buy_level", "fw_BuyLvl");
  153.  
  154. register_clcmd("sell_level", "fw_SellLvl");
  155.  
  156. register_clcmd("say", "fw_SayCmd");
  157.  
  158.  
  159.  
  160. gMenu = menu_create("\rLevels Menu", "h_gMenu");
  161.  
  162. for(new i = 0; i < sizeof szgMenuItems; i++)
  163.  
  164. menu_additem(gMenu, szgMenuItems[i]);
  165.  
  166. menu_addtext(gMenu, "\dCSDM MODE");
  167.  
  168. }
  169.  
  170.  
  171.  
  172. public plugin_precache() {
  173.  
  174. if(!dir_exists(gDir))
  175.  
  176. mkdir(gDir);
  177.  
  178.  
  179.  
  180. if(!file_exists(gLogFile))
  181.  
  182. for(new i = 0; i < sizeof gLogFileText; i++)
  183.  
  184. write_file(gLogFile, gLogFileText[i]);
  185.  
  186.  
  187.  
  188. if(!file_exists(gSettingsFile))
  189.  
  190. for(new x = 0; x < sizeof gSettingsFileText; x++)
  191.  
  192. write_file(gSettingsFile, gSettingsFileText[x]);
  193.  
  194.  
  195.  
  196. server_cmd("exec %s", gSettingsFile);
  197.  
  198. }
  199.  
  200.  
  201.  
  202. public fw_CvarsCheck() {
  203.  
  204. if(get_pcvar_num(pCvars[CHAT]) == 1)
  205.  
  206. bPrefix = true;
  207.  
  208. else bPrefix = false;
  209.  
  210. if(get_pcvar_num(pCvars[LOGS]) == 1)
  211.  
  212. bLogs = true;
  213.  
  214. else bLogs = false;
  215.  
  216. if(get_pcvar_num(pCvars[HUD]) == 1)
  217.  
  218. bHud = true;
  219.  
  220. else bHud = false;
  221.  
  222. if(get_pcvar_num(pCvars[FADE]) == 1)
  223.  
  224. bFade = true;
  225.  
  226. else bFade = false;
  227.  
  228. if(get_pcvar_num(pCvars[KUPOVINA]) == 1)
  229.  
  230. bBuy = true;
  231.  
  232. else bBuy = false;
  233.  
  234. if(get_pcvar_num(pCvars[PRODAJA]) == 1)
  235.  
  236. bSell = true;
  237.  
  238. else bSell = false;
  239.  
  240. iKNum = get_pcvar_num(pCvars[KNUM]);
  241.  
  242. iMax = get_pcvar_num(pCvars[MAX]);
  243.  
  244. iLevHe = get_pcvar_num(pCvars[HE]);
  245.  
  246. iLevSlot = get_pcvar_num(pCvars[SLOT]);
  247.  
  248. iPrice = get_pcvar_num(pCvars[CENA]);
  249.  
  250. }
  251.  
  252.  
  253.  
  254. public fw_BuyLvl(id) {
  255.  
  256. new szFArg[35], szText[255];
  257.  
  258. read_argv(1, szFArg, charsmax(szFArg));
  259.  
  260. new iFArg = str_to_num(szFArg);
  261.  
  262. if(iFArg <= 0)
  263.  
  264. formatex(szText, charsmax(szText), "Wrong number of input");
  265.  
  266. else {
  267.  
  268. new iUserMoney = cs_get_user_money(id);
  269.  
  270. new iCena = iPrice * iFArg;
  271.  
  272. if(iUserMoney < iCena)
  273.  
  274. formatex(szText, charsmax(szText), "You do not have enough money for^3 %i^1 level. It takes^3 %i", iFArg, iCena);
  275.  
  276. else {
  277.  
  278. iLevels[id] += iFArg;
  279.  
  280. cs_set_user_money(id, iUserMoney - iCena);
  281.  
  282. formatex(szText, charsmax(szText), "You bought^3 %i^1 level for^3 %i^1$", iFArg, iCena);
  283.  
  284. }
  285.  
  286. }
  287.  
  288. ColorChat(id, TEAM_COLOR, "^4[Levels]^1 %s", szText);
  289.  
  290. }
  291.  
  292.  
  293.  
  294. public fw_SellLvl(id) {
  295.  
  296. new szFArg[35], szText[255];
  297.  
  298. read_argv(1, szFArg, charsmax(szFArg));
  299.  
  300. new iFArg = str_to_num(szFArg);
  301.  
  302. if(iFArg <= 0)
  303.  
  304. formatex(szText, charsmax(szText), "Wrong number of input");
  305.  
  306. else {
  307.  
  308. if(iLevels[id] < iFArg)
  309.  
  310. formatex(szText, charsmax(szText), "You do not have enough level, you can sell maxim^3 %i^1 level", iLevels[id]);
  311.  
  312. else {
  313.  
  314. new iCena = iPrice * iFArg;
  315.  
  316. iLevels[id] -= iFArg;
  317.  
  318. cs_set_user_money(id, cs_get_user_money(id) + iCena);
  319.  
  320. formatex(szText, charsmax(szText), "You sold^3 %i^1 level for^3 %i^1$", iFArg, iCena);
  321.  
  322. }
  323.  
  324. }
  325.  
  326. ColorChat(id, TEAM_COLOR, "^4[Levels]^1 %s", szText);
  327.  
  328. }
  329.  
  330.  
  331.  
  332. public fw_PlSpawn(id)
  333.  
  334. if(is_user_alive(id) && (iLevels[id] >= iLevHe))
  335.  
  336. give_item(id, "weapon_hegrenade");
  337.  
  338.  
  339.  
  340. public fw_LevelsCmd(id)
  341.  
  342. menu_display(id, gMenu);
  343.  
  344.  
  345.  
  346. public h_gMenu(id, menu, item) {
  347.  
  348. switch(item) {
  349.  
  350. case MENU_EXIT: return PLUGIN_HANDLED;
  351.  
  352. case 0: {
  353.  
  354. if(!bBuy)
  355.  
  356. ColorChat(id, TEAM_COLOR, "^4[Levels]^1 This item is excluded");
  357.  
  358. else {
  359.  
  360. client_cmd(id, "messagemode KUPOVINA_LEVELA");
  361.  
  362. ColorChat(id, GREEN, "[Levels] Enter the number of levels to buy, the price of one level is: %i", iPrice);
  363.  
  364. }
  365.  
  366. }
  367.  
  368. case 1: {
  369.  
  370. if(!bSell)
  371.  
  372. ColorChat(id, TEAM_COLOR, "^4[Levels]^1 This item is excluded");
  373.  
  374. else {
  375.  
  376. client_cmd(id, "messagemode PRODAJA_LEVELA");
  377.  
  378. ColorChat(id, GREEN, "[Levels] Enter the number of levels of sales, the cost of one level is: %i", iPrice);
  379.  
  380. }
  381.  
  382. }
  383.  
  384. case 2: {
  385.  
  386. set_hudmessage(255, 0, 0, -1.0, 0.49, 0, 6.0, 12.0);
  387.  
  388. show_hudmessage(id, "View console");
  389.  
  390. new num, players[32], player;
  391.  
  392. get_players(players, num, "a");
  393.  
  394. console_print(id, "=============================================");
  395.  
  396. console_print(id, " ^nList of players on the server to their level and kills ^n ");
  397.  
  398. for(new i = 0; i < num; i++) {
  399.  
  400. player = players[i];
  401.  
  402. new szName[35];
  403.  
  404. get_user_name(player, szName, charsmax(szName));
  405.  
  406. console_print(id, "Player: %s | Levels: %i | Kills: %i", szName, iLevels[player], iKills[player]);
  407.  
  408. }
  409.  
  410. console_print(id, " ^n=============================================");
  411.  
  412. }
  413.  
  414. case 3: {
  415.  
  416. set_hudmessage(255, 0, 0, -1.0, 0.49, 0, 6.0, 12.0);
  417.  
  418. show_hudmessage(id, "View console");
  419.  
  420. console_print(id, "============================================= ^n ");
  421.  
  422. console_print(id, "Levels v1.0");
  423.  
  424. console_print(id, "After the %i kills will get higher level", iKNum);
  425.  
  426. console_print(id, "The maximum number of levels is %i", iMax);
  427.  
  428. if(bPrefix)
  429.  
  430. console_print(id, "Number of levels is printed as a prefix command say");
  431.  
  432. if(bHud)
  433.  
  434. console_print(id, "Under the radar you can view your level and kills");
  435.  
  436. if(bFade)
  437.  
  438. console_print(id, "After traversed level will briefly display the time change color");
  439.  
  440. if(iLevHe <= iMax)
  441.  
  442. console_print(id, "After traversed %i level, each round players receive a He Grenade", iLevHe);
  443.  
  444. if(iLevSlot <= iMax)
  445.  
  446. console_print(id, "After traversed %i level, the player receives a slot", iLevSlot);
  447.  
  448. console_print(id, " ");
  449.  
  450. console_print(id, "Admin comands: ^n ");
  451.  
  452. console_print(id, "amx_setlvl <nick> <num> - adjust a player level");
  453.  
  454. console_print(id, "amx_addlvl <nick> <num> - add level to a player");
  455.  
  456. console_print(id, "amx_resetlvl <nick> - reset level to a player");
  457.  
  458. console_print(id, " ^n=============================================");
  459.  
  460. }
  461.  
  462. }
  463.  
  464. return PLUGIN_HANDLED;
  465.  
  466. }
  467.  
  468.  
  469.  
  470. public fw_LvlSet(id, level, cid) {
  471.  
  472. if(!cmd_access(id, level, cid, 3))
  473.  
  474. return PLUGIN_HANDLED;
  475.  
  476. new szFArg[35], szSArg[16];
  477.  
  478. read_argv(1, szFArg, charsmax(szFArg));
  479.  
  480. read_argv(2, szSArg, charsmax(szSArg));
  481.  
  482. new iNum = str_to_num(szSArg);
  483.  
  484. new gTarget = cmd_target(id, szFArg, CMDTARGET_ALLOW_SELF | CMDTARGET_NO_BOTS | CMDTARGET_OBEY_IMMUNITY);
  485.  
  486. if(!is_user_connected(gTarget) || iNum > iMax)
  487.  
  488. return PLUGIN_HANDLED;
  489.  
  490. new szPlName[35], szAdmName[35];
  491.  
  492. iLevels[gTarget] = iNum;
  493.  
  494. get_user_name(id, szAdmName, charsmax(szAdmName));
  495.  
  496. get_user_name(gTarget, szPlName, charsmax(szPlName));
  497.  
  498. ColorChat(id, TEAM_COLOR, "^4[Levels]^1 You set the level of the player^3 %s^1 to^3 %s", szPlName, iNum);
  499.  
  500. ColorChat(gTarget, TEAM_COLOR, "^4[Levels]^1 Admin^3 %s^1 set the number of levels to^3 %s", szAdmName, iNum);
  501.  
  502. if(bLogs) {
  503.  
  504. new szText[250];
  505.  
  506. formatex(szText, charsmax(szText), "[amx_setlvl] Admin: %s | Player: %s | Levels: %i", szAdmName, szPlName, iNum);
  507.  
  508. write_file(gLogFile, szText);
  509.  
  510. }
  511.  
  512. return PLUGIN_HANDLED;
  513.  
  514. }
  515.  
  516.  
  517.  
  518. public fw_LvlAdd(id, level, cid) {
  519.  
  520. if(!cmd_access(id, level, cid, 3))
  521.  
  522. return PLUGIN_HANDLED;
  523.  
  524. new szFArg[35], szSArg[16];
  525.  
  526. read_argv(1, szFArg, charsmax(szFArg));
  527.  
  528. read_argv(2, szSArg, charsmax(szSArg));
  529.  
  530. new iNum = str_to_num(szSArg);
  531.  
  532. new gTarget = cmd_target(id, szFArg, CMDTARGET_ALLOW_SELF | CMDTARGET_NO_BOTS | CMDTARGET_OBEY_IMMUNITY);
  533.  
  534. if(!is_user_connected(gTarget) || ((iLevels[gTarget] + iNum) > iMax))
  535.  
  536. return PLUGIN_HANDLED;
  537.  
  538. new szPlName[35], szAdmName[35];
  539.  
  540. iLevels[gTarget] += iNum;
  541.  
  542. get_user_name(id, szAdmName, charsmax(szAdmName));
  543.  
  544. get_user_name(gTarget, szPlName, charsmax(szPlName));
  545.  
  546. ColorChat(id, TEAM_COLOR, "^4[Levels]^1 You added to the player^3 %s^4 %i^1 levels", szPlName, iNum);
  547.  
  548. ColorChat(gTarget, TEAM_COLOR, "^4[Levels]^1 Admin^3 %s^1 added to^3 %s^1 levels", szAdmName, iNum);
  549.  
  550. if(bLogs) {
  551.  
  552. new szText[250];
  553.  
  554. formatex(szText, charsmax(szText), "[amx_addlvl] Admin: %s | Player: %s | Levels: %i", szAdmName, szPlName, iNum);
  555.  
  556. write_file(gLogFile, szText);
  557.  
  558. }
  559.  
  560. return PLUGIN_HANDLED;
  561.  
  562. }
  563.  
  564.  
  565.  
  566. public fw_LvlReset(id, level, cid) {
  567.  
  568. if(!cmd_access(id, level, cid, 2))
  569.  
  570. return PLUGIN_HANDLED;
  571.  
  572. new szFArg[35];
  573.  
  574. read_argv(1, szFArg, charsmax(szFArg));
  575.  
  576. new gTarget = cmd_target(id, szFArg, CMDTARGET_ALLOW_SELF | CMDTARGET_NO_BOTS | CMDTARGET_OBEY_IMMUNITY);
  577.  
  578. if(!is_user_connected(gTarget))
  579.  
  580. return PLUGIN_HANDLED;
  581.  
  582. new szPlName[35], szAdmName[35];
  583.  
  584. iLevels[gTarget] = 0;
  585.  
  586. get_user_name(id, szAdmName, charsmax(szAdmName));
  587.  
  588. get_user_name(gTarget, szPlName, charsmax(szPlName));
  589.  
  590. ColorChat(id, TEAM_COLOR, "^4[Levels]^1 You have reseted player^3 %s^1 levels", szPlName);
  591.  
  592. ColorChat(gTarget, TEAM_COLOR, "^4[Levels]^1 Admin^3 %s^1 has reseted levels", szAdmName);
  593.  
  594. if(bLogs) {
  595.  
  596. new szText[250];
  597.  
  598. formatex(szText, charsmax(szText), "[amx_resetlvl] Admin: %s | Player: %s", szAdmName, szPlName);
  599.  
  600. write_file(gLogFile, szText);
  601.  
  602. }
  603.  
  604. return PLUGIN_HANDLED;
  605.  
  606. }
  607.  
  608.  
  609.  
  610.  
  611.  
  612. public client_putinserver(id) {
  613.  
  614. new szAuthID[35], szNum[55], leveli[30], kilovi[30], szIp[25];
  615.  
  616. get_user_ip(id, szIp, charsmax(szIp));
  617.  
  618. get_user_authid(id, szAuthID, charsmax(szAuthID));
  619.  
  620. if(equal(szAuthID, "VALVE_ID_LAN"))
  621.  
  622. nvault_get(Levels, szIp, szNum, 101);
  623.  
  624. else nvault_get(Levels, szAuthID, szNum, 101);
  625.  
  626. parse(szNum, leveli, charsmax(leveli), kilovi, charsmax(kilovi));
  627.  
  628. iLevels[id] = str_to_num(leveli);
  629.  
  630. iKills[id] = str_to_num(kilovi);
  631.  
  632. set_task(3.0, "fw_HudInfo", id);
  633.  
  634. if(iLevels[id] >= iLevSlot) {
  635.  
  636. new szText[225];
  637.  
  638. if(!equal(szAuthID, "VALVE_ID_LAN"))
  639.  
  640. formatex(szText, charsmax(szText), "^"%s^" ^"^" ^"b^" ^"ce^"", szAuthID);
  641.  
  642. else formatex(szText, charsmax(szText), "^"%s^" ^"^" ^"b^" ^"de^"", szIp);
  643.  
  644. write_file(gUsersIni, szText);
  645.  
  646. ColorChat(id, TEAM_COLOR, "^4[Levels]^1 Congratulations, you have a free slot for^3 %i^1 levels", iLevSlot);
  647.  
  648. }
  649.  
  650. set_task(3.5, "fw_Add", id);
  651.  
  652. }
  653.  
  654.  
  655.  
  656. public fw_Add(id) {
  657.  
  658. if(is_user_connected(id)) {
  659.  
  660. set_hudmessage(0, 170, 255, -1.0, 0.0, 0, 6.0, 12.0);
  661.  
  662. show_hudmessage(id, "This server is runing ^nLevels Plugin");
  663.  
  664. }
  665.  
  666. }
  667.  
  668.  
  669.  
  670. public fw_HudInfo(id) {
  671.  
  672. if(is_user_connected(id) && bHud) {
  673.  
  674. set_hudmessage(0, 255, 0, 0.02, 0.17, 0, 6.0, 12.0);
  675.  
  676. show_hudmessage(id, "[ Level: %i ] ^n[ Kills: %i / %i]", iLevels[id], iKills[id], iKNum);
  677.  
  678. set_task(5.0, "fw_HudInfo", id);
  679.  
  680. }
  681.  
  682. }
  683.  
  684.  
  685.  
  686. public client_disconnect(id) {
  687.  
  688. new szAuthID[35], szNum[55];
  689.  
  690. get_user_authid(id, szAuthID, charsmax(szAuthID));
  691.  
  692. formatex(szNum, charsmax(szNum), "%i %i", iLevels[id], iKills[id]);
  693.  
  694. if(equal(szAuthID, "VALVE_ID_LAN")) {
  695.  
  696. new szIp[25];
  697.  
  698. get_user_ip(id, szIp, charsmax(szIp));
  699.  
  700. nvault_set(Levels, szIp, szNum);
  701.  
  702. }
  703.  
  704. else nvault_set(Levels, szAuthID, szNum);
  705.  
  706. }
  707.  
  708.  
  709.  
  710. public fw_Death() {
  711.  
  712. new id = read_data(1);
  713.  
  714. if(id <= gMaxPlayers) {
  715.  
  716. if(is_user_connected(id)) {
  717.  
  718. iKills[id]++;
  719.  
  720. if(iLevels[id] >= iMax)
  721.  
  722. return;
  723.  
  724. set_hudmessage(255, 0, 0, -1.0, 0.62, 0, 6.0, 12.0);
  725.  
  726. if(iKills[id] == iKNum) {
  727.  
  728. iLevels[id]++;
  729.  
  730. iKills[id] = 0;
  731.  
  732. show_hudmessage(id, "[ You are now level %i ]", iLevels[id]);
  733.  
  734. if(bFade)
  735.  
  736. set_user_fade(id);
  737.  
  738. }
  739.  
  740. else show_hudmessage(id, "[ %i / %i Kills ]", iKills[id], iKNum);
  741.  
  742. }
  743.  
  744. }
  745.  
  746. }
  747.  
  748.  
  749.  
  750. public fw_SayCmd(id) {
  751.  
  752. if(bPrefix) {
  753.  
  754. new szName[33], szArgs[192], szPrefix[16];
  755.  
  756. get_user_name(id, szName, charsmax(szName));
  757.  
  758. read_args(szArgs, charsmax(szArgs));
  759.  
  760. remove_quotes(szArgs);
  761.  
  762. if(!is_user_alive(id))
  763.  
  764. szPrefix = "*DEAD* ";
  765.  
  766. ColorChat(0, TEAM_COLOR, "^1%s^4[ Level: %i ]^3 %s^1 : %s", szPrefix, iLevels[id], szName, szArgs);
  767.  
  768. return PLUGIN_HANDLED;
  769.  
  770. }
  771.  
  772. return PLUGIN_CONTINUE;
  773.  
  774. }
  775.  
  776.  
  777.  
  778. stock set_user_fade(index) {
  779.  
  780. message_begin(MSG_ONE_UNRELIABLE, g_msg_screenfade, _, index);
  781.  
  782. write_short((1 << 12) * 1);
  783.  
  784. write_short(floatround((1 << 12) * 0.1));
  785.  
  786. write_short(0x0000);
  787.  
  788. write_byte(0);
  789.  
  790. write_byte(255);
  791.  
  792. write_byte(255);
  793.  
  794. write_byte(150);
  795.  
  796. message_end();
  797.  
  798. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement