Advertisement
Guest User

Anonymous

a guest
Jan 18th, 2011
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 18.45 KB | None | 0 0
  1. ////////////////
  2. //GLOBAL STUFF//
  3. ////////////////
  4. #include <sourcemod>
  5. #include <sdktools>
  6. #include <tf2>
  7. #include <tf2_stocks>
  8. #include <colors>
  9. #include <clientprefs>
  10.  
  11. #pragma semicolon 1
  12.  
  13. #define PLUGIN_VERSION "1.14"
  14. #define PLUGIN_AUTHOR "Modified by 404: User Not Found, Originally created by noodleboy347"
  15. #define PLUGIN_NAME "[TF2] Special Donator Features"
  16. #define PLUGIN_URL "http://www.alliedmods.net"
  17. #define PLUGIN_DESCRIPTION "Speciality Donator Features"
  18.  
  19. #define NO_ATTACH 0
  20. #define ATTACH_NORMAL 1
  21. #define ATTACH_HEAD 2
  22.  
  23. #define PREMIUMFLAG ADMFLAG_CUSTOM1
  24. #define ADMINFLAG ADMFLAG_GENERIC
  25. #define TAG "{green}[{lightgreen}DONATE{green}]{default}"
  26.  
  27. new Handle:cvar_enable;
  28. new Handle:cvar_ads_enable;
  29. new Handle:cvar_ads_int;
  30. new Handle:cvar_swapteams;
  31. new Handle:cvar_color;
  32. new Handle:cvar_playerblack;
  33. new Handle:cvar_playerred;
  34. new Handle:cvar_playerblue;
  35. new Handle:cvar_playergreen;
  36. new Handle:cvar_playeryellow;
  37. new Handle:cvar_playerpurple;
  38. new Handle:cvar_playercyan;
  39. new Handle:cvar_glow;
  40. new Handle:cvar_infcloak;
  41. new Handle:cvar_metal;
  42. new Handle:cvar_stunballs;
  43. new Handle:cvar_jarates;
  44. new Handle:cvar_milks;
  45. new Handle:cvar_uber;
  46. new Handle:cvar_clip;
  47.  
  48. new cEnable;
  49. new cAdsEnable;
  50. new Float:cAdsInterval;
  51. new cInfCloak;
  52. new cColor;
  53. new cPlayerBlack;
  54. new cPlayerRed;
  55. new cPlayerBlue;
  56. new cPlayerGreen;
  57. new cPlayerYellow;
  58. new cPlayerPurple;
  59. new cPlayerCyan;
  60. new cGlow;
  61. new cSwap;
  62. new cStunballs;
  63. new cJarates;
  64. new cMilks;
  65. new cMetal;
  66. new Float:cUber;
  67. new cClip;
  68.  
  69. new Handle:tCloak[MAXPLAYERS+1];
  70. new Handle:tGlow[MAXPLAYERS+1];
  71.  
  72. new bool:pBlack[MAXPLAYERS+1];
  73. new bool:pRed[MAXPLAYERS+1];
  74. new bool:pBlue[MAXPLAYERS+1];
  75. new bool:pGreen[MAXPLAYERS+1];
  76. new bool:pYellow[MAXPLAYERS+1];
  77. new bool:pPurple[MAXPLAYERS+1];
  78. new bool:pCyan[MAXPLAYERS+1];
  79. new bool:pGlow[MAXPLAYERS+1];
  80. new bool:pFirstSpawn[MAXPLAYERS+1];
  81.  
  82.  
  83. //////////////////////
  84. //PLUGIN INFORMATION//
  85. //////////////////////
  86. public Plugin:myinfo =
  87. {
  88.     name = PLUGIN_NAME,
  89.     author = PLUGIN_AUTHOR,
  90.     description = PLUGIN_DESCRIPTION,
  91.     version = PLUGIN_VERSION,
  92.     url = PLUGIN_URL
  93. }
  94.  
  95.  
  96. ////////////////
  97. //PLUGIN START//
  98. ////////////////
  99. public OnPluginStart()
  100. {
  101.     RegConsoleCmd("say", Say);
  102.  
  103.     RegConsoleCmd("playerblack", Command_Black);
  104.     RegConsoleCmd("playerred", Command_Red);
  105.     RegConsoleCmd("playerblue", Command_Blue);
  106.     RegConsoleCmd("playergreen", Command_Green);
  107.     RegConsoleCmd("playeryellow", Command_Yellow);
  108.     RegConsoleCmd("playerpurple", Command_Purple);
  109.     RegConsoleCmd("playercyan", Command_Cyan);
  110.     RegConsoleCmd("swapteam", Command_Swap);
  111.     RegConsoleCmd("glow", Command_Glow);
  112.    
  113.     RegAdminCmd("premium_refresh", Command_Refresh, ADMFLAG_ROOT);
  114.    
  115.     CreateConVar("premium_version", PLUGIN_VERSION, "Plugin version", FCVAR_NOTIFY);
  116.     cvar_enable = CreateConVar("premium_enable", "1", "Enable/Disable the plugin");
  117.     cvar_ads_enable = CreateConVar("premium_advertisement_enable", "1", "Enable/Disable advertisements");
  118.     cvar_ads_int = CreateConVar("premium_advertisement_interval", "300", "Advertisement interval");
  119.     cvar_color = CreateConVar("premium_color", "1", "Give all donators a set color");
  120.     cvar_infcloak = CreateConVar("premium_cloak_infinite", "1", "Infinite Spy Cloak");
  121.     cvar_clip = CreateConVar("premium_extra_clip", "2", "Extra bullets in clip on spawn");
  122.     cvar_uber = CreateConVar("premium_ubercharge", "50", "Percentage of ubercharge for Medics");
  123.     cvar_stunballs = CreateConVar("premium_stunballs", "20", "Increased Stunballs for Scouts");
  124.     cvar_jarates = CreateConVar("premium_jarates", "10", "Increased Jarates for Snipers");
  125.     cvar_milks = CreateConVar("premium_milks", "20", "Increased Milks for Scouts");
  126.     cvar_metal = CreateConVar("premium_metal", "400", "Increased Metal for Engineers");
  127.     cvar_swapteams = CreateConVar("premium_swapteams", "1", "Instantly swap teams");
  128.     cvar_playerblack = CreateConVar("premium_black", "1", "Change player color to black");
  129.     cvar_playerred = CreateConVar("premium_red", "1", "Change player color to red");
  130.     cvar_playerblue = CreateConVar("premium_blue", "1", "Change player color to blue");
  131.     cvar_playergreen = CreateConVar("premium_green", "1", "Change player color to green");
  132.     cvar_playeryellow = CreateConVar("premium_yellow", "1", "Change player color to yellow");
  133.     cvar_playerpurple = CreateConVar("premium_purple", "1", "Change player color to purple");
  134.     cvar_playercyan = CreateConVar("premium_cyan", "1", "Change player color to cyan");
  135.     cvar_glow = CreateConVar("premium_glow", "1", "Give yourself a flaming head");
  136.    
  137.     HookEvent("player_spawn", Player_Spawn);
  138.     HookEvent("player_changeclass", Player_Change);
  139.     //HookEvent("post_inventory_application", Player_Locker);
  140.    
  141.    
  142.     AutoExecConfig();
  143.     LoadTranslations("premium.phrases");
  144.    
  145.     ReloadConvars();
  146.    
  147.     CreateTimer(cAdsInterval, Timer_Ad);
  148. }
  149.  
  150. public OnConfigsExecuted()
  151. {
  152.     ReloadConvars();
  153. }
  154.  
  155.  
  156. /////////////////////
  157. //CONNECT TO SERVER//
  158. /////////////////////
  159. public OnClientPostAdminCheck(client)
  160. {
  161.     if(cEnable && GetUserFlagBits(client) & PREMIUMFLAG)
  162.     {
  163.         pGlow[client] = false;
  164.         pFirstSpawn[client] = true;
  165.     }
  166. }
  167.  
  168. public Action:Timer_Ad(Handle:timer, any:client)
  169. {
  170.     if(cEnable && cAdsEnable && IsValidEntity(client))
  171.     {
  172.         CPrintToChatAll("%t", "Advertisement");
  173.         CreateTimer(cAdsInterval, Timer_Ad);
  174.     }
  175. }
  176.  
  177.  
  178. ////////////////
  179. //PLAYER SPAWN//
  180. ////////////////
  181. public Player_Spawn(Handle:event, const String:name[], bool:dontBroadcast)
  182. {
  183.     new client = GetClientOfUserId(GetEventInt(event, "userid"));
  184.    
  185.     if(cEnable && (GetUserFlagBits(client) && PREMIUMFLAG && IsClientInGame(client)))
  186.     {
  187.         if(pFirstSpawn[client])
  188.         {
  189.             Premium(client);
  190.         }
  191.     }
  192. }
  193.  
  194.  
  195. ////////////////
  196. //CHANGE CLASS//
  197. ////////////////
  198. public Player_Change(Handle:event, const String:name[], bool:dontBroadcast)
  199. {
  200.     new client = GetClientOfUserId(GetEventInt(event, "userid"));
  201.     if(cEnable && (GetUserFlagBits(client) & PREMIUMFLAG || IsValidEntity(client)))
  202.     {
  203.         CloseAllHandles(client);
  204.     }
  205. }
  206.  
  207.  
  208. ///////////////
  209. //CLOAK TIMER//
  210. ///////////////
  211. public Action:Timer_Cloak(Handle:hTimer, any:client)
  212. {
  213.     if(cEnable && cInfCloak && IsClientInGame(client) && IsValidEntity(client) && IsClientConnected(client))
  214.     {
  215.         new cond = GetEntProp(client, Prop_Send, "m_nPlayerCond");
  216.         if(cond & 16)
  217.             SetEntPropFloat(client, Prop_Send, "m_flCloakMeter", 100.0);
  218.     }
  219.     tCloak[client] = CreateTimer(0.1, Timer_Cloak, client);
  220. }
  221.  
  222.  
  223. ////////
  224. //GLOW//
  225. ////////
  226. public Action:Command_Glow(client, args)
  227. {
  228.     if(cEnable && cGlow)
  229.     {
  230.         if(GetUserFlagBits(client) && PREMIUMFLAG)
  231.         {
  232.             if(pGlow[client] == false)
  233.             {
  234.                 CreateParticle("burningplayer_red", 300.0, client, ATTACH_HEAD);
  235.                 pGlow[client] = true;
  236.                 tGlow[client] = CreateTimer(300.0, Timer_Glow, client);
  237.             }
  238.             else
  239.             {
  240.                 CPrintToChat(client, "%s %t", TAG, "AlreadyGlowing");
  241.             }
  242.             CPrintToChat(client, "%t", "ToggleGlow", client);
  243.         }
  244.         else
  245.         {
  246.             CPrintToChat(client, "%s %t", TAG, "NoAccess");
  247.         }
  248.     }
  249.     return Plugin_Handled;
  250. }
  251.  
  252. public Action:Timer_Glow(Handle:timer, any:client)
  253. {
  254.     pGlow[client] = false;
  255. }
  256.  
  257.  
  258. ///////////////////////
  259. //PLAYER COLOR: BLACK//
  260. ///////////////////////
  261. public Action:Command_Black(client, args)
  262. {
  263.     if(cEnable && cPlayerBlack)
  264.     {
  265.         if(GetUserFlagBits(client) && PREMIUMFLAG)
  266.         {
  267.             if(pBlack[client] == false)
  268.             {
  269.                 SetEntityRenderColor(client, 0, 0, 0, 255);
  270.                 pBlack[client] = true;
  271.             }
  272.             else
  273.             {
  274.                 SetClientColor(client, cColor);
  275.                 pBlack[client] = false;
  276.             }
  277.             CPrintToChat(client, "%t", "ToggleBlack", client);
  278.         }
  279.         else
  280.         {
  281.             CPrintToChat(client, "%s %t", TAG, "NoAccess");
  282.     }
  283.     }
  284.     return Plugin_Handled;
  285. }
  286.  
  287.  
  288. /////////////////////
  289. //PLAYER COLOR: RED//
  290. /////////////////////
  291. public Action:Command_Red(client, args)
  292. {
  293.     if(cEnable && cPlayerRed)
  294.     {
  295.         if(GetUserFlagBits(client) && PREMIUMFLAG)
  296.         {
  297.             if(pRed[client] == false)
  298.             {
  299.                 SetEntityRenderColor(client, 255, 100, 100, 255);
  300.                 pRed[client] = true;
  301.             }
  302.             else
  303.             {
  304.                 SetClientColor(client, cColor);
  305.                 pRed[client] = false;
  306.             }
  307.             CPrintToChat(client, "%t", "ToggleRed", client);
  308.         }
  309.         else
  310.         {
  311.             CPrintToChat(client, "%s %t", TAG, "NoAccess");
  312.     }
  313.     }
  314.     return Plugin_Handled;
  315. }
  316.  
  317.  
  318. //////////////////////
  319. //PLAYER COLOR: BLUE//
  320. //////////////////////
  321. public Action:Command_Blue(client, args)
  322. {
  323.     if(cEnable && cPlayerBlue)
  324.     {
  325.         if(GetUserFlagBits(client) && PREMIUMFLAG)
  326.         {
  327.             if(pBlue[client] == false)
  328.             {
  329.                 SetEntityRenderColor(client, 100, 100, 255, 255);
  330.                 pBlue[client] = true;
  331.             }
  332.             else
  333.             {
  334.                 SetClientColor(client, cColor);
  335.                 pBlue[client] = false;
  336.             }
  337.             CPrintToChat(client, "%t", "ToggleBlue", client);
  338.         }
  339.         else
  340.         {
  341.             CPrintToChat(client, "%s %t", TAG, "NoAccess");
  342.     }
  343.     }
  344.     return Plugin_Handled;
  345. }
  346.  
  347.  
  348. ///////////////////////
  349. //PLAYER COLOR: GREEN//
  350. ///////////////////////
  351. public Action:Command_Green(client, args)
  352. {
  353.     if(cEnable && cPlayerGreen)
  354.     {
  355.         if(GetUserFlagBits(client) && PREMIUMFLAG)
  356.         {
  357.             if(pGreen[client] == false)
  358.             {
  359.                 SetEntityRenderColor(client, 100, 255, 100, 255);
  360.                 pGreen[client] = true;
  361.             }
  362.             else
  363.             {
  364.                 SetClientColor(client, cColor);
  365.                 pGreen[client] = false;
  366.             }
  367.             CPrintToChat(client, "%t", "ToggleGreen", client);
  368.         }
  369.         else
  370.         {
  371.             CPrintToChat(client, "%s %t", TAG, "NoAccess");
  372.     }
  373.     }
  374.     return Plugin_Handled;
  375. }
  376.  
  377.  
  378. ////////////////////////
  379. //PLAYER COLOR: YELLOW//
  380. ////////////////////////
  381. public Action:Command_Yellow(client, args)
  382. {
  383.     if(cEnable && cPlayerYellow)
  384.     {
  385.         if(GetUserFlagBits(client) && PREMIUMFLAG)
  386.         {
  387.             if(pYellow[client] == false)
  388.             {
  389.                 SetEntityRenderColor(client, 255, 255, 100, 255);
  390.                 pYellow[client] = true;
  391.             }
  392.             else
  393.             {
  394.                 SetClientColor(client, cColor);
  395.                 pYellow[client] = false;
  396.             }
  397.             CPrintToChat(client, "%t", "ToggleYellow", client);
  398.         }
  399.         else
  400.         {
  401.             CPrintToChat(client, "%s %t", TAG, "NoAccess");
  402.     }
  403.     }
  404.     return Plugin_Handled;
  405. }
  406.  
  407.  
  408. ////////////////////////
  409. //PLAYER COLOR: PURPLE//
  410. ////////////////////////
  411. public Action:Command_Purple(client, args)
  412. {
  413.     if(cEnable && cPlayerPurple)
  414.     {
  415.         if(GetUserFlagBits(client) && PREMIUMFLAG)
  416.         {
  417.             if(pPurple[client] == false)
  418.             {
  419.                 SetEntityRenderColor(client, 255, 100, 255, 255);
  420.                 pPurple[client] = true;
  421.             }
  422.             else
  423.             {
  424.                 SetClientColor(client, cColor);
  425.                 pPurple[client] = false;
  426.             }
  427.             CPrintToChat(client, "%t", "TogglePurple", client);
  428.         }
  429.         else
  430.         {
  431.             CPrintToChat(client, "%s %t", TAG, "NoAccess");
  432.     }
  433.     }
  434.     return Plugin_Handled;
  435. }
  436.  
  437.  
  438. ///////////////////////
  439. //PLAYER COLOR: CYAN///
  440. ///////////////////////
  441. public Action:Command_Cyan(client, args)
  442. {
  443.     if(cEnable && cPlayerCyan)
  444.     {
  445.         if(GetUserFlagBits(client) && PREMIUMFLAG)
  446.         {
  447.             if(pCyan[client] == false)
  448.             {
  449.                 SetEntityRenderColor(client, 100, 255, 255, 255);
  450.                 pCyan[client] = true;
  451.             }
  452.             else
  453.             {
  454.                 SetClientColor(client, cColor);
  455.                 pCyan[client] = false;
  456.             }
  457.             CPrintToChat(client, "%t", "ToggleCyan", client);
  458.         }
  459.         else
  460.         {
  461.             CPrintToChat(client, "%s %t", TAG, "NoAccess");
  462.     }
  463.     }
  464.     return Plugin_Handled;
  465. }
  466.  
  467.  
  468. /////////////////////
  469. //INSTANT TEAM SWAP//
  470. /////////////////////
  471. public Action:Command_Swap(client, args)
  472. {
  473.     if(cEnable && cSwap && (GetUserFlagBits(client) & PREMIUMFLAG))
  474.     {
  475.         new team = GetClientTeam(client);
  476.         if(team == 2)
  477.         {
  478.             ChangeClientTeam(client, 3);
  479.             CPrintToChat(client, "%s %t", TAG, "TeamBLU");
  480.         }
  481.         if(team == 3)
  482.         {
  483.             ChangeClientTeam(client, 2);
  484.             CPrintToChat(client, "%s %t", TAG, "TeamRED");
  485.         }
  486.        
  487.     }
  488.     return Plugin_Handled;
  489. }
  490.  
  491.  
  492. /////////////////////////////////
  493. //DONATOR BENEFITS LIST COMMAND//
  494. /////////////////////////////////
  495. public Action:Say(client, args)
  496. {
  497.     if(cEnable && IsValidEntity(client))
  498.     {
  499.         new String:message[192];
  500.         GetCmdArgString(message, sizeof(message));
  501.         StripQuotes(message);
  502.  
  503.         if(StrEqual(message, "!benefits"))
  504.         {
  505.             DisplayPremiumFeatures(client);
  506.         }
  507.     }
  508. }
  509.  
  510.  
  511. ////////////////
  512. //PREMIUM MENU//
  513. ////////////////
  514. DisplayPremiumFeatures(client)
  515. {
  516.     if(IsValidEntity(client))
  517.     {
  518.         new Handle:featurepanel = CreatePanel();
  519.         DrawPanelItem(featurepanel, "Donator Features");
  520.         if(cPlayerBlue)
  521.             DrawPanelText(featurepanel, "Donating gives you the following benefits:");
  522.         if(cGlow)
  523.             DrawPanelText(featurepanel, "- Give yourself a glow!");
  524.         if(cPlayerRed)
  525.             DrawPanelText(featurepanel, "- Access to player color changing");
  526.         if(cInfCloak)
  527.             DrawPanelText(featurepanel, "- Infinite Spy cloak");
  528.         if(cSwap)
  529.             DrawPanelText(featurepanel, "- Change teams instantly");
  530.         if(cUber > 0)
  531.             DrawPanelText(featurepanel, "- Increased ubercharge on spawn");
  532.         if(cClip)
  533.             DrawPanelText(featurepanel, "- Increased clip size (More ammo!)");
  534.         if(cStunballs)
  535.             DrawPanelText(featurepanel, "- More Baseballs for Scouts");
  536.         if(cJarates)
  537.             DrawPanelText(featurepanel, "- More Jarates for Snipers");
  538.         if(cMilks)
  539.             DrawPanelText(featurepanel, "- More Milks for Scouts");
  540.         if(cMetal)
  541.             DrawPanelText(featurepanel, "- More Metal for Engineers");
  542.         if(!(GetUserFlagBits(client) & ADMFLAG_CUSTOM1))
  543.         {
  544.             DrawPanelText(featurepanel, " ");
  545.             DrawPanelItem(featurepanel, "Donate today!");
  546.         }
  547.         DrawPanelText(featurepanel, " ");
  548.         DrawPanelItem(featurepanel, "Exit");
  549.         SendPanelToClient(featurepanel, client, Panel_Features, 60);
  550.         CloseHandle(featurepanel);
  551.     }
  552. }
  553.  
  554.  
  555. //////////////////
  556. //PANEL HANDLERS//
  557. //////////////////
  558. public Panel_Features(Handle:menu, MenuAction:action, param1, param2)
  559. {
  560.     if(param2 == 2)
  561.     {
  562.         CPrintToChat(param1, "%s %t", TAG, "WebAd");
  563.     }
  564.     if(action == MenuAction_End)
  565.     {
  566.         CloseHandle(menu);
  567.     }
  568. }
  569. public Panel_Premium(Handle:menu, MenuAction:action, param1, param2)
  570. {
  571.     if(action == MenuAction_End)
  572.     {
  573.         CloseHandle(menu);
  574.     }
  575. }
  576.  
  577.  
  578. /////////////
  579. //PARTICLES//
  580. /////////////
  581. stock Handle:CreateParticle(String:type[], Float:time, entity, attach=NO_ATTACH, Float:xOffs=0.0, Float:yOffs=0.0, Float:zOffs=0.0)
  582. {
  583.     new particle = CreateEntityByName("info_particle_system");
  584.    
  585.     if (IsValidEdict(particle)) {
  586.         decl Float:pos[3];
  587.         GetEntPropVector(entity, Prop_Send, "m_vecOrigin", pos);
  588.         pos[0] += xOffs;
  589.         pos[1] += yOffs;
  590.         pos[2] += zOffs;
  591.         TeleportEntity(particle, pos, NULL_VECTOR, NULL_VECTOR);
  592.         DispatchKeyValue(particle, "effect_name", type);
  593.  
  594.         if (attach != NO_ATTACH) {
  595.             SetVariantString("!activator");
  596.             AcceptEntityInput(particle, "SetParent", entity, particle, 0);
  597.        
  598.             if (attach == ATTACH_HEAD) {
  599.                 SetVariantString("head");
  600.                 AcceptEntityInput(particle, "SetParentAttachmentMaintainOffset", particle, particle, 0);
  601.             }
  602.         }
  603.         DispatchKeyValue(particle, "targetname", "present");
  604.         DispatchSpawn(particle);
  605.         ActivateEntity(particle);
  606.         AcceptEntityInput(particle, "Start");
  607.         return CreateTimer(time, DeleteParticle, particle);
  608.     } else {
  609.         LogError("(CreateParticle): Could not create info_particle_system");
  610.     }
  611.    
  612.     return INVALID_HANDLE;
  613. }
  614. public Action:DeleteParticle(Handle:timer, any:particle)
  615. {
  616.     if (IsValidEdict(particle)) {
  617.         new String:classname[64];
  618.         GetEdictClassname(particle, classname, sizeof(classname));
  619.        
  620.         if (StrEqual(classname, "info_particle_system", false)) {
  621.             RemoveEdict(particle);
  622.         }
  623.     }
  624. }
  625.  
  626.  
  627. /////////////////
  628. //REFRESH CVARS//
  629. /////////////////
  630. public Action:Command_Refresh(client, args)
  631. {
  632.     if(IsValidEntity(client))
  633.         CPrintToChat(client, "%s Successfully refreshed all cvars.", TAG);
  634.     else
  635.         ReplyToCommand(client, "%s Successfully refreshed all cvars.", TAG);
  636.     ReloadConvars();
  637.     return Plugin_Handled;
  638. }
  639.  
  640.  
  641. //////////
  642. //STOCKS//
  643. //////////
  644. Premium(client)
  645. {
  646.     new TFClassType:pClass = TF2_GetPlayerClass(client);
  647.    
  648.     if(cJarates > 1)
  649.         SetGrenadeAmmo(client, cJarates, 58, 1);
  650.     if(cStunballs > 1)
  651.         SetGrenadeAmmo(client, cStunballs, 44, 2);
  652.     if(cMilks > 1)
  653.         SetGrenadeAmmo(client, cMilks, 222, 1);
  654.     if(pClass == TFClass_Medic)
  655.         SetEntPropFloat(GetPlayerWeaponSlot(client, 1), Prop_Send, "m_flChargeLevel", cUber * 0.01);
  656.     if(pClass != TFClass_Heavy && pClass != TFClass_Medic && pClass != TFClass_Pyro && pClass != TFClass_Sniper)
  657.         SetEntProp(GetPlayerWeaponSlot(client, 0), Prop_Send, "m_iClip1", GetEntProp(GetPlayerWeaponSlot(client, 0), Prop_Send, "m_iClip1") + cClip);
  658.     if(pClass == TFClass_Engineer)
  659.         SetEntData(client, FindDataMapOffs(client, "m_iAmmo") + (3 * 4), cMetal, 4, true);
  660.     if(cColor > 0)
  661.         SetClientColor(client, cColor);
  662.    
  663.    
  664.     CreatePremiumTimers(client);
  665. }
  666.  
  667. ReloadConvars()
  668. {
  669.     cEnable = GetConVarInt(cvar_enable);
  670.     cAdsEnable = GetConVarInt(cvar_ads_enable);
  671.     cAdsInterval = GetConVarFloat(cvar_ads_int);
  672.     cInfCloak = GetConVarInt(cvar_infcloak);
  673.     cColor = GetConVarInt(cvar_color);
  674.     cClip = GetConVarInt(cvar_clip);
  675.     cUber = GetConVarFloat(cvar_uber);
  676.     cStunballs = GetConVarInt(cvar_stunballs);
  677.     cJarates = GetConVarInt(cvar_jarates);
  678.     cMilks = GetConVarInt(cvar_milks);
  679.     cUber = GetConVarFloat(cvar_uber);
  680.     cSwap = GetConVarInt(cvar_swapteams);
  681.     cMetal = GetConVarInt(cvar_metal);
  682.     cPlayerBlack = GetConVarInt(cvar_playerblack);
  683.     cPlayerRed = GetConVarInt(cvar_playerred);
  684.     cPlayerBlue = GetConVarInt(cvar_playerblue);
  685.     cPlayerGreen = GetConVarInt(cvar_playergreen);
  686.     cPlayerYellow = GetConVarInt(cvar_playeryellow);
  687.     cPlayerPurple = GetConVarInt(cvar_playerpurple);
  688.     cPlayerCyan = GetConVarInt(cvar_playercyan);
  689.     cGlow = GetConVarInt(cvar_glow);
  690. }
  691.  
  692. SetGrenadeAmmo(client, ammo, index, slot)
  693. {
  694.     new weapon = GetPlayerWeaponSlot(client, slot);
  695.     if (IsValidEntity(weapon))
  696.     {
  697.         if (GetEntProp(weapon, Prop_Send, "m_iItemDefinitionIndex") == index)
  698.         {    
  699.             new iOffset = GetEntProp(weapon, Prop_Send, "m_iPrimaryAmmoType", 1)*4;
  700.             new iAmmoTable = FindSendPropInfo("CTFPlayer", "m_iAmmo");
  701.             SetEntData(client, iAmmoTable+iOffset, ammo, 4, true);
  702.         }
  703.     }
  704. }
  705.  
  706. SetClientColor(client, color)
  707. {
  708.     switch(color)
  709.     {
  710.         case 0:
  711.             SetEntityRenderColor(client, 255, 255, 255, 255); //DEFAULT
  712.         case 1:
  713.             SetEntityRenderColor(client, 100, 255, 100, 255); //GREEN
  714.         case 2:
  715.             SetEntityRenderColor(client, 255, 100, 100, 255); //RED
  716.         case 3:
  717.             SetEntityRenderColor(client, 100, 100, 255, 255); //BLUE
  718.         case 4:
  719.             SetEntityRenderColor(client, 255, 255, 100, 255); //YELLOW
  720.         case 5:
  721.             SetEntityRenderColor(client, 100, 255, 255, 255); //CYAN
  722.         case 6:
  723.             SetEntityRenderColor(client, 255, 100, 255, 255); //PURPLE
  724.     }
  725. }
  726.  
  727. CreatePremiumTimers(client)
  728. {
  729.     tCloak[client] = CreateTimer(0.1, Timer_Cloak, client);
  730. }
  731.  
  732. CloseAllHandles(client)
  733. {
  734.     tCloak[client] = INVALID_HANDLE;
  735.     tGlow[client] = INVALID_HANDLE;
  736. }
  737.  
  738.  
  739. //////////////
  740. //DISCONNECT//
  741. //////////////
  742. public OnClientDisconnect(client)
  743. {
  744.     CloseAllHandles(client);
  745. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement