Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

Szybka przeróbka pluginu.


  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
4 odpowiedzi w tym temacie

#1 Emcio312

    Początkujący

  • Użytkownik

Reputacja: 0
Nowy

  • Postów:14
  • Imię:Emil
  • Lokalizacja:St-Ce
Offline

Napisano 24.04.2013 06:36

Witam, 

 

mógłby ktoś przerobić ten plugin tak, aby nie dawał on nieskończoności ammunicji, i dodawał po 50 HP i po 25 ARMORA za zabicie?



#define PLUGIN "Last Human AP + Unlimited Clip + Health"  
#define VERSION "1.0"  
#define AUTHOR "GPOWER"  

new g_Players  

// CS Offsets  
#if cellbits == 32  
const OFFSET_CLIPAMMO = 51  
#else  
const OFFSET_CLIPAMMO = 65  
#endif  
const OFFSET_LINUX_WEAPONS = 4  

// Max Clip for weapons  
new const MAXCLIP[] = { -1, 13, -1, 10, 1, 7, -1, 30, 30, 1, 30, 20, 25, 30, 35, 25, 12, 20,  
10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, -1, 50 }  

new g_has_unlimited_clip[33]  
new g_gived[33]  

public plugin_init()  
{  
    register_plugin(PLUGIN, VERSION, AUTHOR)  
     
    register_event("HLTV", "event_round_start", "a", "1=0", "2=0")  
    register_message(get_user_msgid("CurWeapon"), "message_cur_weapon")  
    register_event("DeathMsg", "Event_DeathMsg", "a")  
     
    g_Players = get_maxplayers();  
}  
public Event_DeathMsg()  
{  
    set_task(0.1,"check_alive", 0)  
}  
public event_round_start()  
{  
    for (new id; id <= g_Players; id++)  
    { 
        g_has_unlimited_clip[id] = false;  
        g_gived[id] = false; 
    } 
}  
public message_cur_weapon(msg_id, msg_dest, msg_entity)  
{  
    // Player doesn't have the unlimited clip upgrade  
    if (!g_has_unlimited_clip[msg_entity])  
        return;  
     
    // Player not alive or not an active weapon  
    if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1)  
        return;  
     
    static weapon, clip  
    weapon = get_msg_arg_int(2) // get weapon ID  
    clip = get_msg_arg_int(3) // get weapon clip  
     
    // Unlimited Clip Ammo  
    if (MAXCLIP[weapon] > 2) // skip grenades  
    {  
        set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon]) // HUD should show full clip all the time  
         
        if (clip < 2) // refill when clip is nearly empty  
        {  
            // Get the weapon entity  
            static wname[32], weapon_ent  
            get_weaponname(weapon, wname, sizeof wname - 1)  
            weapon_ent = fm_find_ent_by_owner(-1, wname, msg_entity)  
             
            // Set max clip on weapon  
            fm_set_weapon_ammo(weapon_ent, MAXCLIP[weapon])  
        }  
    }  
}  
// Find entity by its owner (from fakemeta_util)  
stock fm_find_ent_by_owner(entity, const classname[], owner)  
{  
    while ((entity = engfunc(EngFunc_FindEntityByString, entity, "classname", classname)) && pev(entity, pev_owner) != owner) {}  
     
    return entity;  
}  

// Set Weapon Clip Ammo  
stock fm_set_weapon_ammo(entity, amount)  
{  
    set_pdata_int(entity, OFFSET_CLIPAMMO, amount, OFFSET_LINUX_WEAPONS);  
}  
public check_alive()  
{  
    if(fnGetAliveCt() == 1)  
    {  
        for( new i = 1; i <= g_Players; i++ )   
        {   
            if (is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_CT && !g_gived[i])   
            {  
                set_user_health(i, get_user_health(i) + 150)  
                cs_set_user_armor( i, get_user_armor(i) + 150 , CS_ARMOR_KEVLAR)  
                g_has_unlimited_clip[i] = true  
                g_gived[i] = true 
            }  
        }   
    }  
}  
fnGetAliveCt()  
{  
    static iAlive, id  
    iAlive = 0  
     
    for (id = 1; id <= g_Players; id++)  
    {  
        if (is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_CT)  
            iAlive++  
    }  
    return iAlive;  
}  

Z góry dziękuje. ;]

 

 


  • +
  • -
  • 0

#2 Kawon

    Godlike

  • Przyjaciel

Reputacja: 887
Czempion

  • Postów:5 165
  • Steam:steam
  • Imię:Paweł
  • Lokalizacja:Dzierzgoń
Offline

Napisano 24.04.2013 11:15

Automatyczna wiadomość


Ten temat został przeniesiony z forum

AMX Mod X > Pytania dotyczące pluginów

do

Scripting AMXX > Pluginy
  • +
  • -
  • 0

DarkGL to mój autorytet.


#3 Emcio312

    Początkujący

  • Autor tematu
  • Użytkownik

Reputacja: 0
Nowy

  • Postów:14
  • Imię:Emil
  • Lokalizacja:St-Ce
Offline

Napisano 25.04.2013 15:24

Odświeżam, byłby ktoś tak miły i mi pomógł ;]?


  • +
  • -
  • 0

#4 Emcio312

    Początkujący

  • Autor tematu
  • Użytkownik

Reputacja: 0
Nowy

  • Postów:14
  • Imię:Emil
  • Lokalizacja:St-Ce
Offline

Napisano 27.04.2013 15:45

Odświeżam...  :(


  • +
  • -
  • 0

#5 Emcio312

    Początkujący

  • Autor tematu
  • Użytkownik

Reputacja: 0
Nowy

  • Postów:14
  • Imię:Emil
  • Lokalizacja:St-Ce
Offline

Napisano 29.04.2013 09:58

Refresh ;f


  • +
  • -
  • 0




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych