Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

scripting help


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
hello can someone help me please
im trying to make this plugin work with this shop Here
but when i open the shop and buy it it doesn't work
it doesn't give me unlimited clip what am i doing wrong
thanks
PHP Code:

/*================================================================================
    
    -------------------------------------------
    -*- [ZP] Extra Item: Unlimited Clip 1.0 -*-
    -------------------------------------------
    
    ~~~~~~~~~~~~~~~
    - Description -
    ~~~~~~~~~~~~~~~
    
    This item/upgrade gives players unlimited clip ammo for a single round.
    
================================================================================*/

#include <amxmodx>
#include <fakemeta>
#include <bb_ammopacks>

/*================================================================================
 [Plugin Customization]
=================================================================================*/

new const g_item_name[] = { "Unlimited Clip (single round)" }
const 
g_item_cost 10

/*============================================================================*/

// 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[] = { -113, -11017, -1303013020253035251220,
            
10301008303020273030, -150 }

new 
g_itemid_infammog_has_unlimited_clip[33]

public 
plugin_init()
{
    
register_plugin("[ZP] Extra: Unlimited Clip""1.0""MeRcyLeZZ")
    
bb_shop_item_add"Unlimited Clip"302"message_cur_weapon"
    
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
register_message(get_user_msgid("CurWeapon"), "message_cur_weapon")
}

// Player buys our upgrade, set the unlimited ammo flag
public zp_extra_item_selected(playeritemid)
{
    if (
itemid == g_itemid_infammo)
        
g_has_unlimited_clip[player] = true
}

// Reset flags for all players on newround
public event_round_start()
{
    for (new 
idid <= 32id++) g_has_unlimited_clip[id] = false;
}

// Unlimited clip code
public message_cur_weapon(msg_idmsg_destmsg_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 
weaponclip
    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(3get_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
(weaponwnamesizeof wname 1)
            
weapon_ent fm_find_ent_by_owner(-1wnamemsg_entity)
            
            
// Set max clip on weapon
            
fm_set_weapon_ammo(weapon_entMAXCLIP[weapon])
        }
    }
}

// Find entity by its owner (from fakemeta_util)
stock fm_find_ent_by_owner(entity, const classname[], owner)
{
    while ((
entity engfunc(EngFunc_FindEntityByStringentity"classname"classname)) && pev(entitypev_owner) != owner) {}
    
    return 
entity;
}

// Set Weapon Clip Ammo
stock fm_set_weapon_ammo(entityamount)
{
    
set_pdata_int(entityOFFSET_CLIPAMMOamountOFFSET_LINUX_WEAPONS);
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang3082\\ f0\\ fs16 \n\\ par }
*/ 

Przeczytaj cały wpis

Odnośnik do komentarza
Udostępnij na innych stronach

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
 Udostępnij

×
×
  • Dodaj nową pozycję...