Ads keep us online. Without them, we wouldn't exist. We don't have paywalls or sell mods - we never will. But every month we have large bills and running ads is our only way to cover them. Please consider unblocking us. Thank you from GameBanana <3

Call a Medic v0.7

A Config Script for Counter-Strike 1.6

No ads for members. Membership is 100% free. Sign up!
144 4 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define PLUGIN "Call Medic"
#define VERSION "0.7"
#define AUTHOR "Grinf4ce"
#define TAG "[Medic]"

#if cellbits == 32
   #define OFFSET_CSMONEY  115
#else
   #define OFFSET_CSMONEY  140
#endif
#define OFFSET_LINUX      5

new MODE,REG_HEALTH, MAXHEALTH, COSTS,SHOUT, MESSAGE, COOLDOWN
new PlayerReload[33]

public plugin_init() {
        register_plugin(PLUGIN, VERSION, AUTHOR)
        register_cvar("medic_version",VERSION,FCVAR_SERVER);
        set_cvar_string("medic_version",VERSION);
       
        /* Register CVARs */
        MODE = register_cvar("medic_enabled","1")                               /* Mode 1: On ;; Mode 0: Off */
        REG_HEALTH = register_cvar("medic_health","20")                         // How many Health you get instantly?
       
        MAXHEALTH = register_cvar("medic_maxhp","100")                          // Maximal HP for everyone     
        COSTS = register_cvar("medic_costs","2000")                             // How many costs medic?
        SHOUT = register_cvar("medic_shout","1")                                // Shout Medic if you buy medic?
        MESSAGE = register_cvar("medic_message","1")                            // Write a Message if you buy medic?
        COOLDOWN = register_cvar("medic_cooldown","10")                         // Cooldown-Time in Seconds
       
        /* Register Commands */
        register_clcmd("/medic","call_medic",ADMIN_ALL)
        register_clcmd("medic","call_medic",ADMIN_ALL)
        register_clcmd("say /medic","call_medic",ADMIN_ALL)
        register_clcmd("say medic","call_medic",ADMIN_ALL)
        register_clcmd("say_team /medic","call_medic",ADMIN_ALL)
        register_clcmd("say_team medic","call_medic",ADMIN_ALL)
}

public plugin_precache() {
        precache_sound("medic.wav")
}

public client_connect(id) {
        PlayerReload[id] = 0
}

public client_disconnect(id) {
        PlayerReload[id] = 0
}

public call_medic(id) {
        /* Mods and Stuff */
        if(get_pcvar_num(MODE) == 1 && PlayerReload[id] < time())
        {
                new ActuellHP = get_user_health(id);
                new ActuellMoney = fm_cs_get_user_money(id);
               
                if(ActuellMoney < get_pcvar_num(COSTS))
                {
                        client_print(id,print_chat,"%s You haven't enought money to call medic!",TAG)
                }
                else
                {
                        if(ActuellHP < get_pcvar_num(MAXHEALTH))
                        {
                                /* Shout if activated */
                                /* Write message if activated */
                                new playerCount, i, players[32], name[33];
                                get_players(players, playerCount, "ach");
                                get_user_name(id,name,32)
                                       
                                for(i=1; i<=playerCount; i++)
                                {
                                        if(get_user_team(id) == get_user_team(i))
                                        {
                                                if(get_pcvar_num(MESSAGE) == 1)
                                                {
                                                        client_print(i,print_chat,"%s (RADIO): Medic!",name)
                                                       
                                                        if(get_pcvar_num(SHOUT) == 1)
                                                        {
                                                                engfunc(EngFunc_EmitSound, i, CHAN_ITEM, "medic.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
                                                        }
                                                }                                              
                                        }

                                }

                                new Float:Lebenplus = get_pcvar_float(REG_HEALTH);
                               
                                if(ActuellHP + Lebenplus > get_pcvar_num(MAXHEALTH))
                                {
                                        set_pev(id,pev_health,get_pcvar_float(MAXHEALTH))
                                }
                                else
                                {
                                        set_pev(id,pev_health,ActuellHP + Lebenplus);
                                }

                                PlayerReload[id] = time() + get_pcvar_num(COOLDOWN)             /* Activate Reload */
                                fm_cs_set_user_money(id,ActuellMoney-get_pcvar_num(COSTS),1)    /* Pay.. */

                        }
                        else
                        {
                                client_print(id,print_chat,"% You allready have %i Health!",TAG,get_pcvar_num(MAXHEALTH))
                        }
                       
                }
        }
        else
        {
                if(get_pcvar_num(MODE) != 1)
                        client_print(id,print_chat,"%s Call Medic is disabled. Sorry!")
                else
                {
                        new Seconds = PlayerReload[id] - time()
                        client_print(id,print_chat,"%s You recently called medic. Please wait %i seconds..",TAG,Seconds)       
                }
        }
        return PLUGIN_HANDLED;
}

stock fm_cs_set_user_money(id,money,flash=1)
 {
     set_pdata_int(id,OFFSET_CSMONEY,money,OFFSET_LINUX);

     message_begin(MSG_ONE,get_user_msgid("Money"),{0,0,0},id);
     write_long(money);
     write_byte(flash);
     message_end();
 }

 stock fm_cs_get_user_money(id)
 {
     return get_pdata_int(id,OFFSET_CSMONEY,OFFSET_LINUX);
 }
Call Medic for CS
Version 0.7


Hello! This is my 2nd little plugin. I searched in approved plugins, but doesnt found one:

DESCRIPTION:
Call Medic gives you health for money. If you type /medic or medic (in chat, teamchat or console) you will shout "medic" (with sound and radiomessage) which only your team can hear.


FEATURES:
*) Sound (specifed by CVAR)
*) RadioMessage (specifed by CVAR)
*) Cooldowntime (specifed by CVAR)


CVAR's:
medic_enabled <0/1> (Default: 1)
<1> Enable this plugin
<0> Disable this plugin


medic_maxhp <1-X> (Default: 100)
Maximum Health on your server.

medic_health <1-X> (Default: 20)
How many health you get if you shout medic?

medic_costs <1-16000> (Default: 2000)
How many costs medic call?

medic_shout <0/1> (Default: 1)
Shouts "medic" with sound?

medic_message <0/1> (Default: 1)
Write a radio message to team?

medic_cooldown <1-X> (Default: 10)
How long is the cooldowntime for calling "Medic" again?
If you set medic_cooldown to 0, cooldowntime is disabled.


REQUIRES:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>


INSTALLATION:
Put medic.wav in sound.zip in your the "sound" folder of your server.


SERVER RUNNING "Call Medic"
Check it


COMING SOON:
- Version with Cooldown-time. DONE
- Different Medic-shouts.


CHANGELOG:
Version 0.5:
- First release
Version 0.6:
- Fixed Max-Health bug
Version 0.7:
- Added Cooldown for shouting "Medic"!

I tested it on my server without problems. If you have any suggestions or bugs pls report it 
- Grinf4ce
Sign up to access this!

Embed

Share banner
Image URL
HTML embed code
BB embed code
Markdown embed code

Credits

Original Authors
Grinf4ce
Amxx codes author

Submitter

Ghost1495111 avatar
Ghost1495111 Joined 4y ago
inactive
4,038 points Ranked 1747th
41 medals 4 legendary 12 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
Ghost1495111
Redistributor
Are you the owner? Request Ownership
Sign up to access this!
Sign up to access this!
Sign up to access this!

Game

Sign up to access this!

Category

License

Attributes

Language
Pawn

Share

  • Share on Reddit
  • Share on Twitter
  • Share on Facebook
  • 0
  • 1.7k
  • 1
  • 3y

More from Submitter

More AMX/X Scripts Scripts