Guest User

Untitled

a guest
Jan 4th, 2014
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. public Action:Command_RemoveStickies(iClient, iArgs) {
  2. new String:sArg[MAX_NAME_LENGTH];
  3.  
  4. if (iArgs != 1) {
  5. PrintToChat(iClient, "Usage: !remove <@aim|@all>");
  6.  
  7. return Plugin_Handled;
  8. }
  9.  
  10. GetCmdArg(1, sArg, sizeof(sArg));
  11.  
  12. new iSticky = -1;
  13. new i = 0;
  14.  
  15. while ((iSticky = FindEntityByClassname(iSticky, "tf_projectile_pipe_remote")) != -1) {
  16. new iThrower = GetEntPropEnt(iSticky, Prop_Send, "m_hThrower");
  17.  
  18. if (GetClientTeam(iThrower) == GetEnemyTeam(iClient)) {
  19. if (StrEqual(sArg, "@aim")) {
  20. new Float:fStickyLocation[3], Float:fAimLocation[3];
  21. GetEntPropVector(iSticky, Prop_Send, "m_vecOrigin", fStickyLocation);
  22. GetAimLocation(iClient, fAimLocation);
  23.  
  24. if (GetVectorDistance(fStickyLocation, fAimLocation) < 500) {
  25. AcceptEntityInput(iSticky, "Kill");
  26. }
  27. } else if (StrEqual(sArg, "@all")) {
  28. AcceptEntityInput(iSticky, "Kill");
  29. }
  30.  
  31. i++;
  32. }
  33. }
  34.  
  35. if (i > 0) {
  36. PrintToChat(iClient, "\x03[UT] \x01%d Stickies have been removed.", i);
  37. }
  38.  
  39. return Plugin_Handled;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment