Raised This Month: $51 Target: $400
 12% 

[HELP] [Base Builder] Build Immunity For Players


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ZiZox
Senior Member
Join Date: Sep 2014
Location: Morocco
Old 12-23-2014 , 23:15   [HELP] [Base Builder] Build Immunity For Players
Reply With Quote #1

Hi,
Im Searching This Plugin On [Base-Builder] Mod
By Buying This Item Players Can't Move My Objects.
__________________
ZiZox is offline
Send a message via Skype™ to ZiZox
tousif
AlliedModders Donor
Join Date: Nov 2014
Location: India
Old 12-24-2014 , 01:48   Re: [HELP] [Base Builder] Build Immunity For Players
Reply With Quote #2

Give Sma of shop plugin
tousif is offline
Argon Svng
Member
Join Date: Sep 2014
Old 12-25-2014 , 06:50   Re: [HELP] [Base Builder] Build Immunity For Players
Reply With Quote #3

# Go To Mod BB

Remplace Cet Code on Sma BB

and add cmd on Seystem Ammo

PHP Code:
new bool:g_block[33]

public 
plugin_init()
{
register_clcmd("Cmd_zabzobalat7tifiha",    "cmdLockBlock");
register_event("HLTV""Round_Start""a""1=0""2=0")
...
}

public 
Round_Start(id)
{
  
g_block[id] = false
}

public 
client_disconnect(id)
{
  
g_block[id] = false
}

public 
cmdLockBlock(id)
{
    if (!
g_boolCanBuild && g_iLockBlocks)
    {
        
client_print(idprint_center"%L"LANG_SERVER"FAIL_LOCK");
        return 
PLUGIN_HANDLED;
    }
    
    if (
g_isZombie[id])
        
    if (
g_block[id])
    return 
PLUGIN_HANDLED;
    else
    {
    
g_block[id] = true
    
new entbodypart
    get_user_aiming 
(id,ent,bodypart)
    
    new 
szTarget[7], szClass[10];
    
entity_get_string(entEV_SZ_targetnameszTarget6);
    
entity_get_string(entEV_SZ_classnameszClass9);
    if (!
ent || !is_valid_ent(ent) || is_user_alive(ent) || ent == g_iEntBarrier || !equal(szClass"func_wall") || equal(szTarget"ignore"))
        return 
PLUGIN_HANDLED;
    
    
ExecuteForward(g_fwLockEnt_Preg_fwDummyResultident);
    
    switch (
g_iLockBlocks)
    {
        case 
0:
        {
            if (!
BlockLocker(ent) && !IsMovingEnt(ent))
            {
                
LockBlock(entid);
                
set_pev(ent,pev_rendermode,kRenderTransColor)
                
set_pev(ent,pev_rendercolor,Float:{LOCKED_COLOR})
                
set_pev(ent,pev_renderamt,Float:{LOCKED_RENDERAMT})
                
client_cmd(id"spk %s"LOCK_OBJECT);
            }
            else if (
BlockLocker(ent))
            {
                
UnlockBlock(ent)
                
set_pev(ent,pev_rendermode,kRenderNormal)
                
client_cmd(id"spk %s"LOCK_OBJECT);
            }
        }
        case 
1:
        {
            if (!
BlockLocker(ent) && !IsMovingEnt(ent))
            {
                if (
g_iOwnedEntities[id]<g_iLockMax || !g_iLockMax)
                {
                    
LockBlock(entid)
                    
g_iOwnedEntities[id]++
                    
set_pev(ent,pev_rendermode,kRenderTransColor)
                    
set_pev(ent,pev_rendercolor,g_fColor[g_iColor[id]])
                    
set_pev(ent,pev_renderamt,Float:{LOCKED_RENDERAMT})
                    
                    
client_print(idprint_center"%L [ %d / %d ]"LANG_SERVER"BUILD_CLAIM_NEW"g_iOwnedEntities[id], g_iLockMax)
                    
client_cmd(id"spk %s"LOCK_OBJECT);
                }
                else if (
g_iOwnedEntities[id]>=g_iLockMax)
                {
                    
client_print(idprint_center"%L"LANG_SERVER"BUILD_CLAIM_MAX"g_iLockMax)
                    
client_cmd(id"spk %s"LOCK_FAIL);
                }
            }
            else if (
BlockLocker(ent))
            {
                if (
BlockLocker(ent) == id || access(idFLAGS_OVERRIDE))
                {
                    
g_iOwnedEntities[BlockLocker(ent)]--
                    
set_pev(ent,pev_rendermode,kRenderNormal)
                    
                    
client_print(BlockLocker(ent), print_center"%L [ %d / %d ]"LANG_SERVER"BUILD_CLAIM_LOST"g_iOwnedEntities[BlockLocker(ent)], g_iLockMax)
                    
                    
UnlockBlock(ent)
                    
client_cmd(id"spk %s"LOCK_OBJECT);
                }
                else
                {
                    
client_print(idprint_center"%L"LANG_SERVER"BUILD_CLAIM_FAIL")
                    
client_cmd(id"spk %s"LOCK_FAIL);
                }
            }    
        }
    }

    
ExecuteForward(g_fwLockEnt_Postg_fwDummyResultident);
    }
    return 
PLUGIN_HANDLED

# And Add Set Code

PHP Code:
public plugin_init() {    
    
register_forward(FM_CmdStart"Tag_CmdStart")
    ....
}

public 
Tag_CmdStart(iduc_handleseed){
    
    if(
is_user_alive(id) && g_block[id]){
        
        static 
CurButton
        CurButton 
get_uc(uc_handleUC_Buttons)
        
        if(
CurButton IN_RUN
        { 
            if(
g_block[id]) 
            {
                
cmdLockBlock(id)
                
CurButton &= ~IN_RUN
                set_uc
(uc_handleUC_ButtonsCurButton)
            }
        }                
        
    }
    
    else if(
is_user_alive (id) && !g_block[id])
        return 
PLUGIN_CONTINUE
    
    
return PLUGIN_CONTINUE;

__________________
(Moroccan Coders) # I Love Morocco

Last edited by Argon Svng; 12-25-2014 at 07:01.
Argon Svng is offline
Eagle07
Veteran Member
Join Date: May 2014
Location: Morocco :D
Old 12-25-2014 , 06:52   Re: [HELP] [Base Builder] Build Immunity For Players
Reply With Quote #4

Argon Svng
your code just cmd bb_lock x) and already exist in BB SMA
__________________

Last edited by Eagle07; 12-25-2014 at 06:52.
Eagle07 is offline
Argon Svng
Member
Join Date: Sep 2014
Old 12-25-2014 , 07:03   Re: [HELP] [Base Builder] Build Immunity For Players
Reply With Quote #5

# Eagle07 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
__________________
(Moroccan Coders) # I Love Morocco
Argon Svng is offline
Argon Svng
Member
Join Date: Sep 2014
Old 12-25-2014 , 07:05   Re: [HELP] [Base Builder] Build Immunity For Players
Reply With Quote #6

Im Add Prees Shift To Block Objects.
__________________
(Moroccan Coders) # I Love Morocco
Argon Svng is offline
Eagle07
Veteran Member
Join Date: May 2014
Location: Morocco :D
Old 12-25-2014 , 07:22   Re: [HELP] [Base Builder] Build Immunity For Players
Reply With Quote #7

best way is add code in public cmdGrabEnt(id) and add bool and when client buy build immunity then the bool is on and
automaticly block the entity when you move it
__________________

Last edited by Eagle07; 12-25-2014 at 07:23.
Eagle07 is offline
Argon Svng
Member
Join Date: Sep 2014
Old 12-25-2014 , 07:58   Re: [HELP] [Base Builder] Build Immunity For Players
Reply With Quote #8

# Eagle07
Put Code for clarification
__________________
(Moroccan Coders) # I Love Morocco

Last edited by Argon Svng; 12-25-2014 at 07:58.
Argon Svng is offline
ZiZox
Senior Member
Join Date: Sep 2014
Location: Morocco
Old 12-25-2014 , 08:17   Re: [HELP] [Base Builder] Build Immunity For Players
Reply With Quote #9

Argon Svng
PHP Code:
new bool:g_block[33]

public 
plugin_init()
{
register_clcmd("Cmd_zabzobalat7tifiha",    "cmdLockBlock");
register_event("HLTV""Round_Start""a""1=0""2=0")
...
}

public 
Round_Start(id)
{
  
g_block[id] = false
}

public 
client_disconnect(id)
{
  
g_block[id] = false
}

public 
cmdLockBlock(id)
{
    if (!
g_boolCanBuild && g_iLockBlocks)
    {
        
client_print(idprint_center"%L"LANG_SERVER"FAIL_LOCK");
        return 
PLUGIN_HANDLED;
    }
    
    if (
g_isZombie[id])
        
    if (
g_block[id])
    return 
PLUGIN_HANDLED;
    else
    {
    
g_block[id] = true
    
new entbodypart
    get_user_aiming 
(id,ent,bodypart)
    
    new 
szTarget[7], szClass[10];
    
entity_get_string(entEV_SZ_targetnameszTarget6);
    
entity_get_string(entEV_SZ_classnameszClass9);
    if (!
ent || !is_valid_ent(ent) || is_user_alive(ent) || ent == g_iEntBarrier || !equal(szClass"func_wall") || equal(szTarget"ignore"))
        return 
PLUGIN_HANDLED;
    
    
ExecuteForward(g_fwLockEnt_Preg_fwDummyResultident);
    
    switch (
g_iLockBlocks)
    {
        case 
0:
        {
            if (!
BlockLocker(ent) && !IsMovingEnt(ent))
            {
                
LockBlock(entid);
                
set_pev(ent,pev_rendermode,kRenderTransColor)
                
set_pev(ent,pev_rendercolor,Float:{LOCKED_COLOR})
                
set_pev(ent,pev_renderamt,Float:{LOCKED_RENDERAMT})
                
client_cmd(id"spk %s"LOCK_OBJECT);
            }
            else if (
BlockLocker(ent))
            {
                
UnlockBlock(ent)
                
set_pev(ent,pev_rendermode,kRenderNormal)
                
client_cmd(id"spk %s"LOCK_OBJECT);
            }
        }
        case 
1:
        {
            if (!
BlockLocker(ent) && !IsMovingEnt(ent))
            {
                if (
g_iOwnedEntities[id]<g_iLockMax || !g_iLockMax)
                {
                    
LockBlock(entid)
                    
g_iOwnedEntities[id]++
                    
set_pev(ent,pev_rendermode,kRenderTransColor)
                    
set_pev(ent,pev_rendercolor,g_fColor[g_iColor[id]])
                    
set_pev(ent,pev_renderamt,Float:{LOCKED_RENDERAMT})
                    
                    
client_print(idprint_center"%L [ %d / %d ]"LANG_SERVER"BUILD_CLAIM_NEW"g_iOwnedEntities[id], g_iLockMax)
                    
client_cmd(id"spk %s"LOCK_OBJECT);
                }
                else if (
g_iOwnedEntities[id]>=g_iLockMax)
                {
                    
client_print(idprint_center"%L"LANG_SERVER"BUILD_CLAIM_MAX"g_iLockMax)
                    
client_cmd(id"spk %s"LOCK_FAIL);
                }
            }
            else if (
BlockLocker(ent))
            {
                if (
BlockLocker(ent) == id || access(idFLAGS_OVERRIDE))
                {
                    
g_iOwnedEntities[BlockLocker(ent)]--
                    
set_pev(ent,pev_rendermode,kRenderNormal)
                    
                    
client_print(BlockLocker(ent), print_center"%L [ %d / %d ]"LANG_SERVER"BUILD_CLAIM_LOST"g_iOwnedEntities[BlockLocker(ent)], g_iLockMax)
                    
                    
UnlockBlock(ent)
                    
client_cmd(id"spk %s"LOCK_OBJECT);
                }
                else
                {
                    
client_print(idprint_center"%L"LANG_SERVER"BUILD_CLAIM_FAIL")
                    
client_cmd(id"spk %s"LOCK_FAIL);
                }
            }    
        }
    }

    
ExecuteForward(g_fwLockEnt_Postg_fwDummyResultident);
    }
    return 
PLUGIN_HANDLED

Dude! Thx Man
__________________
ZiZox is offline
Send a message via Skype™ to ZiZox
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:43.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode