[Cerere] Medi-Shot

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
User avatar
marvel_team
Membru, skill +1
Membru, skill +1
Posts: 119
Joined: 23 Mar 2016, 11:08
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: MARVEL.RANGFORT.RO
SteamID: brick_bazuka001
Fond eXtream: 0
Location: Iasi
Contact:

01 Feb 2019, 19:21

Plugin Cerut: Medi-Shot
Descriere (adica ce face el mai exact): Salut ... s-ar putea face sau exista plugin-ul asta Medi-Shot cum este pe csgo ... iti da un anumit nr de hp ..
Cred ca era aia /medic ... dar sa fie putin optimizata cu cateva mesaje colorate ..
Plus ... sa fie doar pentru VIP flag (bit)
Sa-ti poti da doar 50HP nu 100... maxim 50
Sa-si poata da doar o singura data pe runda
Gen sa functioneze in genul la medi-shot dupa csgo ,injectia...
Serverul ruleaza (HLDS/ReHLDS): rehlds
Versiune AMX Mod X: -
Modul Serverului: -
Last edited by Rainq on 01 Feb 2019, 19:39, edited 1 time in total.
Reason: Editat dupa model
Envato
e931ff07
Membru, skill 0
Membru, skill 0
Posts: 34
Joined: 13 Jan 2019, 02:01
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

21 Feb 2019, 00:12

| Afiseaza codul
.#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define PLUGIN "Medic"
#define VERSION "1.0"
#define AUTHOR "****"
#define TAG "[AlinaPlugaru]"

#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")                         // Cât HP să cumpere
        
        MAXHEALTH = register_cvar("medic_maxhp","100")                          // Maxim hp pentru toți      
        COSTS = register_cvar("medic_costs","2000")                             // Câți bani să coste
        SHOUT = register_cvar("medic_shout","1")                                // La câte secunde poți cumpăra
        MESSAGE = register_cvar("medic_message","1")                            // Mesaj la cumpărat 
        COOLDOWN = register_cvar("medic_cooldown","10")                         // Câte secunde până să cumperi
        
        /* Register Commands */
        register_clcmd("/medic","call_medic",ADMIN_LEVEL_H)
        register_clcmd("medic","call_medic",ADMIN_LEVEL_H)
        register_clcmd("say /medic","call_medic",ADMIN_LEVEL_H)
        register_clcmd("say medic","call_medic",ADMIN_LEVEL_H)
        register_clcmd("say_team /medic","call_medic",ADMIN_LEVEL_H)
        register_clcmd("say_team medic","call_medic",ADMIN_LEVEL_H)
}

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);
 }
marvel_team wrote:Plugin Cerut: Medi-Shot
Descriere (adica ce face el mai exact): Salut ... s-ar putea face sau exista plugin-ul asta Medi-Shot cum este pe csgo ... iti da un anumit nr de hp ..
Cred ca era aia /medic ... dar sa fie putin optimizata cu cateva mesaje colorate ..
Plus ... sa fie doar pentru VIP flag (bit)
Sa-ti poti da doar 50HP nu 100... maxim 50
Sa-si poata da doar o singura data pe runda
Gen sa functioneze in genul la medi-shot dupa csgo ,injectia...
Serverul ruleaza (HLDS/ReHLDS): rehlds
Versiune AMX Mod X: -
Modul Serverului: -
Post Reply

Return to “Cereri”

  • Information