Raised This Month: $ Target: $400
 0% 

#Base Builder "lock"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 03-28-2016 , 14:31   #Base Builder "lock"
Reply With Quote #1

Guys , i need the plugin on base builder for lock but when i lock dont colorate, only claim. im sorry for ban english, if you understand, when i lock the block this will be colorate and i dont want colorate, only claim with the object color, and if u help me with plugin for cameleon , when i move an object it will changed color, not only one..
look this video
THIS
here its the plugin, lock but no color and cameleon. if u dont understand what i said cause i have a bad english, just check the video and u will know what i want
PLEASE HELP ME!!
Nutu_ is offline
cStrikeKappa
Junior Member
Join Date: Nov 2015
Old 05-29-2016 , 14:31   Re: #Base Builder "lock"
Reply With Quote #2

That's simple! This is Random Color!

Search this codes:

PHP Code:
public cmdStopEnt(id)
{
    if (!
g_iOwnedEnt[id])
        return 
PLUGIN_HANDLED;
        
    new 
ent g_iOwnedEnt[id]
    
    
ExecuteForward(g_fwDropEnt_Preg_fwDummyResultident);
    
    if (
BlockLocker(ent))
    {
        switch(
g_iLockBlocks)
        {
            case 
0:
            {
                
set_pev(ent,pev_rendermode,kRenderTransColor)
                
set_pev(ent,pev_rendercolorFloat:{ LOCKED_COLOR })
                
set_pev(ent,pev_renderamt,Float:{ LOCKED_RENDERAMT })
            }
            case 
1:
            {
                
set_pev(ent,pev_rendermode,kRenderTransColor)
                
set_pev(ent,pev_rendercolorg_fColor[g_iColor[id]])
                
set_pev(ent,pev_renderamt,Float:{ LOCKED_RENDERAMT })
            }
        }
    }
    else
        
set_pev(ent,pev_rendermode,kRenderNormal)    
    
    
UnsetEntMover(ent);
    
SetLastMover(ent,id);
    
g_iOwnedEnt[id] = 0;
    
UnmovingEnt(ent);
    
    
client_cmd(id"spk %s"GRAB_STOP);
    
    
ExecuteForward(g_fwDropEnt_Postg_fwDummyResultident);
    
    return 
PLUGIN_HANDLED;

Change >

PHP Code:
public cmdStopEnt(id)
{
    if (!
g_iOwnedEnt[id])
        return 
PLUGIN_HANDLED;
        
    new 
ent g_iOwnedEnt[id]
    
    
ExecuteForward(g_fwDropEnt_Preg_fwDummyResultident);
    
    if (
BlockLocker(ent))
    {
        switch(
g_iLockBlocks)
        {
            case 
0:
            {
                
set_pev(ent,pev_rendermode,kRenderTransColor)
                
                new 
Float:x1 random_float(1.0255.0);
                new 
Float:y1 random_float(1.0255.0);
                new 
Float:g1 random_float(1.0255.0);
                
                
set_pev(ent,pev_rendercolory1x1g1)
                
set_pev(ent,pev_renderamt,Float:{ LOCKED_RENDERAMT })
            }
            case 
1:
            {
                
set_pev(ent,pev_rendermode,kRenderTransColor)
                
set_pev(ent,pev_rendercolorg_fColor[g_iColor[id]])
                
set_pev(ent,pev_renderamt,Float:{ LOCKED_RENDERAMT })
            }
        }
    }
    else
        
set_pev(ent,pev_rendermode,kRenderNormal)    
    
    
UnsetEntMover(ent);
    
SetLastMover(ent,id);
    
g_iOwnedEnt[id] = 0;
    
UnmovingEnt(ent);
    
    
client_cmd(id"spk %s"GRAB_STOP);
    
    
ExecuteForward(g_fwDropEnt_Postg_fwDummyResultident);
    
    return 
PLUGIN_HANDLED;

Search this codes:
PHP Code:
public cmdLockBlock(id)
{
    if (!
g_boolCanBuild && g_iLockBlocks)
    {
        
client_print(idprint_center"%L"LANG_SERVER"FAIL_LOCK");
        return 
PLUGIN_HANDLED;
    }
    
    if (!
access(idFLAGS_LOCK) || (g_isZombie[id] && !access(idFLAGS_OVERRIDE)))
        return 
PLUGIN_HANDLED;
        
    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

Change >
PHP Code:
public cmdLockBlock(id)
{
    if (!
g_boolCanBuild && g_iLockBlocks)
    {
        
client_print(idprint_center"%L"LANG_SERVER"FAIL_LOCK");
        return 
PLUGIN_HANDLED;
    }
    
    if (!
access(idFLAGS_LOCK) || (g_isZombie[id] && !access(idFLAGS_OVERRIDE)))
        return 
PLUGIN_HANDLED;
        
    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)
                new 
Float:x1 random_float(1.0255.0);
                new 
Float:y1 random_float(1.0255.0);
                new 
Float:g1 random_float(1.0255.0);
                
                
set_pev(ent,pev_rendercolor,x1,y1,g1)
                
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

Search this codes:

PHP Code:
public native_lock_block(entity)
{
    if (
is_valid_ent(entity) && !is_user_alive(entity) && !BlockLocker(entity))
    {
        
LockBlock(entity33);
        
set_pev(entity,pev_rendermode,kRenderTransColor)
        
set_pev(entity,pev_rendercolor,Float:{LOCKED_COLOR})
        
set_pev(entity,pev_renderamt,Float:{LOCKED_RENDERAMT})
    }

Change >

PHP Code:
public native_lock_block(entity)
{
    if (
is_valid_ent(entity) && !is_user_alive(entity) && !BlockLocker(entity))
    {
        
LockBlock(entity33);
        
set_pev(entity,pev_rendermode,kRenderTransColor)
        new 
Float:x1 random_float(1.0255.0);
        new 
Float:y1 random_float(1.0255.0);
        new 
Float:g1 random_float(1.0255.0);
        
set_pev(entity,pev_rendercolor,x1,y1,g1)
        
set_pev(entity,pev_renderamt,Float:{LOCKED_RENDERAMT})
    }

And now for Admin Flag

Search this codes:

PHP Code:
public fw_PlayerPreThink(id)
{
    if (!
is_user_connected(id))
    {
        
cmdStopEnt(id)
        return 
PLUGIN_HANDLED
    
}
    
    if (
g_isZombie[id])
        
set_pev(idpev_maxspeedg_fPlayerSpeed[id])
    
    if (!
g_iOwnedEnt[id] || !is_valid_ent(g_iOwnedEnt[id]))
        return 
FMRES_HANDLED
        
    
new buttons pev(idpev_button)
    if (
buttons IN_ATTACK)
    {
        
g_fEntDist[id] += OBJECT_PUSHPULLRATE;
        
        if (
g_fEntDist[id] > g_fEntMaxDist)
        {
            
g_fEntDist[id] = g_fEntMaxDist
            client_print
(idprint_center"%L"LANG_SERVER"OBJECT_MAX")
        }
        else
            
client_print(idprint_center"%L"LANG_SERVER"OBJECT_PUSH")
            
        
ExecuteForward(g_fwPushPullg_fwDummyResultidg_iOwnedEnt[id], 1);
    }
    else if (
buttons IN_ATTACK2)
    {
        
g_fEntDist[id] -= OBJECT_PUSHPULLRATE;
            
        if (
g_fEntDist[id] < g_fEntSetDist)
        {
            
g_fEntDist[id] = g_fEntSetDist
            client_print
(idprint_center"%L"LANG_SERVER"OBJECT_MIN")
        }
        else
            
client_print(idprint_center"%L"LANG_SERVER"OBJECT_PULL")
            
        
ExecuteForward(g_fwPushPullg_fwDummyResultidg_iOwnedEnt[id], 2);
    }
    
    new 
iOrigin[3], iLook[3], Float:fOrigin[3], Float:fLook[3], Float:vMoveTo[3], Float:fLength
        
    get_user_origin
(idiOrigin1);
    
IVecFVec(iOriginfOrigin);
    
get_user_origin(idiLook3);
    
IVecFVec(iLookfLook);
        
    
fLength get_distance_f(fLookfOrigin);
    if (
fLength == 0.0fLength 1.0;

    
vMoveTo[0] = (fOrigin[0] + (fLook[0] - fOrigin[0]) * g_fEntDist[id] / fLength) + g_fOffset1[id];
    
vMoveTo[1] = (fOrigin[1] + (fLook[1] - fOrigin[1]) * g_fEntDist[id] / fLength) + g_fOffset2[id];
    
vMoveTo[2] = (fOrigin[2] + (fLook[2] - fOrigin[2]) * g_fEntDist[id] / fLength) + g_fOffset3[id];
    
vMoveTo[2] = float(floatround(vMoveTo[2], floatround_floor));

    
entity_set_origin(g_iOwnedEnt[id], vMoveTo);
    
    return 
FMRES_HANDLED

Change >

PHP Code:
public fw_PlayerPreThink(id)
{
    if (!
is_user_connected(id))
    {
        
cmdStopEnt(id)
        return 
PLUGIN_HANDLED
    
}
    

    
    if (
g_isZombie[id])
        
set_pev(idpev_maxspeedg_fPlayerSpeed[id])
    
    if (!
g_iOwnedEnt[id] || !is_valid_ent(g_iOwnedEnt[id]))
        return 
FMRES_HANDLED
    
if(get_user_flags(id) & ADMIN_LEVEL_B) {    
    new 
random(MAX_COLORS)
    if (
g_iColorMode)
    {
                    while (
g_iColorOwner[i])
                    {
                        
random(MAX_COLORS)
                    }
    }

    
g_iColor[id] = i
    g_iColorOwner
[i] = id

    
if (g_iOwnedEnt[id])
    {
                    
set_pev(g_iOwnedEnt[id],pev_rendercolorg_fColor[g_iColor[id]] )
                    
set_pev(g_iOwnedEnt[id],pev_renderamtg_fRenderAmt[g_iColor[id]] )
    }
    }
        
    new 
buttons pev(idpev_button)
    if (
buttons IN_ATTACK)
    {
        
g_fEntDist[id] += OBJECT_PUSHPULLRATE;
        
        if (
g_fEntDist[id] > g_fEntMaxDist)
        {
            
g_fEntDist[id] = g_fEntMaxDist
            client_print
(idprint_center"%L"LANG_SERVER"OBJECT_MAX")
        }
        else
            
client_print(idprint_center"%L"LANG_SERVER"OBJECT_PUSH")
            
        
ExecuteForward(g_fwPushPullg_fwDummyResultidg_iOwnedEnt[id], 1);
    }
    else if (
buttons IN_ATTACK2)
    {
        
g_fEntDist[id] -= OBJECT_PUSHPULLRATE;
            
        if (
g_fEntDist[id] < g_fEntSetDist)
        {
            
g_fEntDist[id] = g_fEntSetDist
            client_print
(idprint_center"%L"LANG_SERVER"OBJECT_MIN")
        }
        else
            
client_print(idprint_center"%L"LANG_SERVER"OBJECT_PULL")
            
        
ExecuteForward(g_fwPushPullg_fwDummyResultidg_iOwnedEnt[id], 2);
    }
    
    new 
iOrigin[3], iLook[3], Float:fOrigin[3], Float:fLook[3], Float:vMoveTo[3], Float:fLength
        
    get_user_origin
(idiOrigin1);
    
IVecFVec(iOriginfOrigin);
    
get_user_origin(idiLook3);
    
IVecFVec(iLookfLook);
        
    
fLength get_distance_f(fLookfOrigin);
    if (
fLength == 0.0fLength 1.0;

    
vMoveTo[0] = (fOrigin[0] + (fLook[0] - fOrigin[0]) * g_fEntDist[id] / fLength) + g_fOffset1[id];
    
vMoveTo[1] = (fOrigin[1] + (fLook[1] - fOrigin[1]) * g_fEntDist[id] / fLength) + g_fOffset2[id];
    
vMoveTo[2] = (fOrigin[2] + (fLook[2] - fOrigin[2]) * g_fEntDist[id] / fLength) + g_fOffset3[id];
    
vMoveTo[2] = float(floatround(vMoveTo[2], floatround_floor));

    
entity_set_origin(g_iOwnedEnt[id], vMoveTo);
    
    return 
FMRES_HANDLED

Flag is: ADMIN_LEVEL_B

Cvar bb_colormode has to be 0
bb_colormode "0"
__________________

Last edited by cStrikeKappa; 05-29-2016 at 14:41.
cStrikeKappa is offline
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 01-30-2018 , 17:39   Re: #Base Builder "lock"
Reply With Quote #3

yes those work, but it crash the server, when im changing the map, and move one block, it crash the server, i have to restart server, then it works, if map is changed, again, server got crash, any solution?
__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
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 22:53.


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