Advertisement
Guest User

Untitled

a guest
Jan 25th, 2014
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.54 KB | None | 0 0
  1.         new iWeapon = GetPlayerWeaponSlot(victim, 1);
  2.         if (iWeapon == -1)
  3.             return Plugin_Continue; //Player doesn't have a weapon in slot 2
  4.         new iItemID = GetEntProp(iWeapon, Prop_Send, "m_iItemDefinitionIndex");
  5.  
  6.         //  20 = Sticky
  7.         //  130 = Scottish
  8.         //  207 = Renamed Sticky or Strange Sticky
  9.         //  265 = Sticky Jumper    
  10.         //  661 = Festive sticky launcher
  11.         if (iItemID == 20 || iItemID == 207 || iItemID == 130 || iItemID == 661)
  12.         {
  13.             new sticky = -1;
  14.             //new iStickyCount = 0;
  15.             while ((sticky = FindEntityByClassname(sticky, "tf_projectile_pipe_remote")) != -1) //loops through all the stickies on the map
  16.             {
  17.                 #define MAX_DEMOMEN_ALLOWED 1
  18.                 #define MAX_STICKIES_PER_DEMO 3
  19.                 new float oldPosition[(MAX_DEMOMAN_ALLOWED * 2) * MAX_STICKIES_PER_DEMO][3]; //store the stickies here. no idea if this line compiles. sourcemod doesn't allow dynamic arrays, so gay
  20.                 new float curPosition[(MAX_DEMOMAN_ALLOWED * 2) * MAX_STICKIES_PER_DEMO][3];
  21.                 new currentSticky = 0;
  22.                
  23.                 //this is a bit more complicated because you need to do cleanup on oldPosition's first parameter, but this is the jist of it
  24.                 GetEntPropVector(entity, Prop_Send, "m_vecOrigin", curPosition[currentSticky]
  25.                 if(oldPosition == curPosition) //the sticky hasn't moved, it's stuck to a wall or something.
  26.                     SDKCall(g_CTFGrenadeDetonate, sticky); // detonate
  27.                
  28.                 GetEntPropVector(entity, Prop_Send, "m_vecOrigin", oldPosition[currentSticky]); //store the location of the current sticky
  29.             }
  30.             //PrintToChatAll("%i stickies found", iStickyCount);
  31.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement