Nie rozumiem ciebie no lol, pierwsze chciałeś plugin żeby blokował przez czas, potem że blokada, aa rozumiem.
Chodzi ci o skrypt o blokadę c4 w pluginie warmuppro przez dany czas?
Przecież wyraźnie napisał czego chce w pierwszym poście i w tytule tematu.
Przed chwilą zrobiłem to na swoim serwerze i działa tzn. usuwa pakę z ekwipunku i nie da się jej wybrać, ale widać znaczek paki po lewej stronie. Kod wycinany z tego pluginu: http://amxx.pl/topic...okowanie-broni/
Funkcję giveitems(plr) zamień na:
public giveitems(plr)
{
new iFlags = get_item_flags()
new CsTeams:team = fm_get_user_team(plr);
if( g_items )
{
if (iFlags&ITEM_HE)
{
fm_give_item(plr,"weapon_hegrenade")
}
if(iFlags&ITEM_FS)
{
fm_give_item(plr,"weapon_flashbang")
}
if(iFlags&ITEM_SG)
{
fm_give_item(plr,"weapon_smokegrenade")
}
if( team == CS_TEAM_CT && iFlags&ITEM_C4 )
{
fm_give_item(plr, "item_thighpack")
}
if( team == CS_TEAM_T && iFlags&ITEM_C4 )
{
fm_give_item(plr, "weapon_c4")
fm_set_user_plant(plr, 1, 1)
}
if(user_has_weapon(plr, CSW_C4))
{
fm_strip_user_weapon(plr, 5);
}
}
}
A na koniec sma dodaj:
stock fm_strip_user_weapon(id, Type, bool:bSwitchIfActive = true)
{
new iReturn;
if(is_user_alive(id))
{
new iEntity, iWeapon;
while((iWeapon = GetWeaponFromSlot(id, Type, iEntity)) > 0)
{
iReturn = ham_strip_user_weapon(id, iWeapon, Type, bSwitchIfActive);
}
}
return iReturn;
}
stock ham_strip_user_weapon(id, iCswId, iSlot = 0, bool:bSwitchIfActive = true)
{
new iWeapon;
if(!iSlot)
{
static const iWeaponsSlots[] = { -1, 2, -1, 1, 4, 1, 5, 1, 1, 4, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 4, 2, 1, 1, 3, 1 };
iSlot = iWeaponsSlots[iCswId];
}
const XTRA_OFS_PLAYER = 5;
const m_rgpPlayerItems_Slot0 = 367;
iWeapon = get_pdata_cbase(id, m_rgpPlayerItems_Slot0 + iSlot, XTRA_OFS_PLAYER);
const XTRA_OFS_WEAPON = 4;
const m_pNext = 42;
const m_iId = 43;
while(iWeapon > 0)
{
if(get_pdata_int(iWeapon, m_iId, XTRA_OFS_WEAPON) == iCswId) break;
iWeapon = get_pdata_cbase(iWeapon, m_pNext, XTRA_OFS_WEAPON);
}
if(iWeapon > 0)
{
const m_pActiveItem = 373;
if(bSwitchIfActive && get_pdata_cbase(id, m_pActiveItem, XTRA_OFS_PLAYER) == iWeapon)
{
ExecuteHamB(Ham_Weapon_RetireWeapon, iWeapon);
}
if(ExecuteHamB(Ham_RemovePlayerItem, id, iWeapon))
{
user_has_weapon(id, iCswId, 0);
ExecuteHamB(Ham_Item_Kill, iWeapon);
return 1;
}
}
return 0;
}
stock GetWeaponFromSlot(id , iSlot , &iEntity)
{
if (!(1 <= iSlot <= 5)) return 0;
iEntity = 0;
const m_rgpPlayerItems_Slot0 = 367;
const m_iId = 43;
const XO_WEAPONS = 4;
const XO_PLAYER = 5;
iEntity = get_pdata_cbase(id , m_rgpPlayerItems_Slot0 + iSlot , XO_PLAYER);
return (iEntity > 0) ? get_pdata_int(iEntity , m_iId , XO_WEAPONS) : 0;
}