Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Action:Command_RemoveStickies(iClient, iArgs) {
- new String:sArg[MAX_NAME_LENGTH];
- if (iArgs != 1) {
- PrintToChat(iClient, "Usage: !remove <@aim|@all>");
- return Plugin_Handled;
- }
- GetCmdArg(1, sArg, sizeof(sArg));
- new iSticky = -1;
- new i = 0;
- while ((iSticky = FindEntityByClassname(iSticky, "tf_projectile_pipe_remote")) != -1) {
- new iThrower = GetEntPropEnt(iSticky, Prop_Send, "m_hThrower");
- if (GetClientTeam(iThrower) == GetEnemyTeam(iClient)) {
- if (StrEqual(sArg, "@aim")) {
- new Float:fStickyLocation[3], Float:fAimLocation[3];
- GetEntPropVector(iSticky, Prop_Send, "m_vecOrigin", fStickyLocation);
- GetAimLocation(iClient, fAimLocation);
- if (GetVectorDistance(fStickyLocation, fAimLocation) < 500) {
- AcceptEntityInput(iSticky, "Kill");
- }
- } else if (StrEqual(sArg, "@all")) {
- AcceptEntityInput(iSticky, "Kill");
- }
- i++;
- }
- }
- if (i > 0) {
- PrintToChat(iClient, "\x03[UT] \x01%d Stickies have been removed.", i);
- }
- return Plugin_Handled;
- }
Advertisement
Add Comment
Please, Sign In to add comment