Half-Life Icon HL Script

[AMXX][ALL] SuperSlap

Greetings! We are one of the oldest mod sites on the Interwebs. Sign up and maximize your browsing experience.

  • Subscribe: Get notified of new submissions like this.
  • Say Thanks: Show your appreciation by sending Rj. points.
  • Post: Give Rj. your thoughts on this Script.
  • Vote: Help Rj. win the Monthly Awards.
  • Rate: Give this Script a rating out of 10.
  • Flag: Alert moderators and warn members of a problem with this Script.
  • Watch: Get notified when this Script is updated.
Mascot

Join the community!

Become a Bananite

Already a Bananite? Login

80 lines | 2 kb | Raw Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#include <amxmodx>
#include <amxmisc>

new name[32],namet[32],tname[33];
new evoy;
public plugin_init()
{
        register_plugin("SuperSlap","1.3","anakin_cstrike");
        register_concmd("amx_superslap","superslap_cmd",ADMIN_SLAY, "- <target> <power> <interval> <times>");
        evoy = register_cvar("superslap_admin","0");
}
public superslap_cmd(id,level,cid)
{
        if(!cmd_access(id,level,cid,5))
                return PLUGIN_HANDLED;
        if(read_argc() < 4)
        {
                console_print(id,"amx_superslap <target> <power> <interval> <times>");
                return PLUGIN_HANDLED;
        }
        new arg[32],arg2[4],arg3[4],arg4[4];
        read_argv(1,arg,31);
        read_argv(2,arg2,3);
        read_argv(3,arg3,3);
        read_argv(4,arg4,3);
        get_user_name(id,name,31);
       
        new slappower = str_to_num(arg2);
        new times = str_to_num(arg4);
        new Float:interval = str_to_float(arg3);
        new array[2];
        array[1] = slappower;
       
        if(arg[0] == '@')
        {
                new teamname[11],players[32],num,index,i;
                if(arg[1])
                {
                        if(arg[1] == 'T')
                        {
                                copy(teamname,sizeof teamname - 1,"TERRORIST");
                                copy(tname,sizeof tname - 1,"Terrorists");
                        } else if(arg[1] == 'C' && arg[2] == 'T') {
                                copy(teamname,sizeof teamname - 1,"CT");
                                copy(tname,sizeof tname - 1,"Counter-Terrorists");
                        }
                        get_players(players,num,"ae",teamname);
                } else {
                        copy(tname,sizeof tname - 1,"All");
                        get_players(players,num,"a");
                }
                for(i = 0;i < num;i++)
                {
                        index = players[i];
                        if(!is_user_alive(index)) continue;
                        if(index == id && get_pcvar_num(evoy) == 0) continue;
                        array[0] = index;
                        set_task(interval,"superslap",index,array,2,"a",times);
                }
                log_amx("ADMIN %s: SuperSlap %s. Power: %d. Number of Slaps: %d. Interval: %f",name,tname,slappower,times,interval);
        } else {
                new target = cmd_target(id,arg,7);
                if(!target)
                        return PLUGIN_HANDLED;
                array[0] = target;
                get_user_name(target,namet,31);
               
                set_task(interval, "superslap",0,array,2,"a", times);
                log_amx("ADMIN %s: SuperSlap %s. Power: %d. Number of Slaps: %d. Interval: %f",name,namet,slappower,times,interval);
        }
        return PLUGIN_HANDLED;
}
public superslap(array[2])
{
        new target = array[0];
        new powerslap = array[1];
        new alive = is_user_alive(target);
       
        alive ? user_slap(target,powerslap,1) : remove_task(target);
}
Description : This is a much more usefull slap,called superslap.
You can slap a player/team/all player multiple time with an interval of 0.1 second... 99 slaps in 10 seconds. The admin can be skiped from slaping if the cvar (bellow) is disabled/set to 0.

Changelog:
[1.3]
The admin will be skiped from slaping.
- Added cvar for skiping or not the admin.
[1.2]
- Removed multi-lingual.
- Added str_to_float : now you cand slap with interval values smaller than 1.
- Optimizated code.
[1.1] 
Added team option.
- Removed HUD / chat announce cvar.
- Optimizated code.
[1.0]
- First released.

Credits : 
- SAMURAI16 for solving a "tag mismatch" 
- GHW_Chronic for sugestions
- YamiKaitou & Emp` for sugestions
- Alka - helped me to release version 1.2

Cvar :
superslap_admin 1/0 - enable/disable slaping the admin who uses the command (default 0)

Comand : 
amx_superslap <target/ @/@T/@CT> <power> <interval> <times>

EXAMPLES : 
Code:
amx_superslap SAMURAI 0 1 5

-> it will slap SAMURAI 5 times with 0 dmg and an inteval of 1 second
or
Code:
amx_superslap @T 1 1 5

-> slap team T 5 times with 1 dmg and an interval of 1 second
Code:
amx_superslap @ 1 0.1 90

-> slap all players 90 times with 1 dmg and an interval of 0.1 second

Comments

None found

Share

Shareable Image:
Share banner
HTML embed code:
BB embed code:
Markdown embed code:

More embeddable images

Bookmark and Share

Credits

Original Authors
anakin_cstrike
Member Joined 9 years ago

Submitter

Rj. avatar
Rj. IN PLAYGROUND
Homepage
Member Joined 9 months ago
34 medals 4 legendary 8 rare
  • Submitted 15 Tools Medal icon
  • Submitted 50 Gamefiles Medal icon
  • 15+ Entries! GameBanana’s Christmas Giveaway 2016 Medal icon
  • Thanked 500 submitters Medal icon
  • 2nd Place - Game Poetry Contest Medal icon
  • Submitted 5 Tools Medal icon

Rj.
Redistributor
Are you the owner? Request Ownership
Send a Private Message to the submitter

Category

Attributes

Language
Pawn (AMXMODX)

Stats

Posts
0
Views
139
Date Added
29 days ago
Mar 2 2017 @ 1:17am UTC
Date Updated
29 days ago
Mar 2 2017 @ 1:17am UTC