Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new iWeapon = GetPlayerWeaponSlot(victim, 1);
- if (iWeapon == -1)
- return Plugin_Continue; //Player doesn't have a weapon in slot 2
- new iItemID = GetEntProp(iWeapon, Prop_Send, "m_iItemDefinitionIndex");
- // 20 = Sticky
- // 130 = Scottish
- // 207 = Renamed Sticky or Strange Sticky
- // 265 = Sticky Jumper
- // 661 = Festive sticky launcher
- if (iItemID == 20 || iItemID == 207 || iItemID == 130 || iItemID == 661)
- {
- new sticky = -1;
- //new iStickyCount = 0;
- while ((sticky = FindEntityByClassname(sticky, "tf_projectile_pipe_remote")) != -1) //loops through all the stickies on the map
- {
- #define MAX_DEMOMEN_ALLOWED 1
- #define MAX_STICKIES_PER_DEMO 3
- 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
- new float curPosition[(MAX_DEMOMAN_ALLOWED * 2) * MAX_STICKIES_PER_DEMO][3];
- new currentSticky = 0;
- //this is a bit more complicated because you need to do cleanup on oldPosition's first parameter, but this is the jist of it
- GetEntPropVector(entity, Prop_Send, "m_vecOrigin", curPosition[currentSticky]
- if(oldPosition == curPosition) //the sticky hasn't moved, it's stuck to a wall or something.
- SDKCall(g_CTFGrenadeDetonate, sticky); // detonate
- GetEntPropVector(entity, Prop_Send, "m_vecOrigin", oldPosition[currentSticky]); //store the location of the current sticky
- }
- //PrintToChatAll("%i stickies found", iStickyCount);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement