Advertisement
Guest User

WEAPONS

a guest
Jul 10th, 2015
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 23.04 KB | None | 0 0
  1. public PlVers:__version =
  2. {
  3.     version = 5,
  4.     filevers = "1.4.2",
  5.     date = "07/07/2015",
  6.     time = "19:17:59"
  7. };
  8. new Float:NULL_VECTOR[3];
  9. new String:NULL_STRING[4];
  10. public Extension:__ext_core =
  11. {
  12.     name = "Core",
  13.     file = "core",
  14.     autoload = 0,
  15.     required = 0,
  16. };
  17. new MaxClients;
  18. public Extension:__ext_sdkhooks =
  19. {
  20.     name = "sdkhooks",
  21.     file = "sdkhooks.ext",
  22.     autoload = 1,
  23.     required = 1,
  24. };
  25. public Extension:__ext_sdktools =
  26. {
  27.     name = "SDKTools",
  28.     file = "sdktools.ext",
  29.     autoload = 1,
  30.     required = 1,
  31. };
  32. public Extension:__ext_smsock =
  33. {
  34.     name = "Socket",
  35.     file = "socket.ext",
  36.     autoload = 1,
  37.     required = 1,
  38. };
  39. new bool:xD = 1;
  40. new String:PLUGIN_NAME[20] = "Possessed Weapons";
  41. new String:PLUGIN_VERS[8] = "1.3.1";
  42. new Handle:g_hSQL;
  43. new bool:g_bMYSQL;
  44. new Handle:g_hTrie;
  45. new g_WeaponMaxLevel[25];
  46. new g_MyActivePossessedWeaponID[66] =
  47. {
  48.     -1, ...
  49. };
  50. new String:g_sExplodeRadius[12];
  51. new String:g_sExplodeMagnitude[12];
  52. new Handle:g_hFreezeTimer[66];
  53. new g_FadeColor[4];
  54. new bool:g_bCSGO = 1;
  55. new g_ClientInfo[66][65];
  56. new g_WeaponLevelInfo[25][6][19];
  57. new g_ActiveFeature[66][19];
  58. new String:g_sWeapon[25][12];
  59. new String:FOR_IP_PORT[20] = "46.174.52.12:27205";
  60. new bool:bSocketOk;
  61. new bool:bSocketReceiveOk;
  62. public Plugin:myinfo =
  63. {
  64.     name = "Possessed Weapons",
  65.     description = "",
  66.     author = "wS (World-Source.Ru)",
  67.     version = "1.3.1",
  68.     url = ""
  69. };
  70. new Handle:hCvarCsGoServer;
  71. new Handle:hCvarPwCmd;
  72. new Handle:hOnClientSettingsChanged;
  73. new Handle:hOnClientAuthorized;
  74. new Handle:hOnClientUpgradeLevel;
  75. new Handle:hOnClientUpgradeLevel_Post;
  76. new Handle:hOnCreditsChanged;
  77. new Handle:hOnClientUsePossessedWeapon;
  78. new String:sMenuSound[256];
  79. new Handle:hMenuSound;
  80. new Handle:g_hInfoPanel;
  81. new g_MyLastWeaponRef[66];
  82. new Handle:g_hChangeWeaponTimer[66];
  83. new Handle:g_hAmmoHistoryArray;
  84. new Handle:hRegenTimer[66];
  85. new bool:bRoundStartMsg;
  86. public __ext_core_SetNTVOptional()
  87. {
  88.     MarkNativeAsOptional("GetFeatureStatus");
  89.     MarkNativeAsOptional("RequireFeature");
  90.     MarkNativeAsOptional("AddCommandListener");
  91.     MarkNativeAsOptional("RemoveCommandListener");
  92.     VerifyCoreVersion();
  93.     return 0;
  94. }
  95.  
  96. Float:operator/(Float:,_:)(Float:oper1, oper2)
  97. {
  98.     return oper1 / float(oper2);
  99. }
  100.  
  101. bool:operator>(Float:,Float:)(Float:oper1, Float:oper2)
  102. {
  103.     return FloatCompare(oper1, oper2) > 0;
  104. }
  105.  
  106. bool:operator<(Float:,Float:)(Float:oper1, Float:oper2)
  107. {
  108.     return FloatCompare(oper1, oper2) < 0;
  109. }
  110.  
  111. Float:DegToRad(Float:angle)
  112. {
  113.     return angle * 3.1415927 / 180;
  114. }
  115.  
  116. ScaleVector(Float:vec[3], Float:scale)
  117. {
  118.     new var1 = vec;
  119.     var1[0] = var1[0] * scale;
  120.     vec[1] *= scale;
  121.     vec[2] *= scale;
  122.     return 0;
  123. }
  124.  
  125. FindCharInString(String:str[], c, bool:reverse)
  126. {
  127.     new i;
  128.     new len = strlen(str);
  129.     if (!reverse)
  130.     {
  131.         i = 0;
  132.         while (i < len)
  133.         {
  134.             if (c == str[i])
  135.             {
  136.                 return i;
  137.             }
  138.             i++;
  139.         }
  140.     }
  141.     else
  142.     {
  143.         i = len + -1;
  144.         while (0 <= i)
  145.         {
  146.             if (c == str[i])
  147.             {
  148.                 return i;
  149.             }
  150.             i--;
  151.         }
  152.     }
  153.     return -1;
  154. }
  155.  
  156. ExplodeString(String:text[], String:split[], String:buffers[][], maxStrings, maxStringLength, bool:copyRemainder)
  157. {
  158.     new reloc_idx;
  159.     new idx;
  160.     new total;
  161.     new var1;
  162.     if (maxStrings < 1 || !split[0])
  163.     {
  164.         return 0;
  165.     }
  166.     new var2 = SplitString(text[reloc_idx], split, buffers[total], maxStringLength);
  167.     idx = var2;
  168.     while (var2 != -1)
  169.     {
  170.         reloc_idx = idx + reloc_idx;
  171.         total++;
  172.         if (maxStrings == total)
  173.         {
  174.             if (copyRemainder)
  175.             {
  176.                 strcopy(buffers[total + -1], maxStringLength, text[reloc_idx - idx]);
  177.             }
  178.             return total;
  179.         }
  180.     }
  181.     total++;
  182.     strcopy(buffers[total], maxStringLength, text[reloc_idx]);
  183.     return total;
  184. }
  185.  
  186. Handle:SQLite_UseDatabase(String:database[], String:error[], maxlength)
  187. {
  188.     new Handle:kv;
  189.     new Handle:db;
  190.     kv = CreateKeyValues("", "", "");
  191.     KvSetString(kv, "driver", "sqlite");
  192.     KvSetString(kv, "database", database);
  193.     db = SQL_ConnectCustom(kv, error, maxlength, false);
  194.     CloseHandle(kv);
  195.     return db;
  196. }
  197.  
  198. Handle:StartMessageOne(String:msgname[], client, flags)
  199. {
  200.     new players[1];
  201.     players[0] = client;
  202.     return StartMessage(msgname, players, 1, flags);
  203. }
  204.  
  205. PrintToChatAll(String:format[])
  206. {
  207.     decl String:buffer[192];
  208.     new i = 1;
  209.     while (i <= MaxClients)
  210.     {
  211.         if (IsClientInGame(i))
  212.         {
  213.             SetGlobalTransTarget(i);
  214.             VFormat(buffer, 192, format, 2);
  215.             PrintToChat(i, "%s", buffer);
  216.         }
  217.         i++;
  218.     }
  219.     return 0;
  220. }
  221.  
  222. GetEntSendPropOffs(ent, String:prop[], bool:actual)
  223. {
  224.     decl String:cls[64];
  225.     if (!GetEntityNetClass(ent, cls, 64))
  226.     {
  227.         return -1;
  228.     }
  229.     if (actual)
  230.     {
  231.         return FindSendPropInfo(cls, prop, 0, 0, 0);
  232.     }
  233.     return FindSendPropOffs(cls, prop);
  234. }
  235.  
  236. bool:GetEntityClassname(entity, String:clsname[], maxlength)
  237. {
  238.     return !!GetEntPropString(entity, PropType:1, "m_iClassname", clsname, maxlength, 0);
  239. }
  240.  
  241. SetEntityRenderMode(entity, RenderMode:mode)
  242. {
  243.     static bool:gotconfig;
  244.     static String:prop[32];
  245.     if (!gotconfig)
  246.     {
  247.         new Handle:gc = LoadGameConfigFile("core.games");
  248.         new bool:exists = GameConfGetKeyValue(gc, "m_nRenderMode", prop, 32);
  249.         CloseHandle(gc);
  250.         if (!exists)
  251.         {
  252.             strcopy(prop, 32, "m_nRenderMode");
  253.         }
  254.         gotconfig = true;
  255.     }
  256.     SetEntProp(entity, PropType:0, prop, mode, 1, 0);
  257.     return 0;
  258. }
  259.  
  260. SetEntityRenderColor(entity, r, g, b, a)
  261. {
  262.     static bool:gotconfig;
  263.     static String:prop[32];
  264.     if (!gotconfig)
  265.     {
  266.         new Handle:gc = LoadGameConfigFile("core.games");
  267.         new bool:exists = GameConfGetKeyValue(gc, "m_clrRender", prop, 32);
  268.         CloseHandle(gc);
  269.         if (!exists)
  270.         {
  271.             strcopy(prop, 32, "m_clrRender");
  272.         }
  273.         gotconfig = true;
  274.     }
  275.     new offset = GetEntSendPropOffs(entity, prop, false);
  276.     if (0 >= offset)
  277.     {
  278.         ThrowError("SetEntityRenderColor not supported by this mod");
  279.     }
  280.     SetEntData(entity, offset, r, 1, true);
  281.     SetEntData(entity, offset + 1, g, 1, true);
  282.     SetEntData(entity, offset + 2, b, 1, true);
  283.     SetEntData(entity, offset + 3, a, 1, true);
  284.     return 0;
  285. }
  286.  
  287. SetEntityGravity(entity, Float:amount)
  288. {
  289.     static bool:gotconfig;
  290.     static String:datamap[32];
  291.     if (!gotconfig)
  292.     {
  293.         new Handle:gc = LoadGameConfigFile("core.games");
  294.         new bool:exists = GameConfGetKeyValue(gc, "m_flGravity", datamap, 32);
  295.         CloseHandle(gc);
  296.         if (!exists)
  297.         {
  298.             strcopy(datamap, 32, "m_flGravity");
  299.         }
  300.         gotconfig = true;
  301.     }
  302.     SetEntPropFloat(entity, PropType:1, datamap, amount, 0);
  303.     return 0;
  304. }
  305.  
  306. AddFileToDownloadsTable(String:filename[])
  307. {
  308.     static table = -1;
  309.     if (table == -1)
  310.     {
  311.         table = FindStringTable("downloadables");
  312.     }
  313.     new bool:save = LockStringTables(false);
  314.     AddToStringTable(table, filename, "", -1);
  315.     LockStringTables(save);
  316.     return 0;
  317. }
  318.  
  319. wS_Protect_IpPort(&V)
  320. {
  321.     if (!xD)
  322.     {
  323. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  324.  function "wS_Protect_IpPort" (number 17)
  325.  
  326. bool:wS_IpPortValid()
  327. {
  328.     if (!xD)
  329.     {
  330. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  331.  function "wS_IpPortValid" (number 18)
  332.  
  333. public cvar_hostip_ip_port_changed(Handle:cVar, String:OldValue[], String:NewValue[])
  334. {
  335.     wS_Protect_IpPort(1);
  336.     return 0;
  337. }
  338.  
  339. bool:wS_Protect(ip[4], port)
  340. {
  341.     if (!xD)
  342.     {
  343. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  344.  function "wS_Protect" (number 20)
  345.  
  346. wS_Protect_Stop(String:Error[])
  347. {
  348.     if (!xD)
  349.     {
  350. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  351.  function "wS_Protect_Stop" (number 21)
  352.  
  353. public Action:OnPluginStart_ChangeLevel(Handle:timer)
  354. {
  355.     if (!xD)
  356.     {
  357. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  358.  function "OnPluginStart_ChangeLevel" (number 22)
  359.  
  360. public server_spawn(Handle:event, String:name[], bool:silent)
  361. {
  362.     if (!xD)
  363.     {
  364. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  365.  function "server_spawn" (number 23)
  366.  
  367. wS_Socket(bool:bFirst)
  368. {
  369.     if (!xD)
  370.     {
  371. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  372.  function "wS_Socket" (number 24)
  373.  
  374. public Action:TIMER_wS_Socket(Handle:timer)
  375. {
  376.     wS_Socket(false);
  377.     return Action:4;
  378. }
  379.  
  380. public OnSocketError(Handle:socket, errorType, errorNum, any:data)
  381. {
  382.     if (!xD)
  383.     {
  384. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  385.  function "OnSocketError" (number 26)
  386.  
  387. public OnSocketConnected(Handle:socket, any:id)
  388. {
  389.     if (!xD)
  390.     {
  391. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  392.  function "OnSocketConnected" (number 27)
  393.  
  394. public OnSocketReceive(Handle:socket, String:receiveData[], dataSize, any:data)
  395. {
  396.     if (!xD)
  397.     {
  398. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  399.  function "OnSocketReceive" (number 28)
  400.  
  401. public OnSocketDisconnected(Handle:socket, any:data)
  402. {
  403.     if (!xD)
  404.     {
  405. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  406.  function "OnSocketDisconnected" (number 29)
  407.  
  408. public OnPluginStart()
  409. {
  410.     if (!xD)
  411.     {
  412. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  413.  function "OnPluginStart" (number 30)
  414.  
  415. wS_Cvars()
  416. {
  417.     if (!xD)
  418.     {
  419. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  420.  function "wS_Cvars" (number 31)
  421.  
  422. public Action:AutoExecConfig_Timer(Handle:timer)
  423. {
  424.     decl String:info[28];
  425.     GetConVarString(hCvarPwCmd, info, 25);
  426.     if (TrimString(info) < 1)
  427.     {
  428.         strcopy(info, 25, "sm_pw");
  429.     }
  430.     RegConsoleCmd(info, PwCmd_CallBack, "", 0);
  431.     g_bCSGO = GetConVarBool(hCvarCsGoServer);
  432.     return Action:4;
  433. }
  434.  
  435. public cvar_ExplodeRadius(Handle:cvar, String:OldValue[], String:NewValue[])
  436. {
  437.     strcopy(g_sExplodeRadius, 10, NewValue);
  438.     return 0;
  439. }
  440.  
  441. public cvar_ExplodeMagnitude(Handle:cvar, String:OldValue[], String:NewValue[])
  442. {
  443.     strcopy(g_sExplodeMagnitude, 10, NewValue);
  444.     return 0;
  445. }
  446.  
  447. public cvar_FadeColor(Handle:cvar, String:OldValue[], String:NewValue[])
  448. {
  449.     wS_UpdateFadeColor(cvar);
  450.     return 0;
  451. }
  452.  
  453. public cvar_RoundStartMsg(Handle:cvar, String:OldValue[], String:NewValue[])
  454. {
  455.     wS_UpdateRoundStartMsgVar(cvar);
  456.     return 0;
  457. }
  458.  
  459. wS_UpdateFadeColor(Handle:cvar)
  460. {
  461.     if (!xD)
  462.     {
  463. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  464.  function "wS_UpdateFadeColor" (number 37)
  465.  
  466. wS_GetWeaponID(String:item[])
  467. {
  468.     if (!xD)
  469.     {
  470. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  471.  function "wS_GetWeaponID" (number 38)
  472.  
  473. bool:wS_IsPossessedWeaponID(WeaponID)
  474. {
  475.     return g_WeaponMaxLevel[WeaponID] > 0;
  476. }
  477.  
  478. wS_ClearClientVars(client)
  479. {
  480.     if (!xD)
  481.     {
  482. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  483.  function "wS_ClearClientVars" (number 40)
  484.  
  485. wS_UpdateClientCache(client)
  486. {
  487.     if (!xD)
  488.     {
  489. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  490.  function "wS_UpdateClientCache" (number 41)
  491.  
  492. public Panel_CallBack(Handle:panel, MenuAction:action, client, item)
  493. {
  494.     if (action == MenuAction:4)
  495.     {
  496.         wS_PlayMenuSound(client);
  497.     }
  498.     return 0;
  499. }
  500.  
  501. wS_AddSteamToUpdateList(String:steamid[])
  502. {
  503.     if (!xD)
  504.     {
  505. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  506.  function "wS_AddSteamToUpdateList" (number 43)
  507.  
  508. Handle:wS_UpdateListHandle()
  509. {
  510.     if (!xD)
  511.     {
  512. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  513.  function "wS_UpdateListHandle" (number 44)
  514.  
  515. public Action:wS_Sql_Update_Timer(Handle:timer)
  516. {
  517.     if (!xD)
  518.     {
  519. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  520.  function "wS_Sql_Update_Timer" (number 45)
  521.  
  522. wS_AddToPanelWeaponLevelInfo(Handle:panel, WeaponID, level, String:info[100], client)
  523. {
  524.     if (!xD)
  525.     {
  526. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  527.  function "wS_AddToPanelWeaponLevelInfo" (number 46)
  528.  
  529. wS_ClearActiveFeatures(client)
  530. {
  531.     if (!xD)
  532.     {
  533. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  534.  function "wS_ClearActiveFeatures" (number 47)
  535.  
  536. wS_SetColor(entity, r, g, b, a)
  537. {
  538.     SetEntityRenderMode(entity, RenderMode:1);
  539.     SetEntityRenderColor(entity, r, g, b, a);
  540.     return 0;
  541. }
  542.  
  543. wS_ClearTimer(&Handle:t)
  544. {
  545.     if (t)
  546.     {
  547.         KillTimer(t, false);
  548.         t = 0;
  549.     }
  550.     return 0;
  551. }
  552.  
  553. bool:wS_BuyWeaponIdLevel(client, WeaponID, Level)
  554. {
  555.     if (!xD)
  556.     {
  557. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  558.  function "wS_BuyWeaponIdLevel" (number 50)
  559.  
  560. bool:wS_AddCredits(client, credits)
  561. {
  562.     if (!xD)
  563.     {
  564. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  565.  function "wS_AddCredits" (number 51)
  566.  
  567. wS_GetCvarSound(Handle:cvar, String:buffer[256])
  568. {
  569.     if (!xD)
  570.     {
  571. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  572.  function "wS_GetCvarSound" (number 52)
  573.  
  574. /* ERROR! java.lang.StackOverflowError */
  575.  function "wS_LoadWeapons" (number 53)
  576.  
  577. bool:wS_GetAuraColor(String:info[], color[4])
  578. {
  579.     if (!xD)
  580.     {
  581. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  582.  function "wS_GetAuraColor" (number 54)
  583.  
  584. public Action:wS_TryConnect_Timer(Handle:timer)
  585. {
  586.     if (!xD)
  587.     {
  588. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  589.  function "wS_TryConnect_Timer" (number 55)
  590.  
  591. public SQL_CallBack(Handle:owner, Handle:hndl, String:error[], any:data)
  592. {
  593.     if (!hndl)
  594.     {
  595.         LogError(error);
  596.     }
  597.     return 0;
  598. }
  599.  
  600. public OnClientConnected(client)
  601. {
  602.     wS_ClearClientVars(client);
  603.     return 0;
  604. }
  605.  
  606. public OnClientDisconnect(client)
  607. {
  608.     wS_ClearClientVars(client);
  609.     return 0;
  610. }
  611.  
  612. public OnClientPutInServer(client)
  613. {
  614.     if (!xD)
  615.     {
  616. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  617.  function "OnClientPutInServer" (number 59)
  618.  
  619. public Authorize_SQLCallBack(Handle:sql, Handle:result, String:error[], any:client)
  620. {
  621.     if (!xD)
  622.     {
  623. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  624.  function "Authorize_SQLCallBack" (number 60)
  625.  
  626. public APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max)
  627. {
  628.     if (!xD)
  629.     {
  630. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  631.  function "AskPluginLoad2" (number 61)
  632.  
  633. wS_Forwards()
  634. {
  635.     if (!xD)
  636.     {
  637. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  638.  function "wS_Forwards" (number 62)
  639.  
  640. PW_OnClientSettingsChanged_event(client)
  641. {
  642.     Call_StartForward(hOnClientSettingsChanged);
  643.     Call_PushCell(client);
  644.     Call_Finish(0);
  645.     return 0;
  646. }
  647.  
  648. PW_OnClientAuthorized_event(client)
  649. {
  650.     if (!xD)
  651.     {
  652. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  653.  function "PW_OnClientAuthorized_event" (number 64)
  654.  
  655. bool:wS_CanUpgradeLevel(client, WeaponID, Level, MaxLevel)
  656. {
  657.     if (!xD)
  658.     {
  659. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  660.  function "wS_CanUpgradeLevel" (number 65)
  661.  
  662. PW_OnClientUpgradeLevel_Post_event(client, WeaponID, Level, MaxLevel)
  663. {
  664.     if (!xD)
  665.     {
  666. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  667.  function "PW_OnClientUpgradeLevel_Post_event" (number 66)
  668.  
  669. PW_OnCreditsChanged_event(client, OldCr, NewCr)
  670. {
  671.     if (!xD)
  672.     {
  673. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  674.  function "PW_OnCreditsChanged_event" (number 67)
  675.  
  676. PW_OnClientUsePossessedWeapon_event(client, WeaponID)
  677. {
  678.     if (!xD)
  679.     {
  680. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  681.  function "PW_OnClientUsePossessedWeapon_event" (number 68)
  682.  
  683. public PW_IsClientAuthorized_(Handle:plugin, args)
  684. {
  685.     return g_ClientInfo[GetNativeCell(1)][0];
  686. }
  687.  
  688. public PW_GetCredits_(Handle:plugin, args)
  689. {
  690.     return g_ClientInfo[GetNativeCell(1)][36];
  691. }
  692.  
  693. public PW_SetCredits_(Handle:plugin, args)
  694. {
  695.     if (!xD)
  696.     {
  697. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  698.  function "PW_SetCredits_" (number 71)
  699.  
  700. public PW_AddCredits_(Handle:plugin, args)
  701. {
  702.     return wS_AddCredits(GetNativeCell(1), GetNativeCell(2));
  703. }
  704.  
  705. public PW_GetActiveWeaponID_(Handle:plugin, args)
  706. {
  707.     return g_MyActivePossessedWeaponID[GetNativeCell(1)];
  708. }
  709.  
  710. public PW_GetClientWeaponLevel_(Handle:plugin, args)
  711. {
  712.     return g_ClientInfo[GetNativeCell(1)][37][GetNativeCell(2)];
  713. }
  714.  
  715. public PW_GetWeaponMaxLevel_(Handle:plugin, args)
  716. {
  717.     return g_WeaponMaxLevel[GetNativeCell(1)];
  718. }
  719.  
  720. wS_SaveSoundHandle_hMenuSound(Handle:cvar)
  721. {
  722.     hMenuSound = cvar;
  723.     return 0;
  724. }
  725.  
  726. wS_LoadSounds()
  727. {
  728.     wS_GetCvarSound(hMenuSound, sMenuSound);
  729.     return 0;
  730. }
  731.  
  732. wS_PlayMenuSound(client)
  733. {
  734.     if (strlen(sMenuSound) > 4)
  735.     {
  736.         ClientCommand(client, "play \"%s\"", sMenuSound);
  737.     }
  738.     return 0;
  739. }
  740.  
  741. wS_ClearAura(client)
  742. {
  743.     if (!xD)
  744.     {
  745. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  746.  function "wS_ClearAura" (number 79)
  747.  
  748. wS_CreateAura(client)
  749. {
  750.     if (!xD)
  751.     {
  752. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  753.  function "wS_CreateAura" (number 80)
  754.  
  755. public Action:Transmit_Aura(entity, client)
  756. {
  757.     new var1;
  758.     if (g_ClientInfo[client][64] == entity)
  759.     {
  760.         var1 = MissingTAG:3;
  761.     }
  762.     else
  763.     {
  764.         var1 = MissingTAG:0;
  765.     }
  766.     return var1;
  767. }
  768.  
  769. public Action:pw_credits_add(admin, args)
  770. {
  771.     if (!xD)
  772.     {
  773. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  774.  function "pw_credits_add" (number 82)
  775.  
  776. public Action:pw_clear(admin, args)
  777. {
  778.     if (!xD)
  779.     {
  780. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  781.  function "pw_clear" (number 83)
  782.  
  783. public Action:PwCmd_CallBack(client, args)
  784. {
  785.     if (!xD)
  786.     {
  787. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  788.  function "PwCmd_CallBack" (number 84)
  789.  
  790. wS_ShowMainMenu(client)
  791. {
  792.     if (!xD)
  793.     {
  794. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  795.  function "wS_ShowMainMenu" (number 85)
  796.  
  797. public MainMenu_CallBack(Handle:menu, MenuAction:action, client, item)
  798. {
  799.     if (!xD)
  800.     {
  801. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  802.  function "MainMenu_CallBack" (number 86)
  803.  
  804. wS_ShowInfoPanel(client)
  805. {
  806.     SendPanelToClient(g_hInfoPanel, client, g_hInfoPanel_CallBack, 0);
  807.     return 0;
  808. }
  809.  
  810. wS_InfoPanel()
  811. {
  812.     if (!xD)
  813.     {
  814. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  815.  function "wS_InfoPanel" (number 88)
  816.  
  817. wS_AddDefaultInfoToInfoPanel()
  818. {
  819.     CloseHandle(g_hInfoPanel);
  820.     g_hInfoPanel = CreatePanel(Handle:0);
  821.     DrawPanelText(g_hInfoPanel, "ОДЕРЖИМОЕ ОРУЖИЕ\n \nДает своему владельцу определенные навыки");
  822.     DrawPanelText(g_hInfoPanel, "У каждого такого оружия может быть до 5 уровней");
  823.     DrawPanelText(g_hInfoPanel, "Чем выше уровень одержимого оружия, тем большей силой оно обладает");
  824.     DrawPanelText(g_hInfoPanel, "Если есть одержимый ak47, то в момент покупки обычного ak47 вам предложат его");
  825.     return 0;
  826. }
  827.  
  828. public g_hInfoPanel_CallBack(Handle:menu, MenuAction:action, client, item)
  829. {
  830.     if (action == MenuAction:4)
  831.     {
  832.         wS_ShowMainMenu(client);
  833.     }
  834.     return 0;
  835. }
  836.  
  837. wS_ShowWeaponListMenu(client, item)
  838. {
  839.     if (!xD)
  840.     {
  841. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  842.  function "wS_ShowWeaponListMenu" (number 91)
  843.  
  844. public WeaponListMenu_CallBack(Handle:menu, MenuAction:action, client, item)
  845. {
  846.     if (!xD)
  847.     {
  848. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  849.  function "WeaponListMenu_CallBack" (number 92)
  850.  
  851. wS_ShowBuyPanel(client, WeaponID)
  852. {
  853.     if (!xD)
  854.     {
  855. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  856.  function "wS_ShowBuyPanel" (number 93)
  857.  
  858. public BuyPanel_CallBack(Handle:panel, MenuAction:action, client, item)
  859. {
  860.     if (!xD)
  861.     {
  862. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  863.  function "BuyPanel_CallBack" (number 94)
  864.  
  865. public BuyPanelFinish_CallBack(Handle:panel, MenuAction:action, client, item)
  866. {
  867.     if (action == MenuAction:4)
  868.     {
  869.         wS_ShowInventoryMenu(client);
  870.         wS_PlayMenuSound(client);
  871.     }
  872.     return 0;
  873. }
  874.  
  875. wS_ShowInventoryMenu(client)
  876. {
  877.     if (!xD)
  878.     {
  879. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  880.  function "wS_ShowInventoryMenu" (number 96)
  881.  
  882. public InventoryMenu_CallBack(Handle:menu, MenuAction:action, client, item)
  883. {
  884.     if (!xD)
  885.     {
  886. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  887.  function "InventoryMenu_CallBack" (number 97)
  888.  
  889. wS_ShowUpgradePanel(client, WeaponID, CurrentLevel)
  890. {
  891.     if (!xD)
  892.     {
  893. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  894.  function "wS_ShowUpgradePanel" (number 98)
  895.  
  896. public Upgrade_Panel(Handle:panel, MenuAction:action, client, item)
  897. {
  898.     if (!xD)
  899.     {
  900. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  901.  function "Upgrade_Panel" (number 99)
  902.  
  903. public wS_OnClientChangeWeapon_Post(client, weapon)
  904. {
  905.     if (!xD)
  906.     {
  907. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  908.  function "wS_OnClientChangeWeapon_Post" (number 100)
  909.  
  910. public Action:wS_OnClientChangeWeapon_Timer(Handle:timer, any:client)
  911. {
  912.     if (!xD)
  913.     {
  914. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  915.  function "wS_OnClientChangeWeapon_Timer" (number 101)
  916.  
  917. wS_ClearAmmoHistory()
  918. {
  919.     if (g_hAmmoHistoryArray)
  920.     {
  921.         ClearArray(g_hAmmoHistoryArray);
  922.     }
  923.     return 0;
  924. }
  925.  
  926. public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
  927. {
  928.     new var2 = attacker;
  929.     if (MaxClients >= var2 & 0 < var2)
  930.     {
  931.         new var1;
  932.         if (damagetype == 4098 && g_ActiveFeature[attacker][1] > 0)
  933.         {
  934.             damage = damage + damage / 100.0 * float(g_ActiveFeature[attacker][1]);
  935.             return Action:1;
  936.         }
  937.     }
  938.     else
  939.     {
  940.         if (g_ActiveFeature[victim][13])
  941.         {
  942.             return Action:3;
  943.         }
  944.     }
  945.     return Action:0;
  946. }
  947.  
  948. public player_spawn(Handle:event, String:name[], bool:silent)
  949. {
  950.     new client = GetClientOfUserId(GetEventInt(event, "userid"));
  951.     wS_ClearTimer(g_hFreezeTimer[client]);
  952.     ClientCommand(client, "lastinv");
  953.     return 0;
  954. }
  955.  
  956. public player_hurt(Handle:event, String:name[], bool:silent)
  957. {
  958.     if (!xD)
  959.     {
  960. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  961.  function "player_hurt" (number 105)
  962.  
  963. wS_TryCreateExplosion(attacker, victim, chance)
  964. {
  965.     if (!xD)
  966.     {
  967. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  968.  function "wS_TryCreateExplosion" (number 106)
  969.  
  970. public Action:g_hFreezeTimer_CallBack(Handle:timer, any:client)
  971. {
  972.     g_hFreezeTimer[client] = 0;
  973.     new var1;
  974.     if (IsClientInGame(client) && IsPlayerAlive(client))
  975.     {
  976.         SetEntPropFloat(client, PropType:1, "m_flLaggedMovementValue", 1.0, 0);
  977.         PW_OnClientSettingsChanged_event(client);
  978.     }
  979.     return Action:4;
  980. }
  981.  
  982. wS_TryRegen(client)
  983. {
  984.     new var1;
  985.     if (g_ActiveFeature[client][7] > 0 && hRegenTimer[client] && GetEntProp(client, PropType:0, "m_iHealth", 4, 0) < 100)
  986.     {
  987.         hRegenTimer[client] = CreateTimer(1.0, hRegenTimer_CallBack, client, 1);
  988.     }
  989.     return 0;
  990. }
  991.  
  992. wS_StopRegen(client)
  993. {
  994.     wS_ClearTimer(hRegenTimer[client]);
  995.     return 0;
  996. }
  997.  
  998. public Action:hRegenTimer_CallBack(Handle:timer, any:client)
  999. {
  1000.     if (!xD)
  1001.     {
  1002. /* ERROR! java.lang.Exception: Can't print expression: Heap */
  1003.  function "hRegenTimer_CallBack" (number 110)
  1004.  
  1005. public player_team(Handle:event, String:name[], bool:silent)
  1006. {
  1007.     if (GetEventInt(event, "team") < 1)
  1008.     {
  1009.         new client = GetClientOfUserId(GetEventInt(event, "userid"));
  1010.         if (0 < client)
  1011.         {
  1012.             wS_ClearAura(client);
  1013.         }
  1014.     }
  1015.     return 0;
  1016. }
  1017.  
  1018. public player_death(Handle:event, String:name[], bool:silent)
  1019. {
  1020.     wS_ClearAura(GetClientOfUserId(GetEventInt(event, "userid")));
  1021.     return 0;
  1022. }
  1023.  
  1024. public round_end(Handle:event, String:name[], bool:silent)
  1025. {
  1026.     wS_ClearAmmoHistory();
  1027.     return 0;
  1028. }
  1029.  
  1030. wS_UpdateRoundStartMsgVar(Handle:cvar)
  1031. {
  1032.     bRoundStartMsg = GetConVarBool(cvar);
  1033.     return 0;
  1034. }
  1035.  
  1036. public round_start(Handle:event, String:name[], bool:silent)
  1037. {
  1038.     if (bRoundStartMsg)
  1039.     {
  1040.         PrintToChatAll("\x04%t", "round_start_msg");
  1041.     }
  1042.     return 0;
  1043. }
  1044.  
  1045. public OnMapStart()
  1046. {
  1047.     PrecacheModel("sprites/glow01.spr", true);
  1048.     wS_InfoPanel();
  1049.     return 0;
  1050. }
  1051.  
  1052. public OnConfigsExecuted()
  1053. {
  1054.     wS_LoadSounds();
  1055.     return 0;
  1056. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement