Guest

Untitled

By: a guest on Jan 28th, 2012  |  syntax: None  |  size: 6.01 KB  |  hits: 22  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. #include <sourcemod>
  2. #include <sdktools>
  3. #include <sdkhooks>
  4. #include <colors>
  5. #include <cssclantags>
  6. #include <smlib>
  7.  
  8. #define NAME "CSS Throwing Knives"
  9. #define VERSION "1.2.2b"
  10. #define KNIFE_MDL "models/weapons/w_knife_ct.mdl"
  11. #define KNIFEHIT_SOUND "weapons/knife/knife_hit3.wav"
  12. #define TRAIL_MDL "materials/sprites/lgtning.vmt"
  13. #define TRAIL_COLOR {177, 177, 177, 117}
  14. #define ADD_OUTPUT "OnUser1 !self:Kill::1.5:1"
  15. #define COUNT_TXT "Il vous reste %i couteaux a lancer"
  16.  
  17. new Handle:g_CVarEnable;
  18. new Handle:g_CVarEnableDev;
  19. new bool:g_bDev;
  20. new Handle:g_hLethalArray;
  21. new Handle:g_CVarVelocity;
  22. new Float:g_fVelocity;
  23. new Handle:g_CVarKnives;
  24. new Handle:g_CVarDamage;
  25. new String:g_sDamage[8];
  26. new Handle:g_CVarHSDamage;
  27. new String:g_sHSDamage[8];
  28. new Handle:g_CVarSteal;
  29. new Handle:g_CVarTrail;
  30. new bool:g_bTrail;
  31. new Handle:g_CVarNoBlock;
  32. new bool:g_bNoBlock;
  33. new Handle:g_CVarDisplay;
  34. new g_iDisplay;
  35. new Handle:g_CVarFF;
  36. new const Float:g_fSpin[3] = {4877.4, 0.0, 0.0};
  37. new const Float:g_fMinS[3] = {-24.0, -24.0, -24.0};
  38. new const Float:g_fMaxS[3] = {24.0, 24.0, 24.0};
  39. new g_iKnives[MAXPLAYERS+1];
  40. new g_iKnifeMI;
  41. new g_iPointHurt;
  42. new g_iEnvBlood;
  43. new g_iTrailMI;
  44. new Handle:g_hKTForward;
  45. new Handle:g_hKHForward;
  46. new Handle:g_hKKForward;
  47.  
  48. #define MAX_RADIUS      50000.0
  49.  
  50. public Plugin:myinfo =
  51. {
  52.         name = "Plugin VIP complet",
  53.         author = "Tom'77",
  54.         description = "Plugin qui donne plusieurs avantages aux VIP",
  55.         version = "1.0",
  56.         url = "http://config-serv-css.tk/vip.rar"
  57. };
  58.  
  59. public OnPluginStart()
  60. {
  61.         HookEvent("player_spawn",Event_PlayerSpawn)
  62.         HookEvent("smokegrenade_detonate",TeleHe);
  63. }
  64.  
  65. public Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
  66. {
  67.         new client = GetClientOfUserId(GetEventInt(event, "userid"));
  68.         if(GetClientTeam(client) > 1 && GetUserFlagBits(client) & ADMFLAG_CUSTOM1)
  69. {
  70.         CreateTimer(2.0,give_cash,any:client);
  71.         PrintToChat(client, "\x04[VIP] \x03Ton accès VIP est activé, tu as bien reçu ta flashbang, ta semtex et ta fumigène jette la et tu seras téléporté là où elle explosera.");
  72.         PrintToChat(client, "\x04[VIP] \x03Tu as aussi reçu un ClanTag VIP, un petit peu de vitesse en plus, 50HP et 100 d'armure.");
  73.         Client_PrintKeyHintText(client, "[VIP by Tom'77]\n\nSemtex, flash et fumi téléport\n50HP et 100 d'armure\nClanTag et 16.000$\n\n=> Tout ça est activé <=");
  74.         GivePlayerItem(client,"weapon_smokegrenade");
  75.         GivePlayerItem(client,"weapon_hegrenade");
  76.         GivePlayerItem(client,"weapon_flashbang");
  77.         new vie = GetClientHealth(client);
  78.         vie += 50;
  79.         SetEntityHealth(client,vie);
  80.         new armor = GetClientArmor(client);
  81.         armor += 100;
  82.         Client_SetArmor(client, armor);
  83.         SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.2);
  84. }
  85. }
  86.  
  87.  
  88. public Action:TeleHe(Handle:event,String:name[], bool:dontBroadcast)
  89. {
  90.         if(GetClientTeam(client) > 1 && GetUserFlagBits(client) & ADMFLAG_CUSTOM1)
  91. {
  92.         new client = GetClientOfUserId(GetEventInt(event, "userid"));
  93.         new Float:vec[3];
  94.         GetClientAbsOrigin(client, vec);      
  95.         vec[0] = GetEventFloat(event, "x");
  96.         vec[1] = GetEventFloat(event, "y");
  97.         vec[2] = GetEventFloat(event, "z");
  98.  
  99.  
  100.         TeleportEntity(client, vec, NULL_VECTOR, NULL_VECTOR);
  101.         PrintToChat(client, "\x04[VIP] \x03Tu as été téléporté !");
  102. }
  103. }
  104.  
  105.  
  106. public Action:give_cash(Handle:timer, any:client)
  107. {
  108.         if(GetClientTeam(client) > 1 && GetUserFlagBits(client) & ADMFLAG_CUSTOM1)
  109. {
  110.         SetEntProp(client, Prop_Send, "m_iAccount", 16000);
  111.         PrintToChat(client, "\x04[VIP] \x03Tu as bien reçu tes 16.000$.");
  112. }
  113.  
  114.  
  115. public OnClientSettingsChanged(client)
  116. {
  117.         if(GetClientTeam(client) > 1 && GetUserFlagBits(client) & ADMFLAG_CUSTOM1)
  118. {
  119.     change_tag(client);
  120. }
  121. public Action:PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
  122. {
  123.     change_tag(GetClientOfUserId(GetEventInt(event, "userid")));
  124. }
  125. public change_tag(client)
  126. {
  127.     if (IsClientInGame(client))
  128.     {
  129.         CS_SetClientClanTag(client, "Vip - ");
  130.     }
  131. }
  132.  
  133.  
  134. public Event_GrenadeBounce(Handle:event, const String:name[], bool:dontBroadcast)
  135. {
  136.  
  137.         new iClient  = GetClientOfUserId(GetEventInt(event, "userid")),
  138.                         iGrenade = GetGrenade(iClient);
  139.         if(!iGrenade)
  140.                 return;
  141.        
  142.         decl String:sClass[32];
  143.         GetEdictClassname(iGrenade, sClass, sizeof(sClass));
  144.        
  145.         if(StrEqual(sClass, "hegrenade_projectile"))
  146.         {
  147.                         StickGrenade(iClient, iGrenade);
  148.                
  149.                         SetEntityMoveType(iGrenade, MOVETYPE_NONE);
  150.         }
  151. }
  152.  
  153.  
  154. GetGrenade(iClient)
  155. {
  156.         decl String:sClass[2][32] = {"flashbang_projectile", "hegrenade_projectile"};
  157.         for(new i = 0, iGrenade = -1; i < sizeof(sClass); i++)
  158.         {
  159.                 while((iGrenade = FindEntityByClassname(iGrenade, sClass[i])) != -1)
  160.                 {
  161.                         if(GetEntPropEnt(iGrenade, Prop_Send, "m_hThrower") == iClient)
  162.                                 return iGrenade;
  163.                 }
  164.         }
  165.         return 0;
  166. }
  167.  
  168. StickGrenade(iClient, iGrenade)
  169. {
  170.  
  171.         decl Float:flClientOrigin[3], Float:flDistance, Float:flOrigin[3];
  172.         GetEntPropVector(iGrenade, Prop_Send, "m_vecOrigin", flOrigin);
  173.        
  174.         new iNear, Float:flMaxRadius = MAX_RADIUS;
  175.         for(new i = 1; i <= MaxClients; i++)
  176.         {
  177.                 if(!IsClientInGame(i) || !IsPlayerAlive(i))
  178.                         continue;
  179.                
  180.                 GetEntPropVector(i, Prop_Send, "m_vecOrigin", flClientOrigin);
  181.                 flDistance = GetVectorDistance(flClientOrigin, flOrigin);
  182.                 if(flDistance <= flMaxRadius)
  183.                 {
  184.                         flMaxRadius = flDistance;
  185.                         iNear       = i;
  186.                 }
  187.         }
  188.         if(!iNear)
  189.                 return;
  190.        
  191.         decl String:sClass[32];
  192.         GetEdictClassname(iGrenade, sClass, sizeof(sClass));
  193.        
  194.         if(StrEqual(sClass, "hegrenade_projectile"))
  195.         {
  196.                 SetEntPropFloat(iGrenade, Prop_Send, "m_DmgRadius", 350.0);
  197.                
  198.                 if(iClient == iNear || iClient != iNear)
  199.                 {
  200.                         SetEntityMoveType(iGrenade, MOVETYPE_NONE);
  201.                        
  202.                         SetVariantString("!activator");
  203.                         AcceptEntityInput(iGrenade, "SetParent", iNear);
  204.                         SetVariantString("idle");
  205.                         AcceptEntityInput(iGrenade, "SetAnimation");
  206.                         SetEntProp(iGrenade, Prop_Data, "m_nSolidType",  0);
  207.                         SetEntPropVector(iGrenade, Prop_Send, "m_angRotation", Float:{0.0, 0.0, 0.0});
  208.                         if(iClient != iNear)    CPrintToChatAll("\x04%N \x03a lancé une Semtex sur \x04%N\x03! Ecartez-vous!",iClient,iNear);
  209.                 }
  210.         }
  211. }