AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Blocks don't save in BCM. (https://forums.alliedmods.net/showthread.php?t=110378)

NiQu 11-29-2009 04:11

Blocks don't save in BCM.
 
Hi, im adding new blocks into BCM.. The first block was an XP block that works together with an xp mod plugin. It works fine.

But when i saved the blocks and restart the server or simply reloaded teh blocks the xp block doesnt load :S I think the xp block doesnt even save :/.

Im using BCM 5 by Fatalis(im not switching to blockmaker).

PHP Code:

native hnsxp_get_user_xp(client); 
native hnsxp_set_user_xp(clientxp); 

PHP Code:

new bool:usedXPBLOCK[33]; 

PHP Code:

new const gszBlockModelXP[] = "models/Pwnography_blocks/Normal/moneygiver.mdl"

PHP Code:

new Float:gfXPNextUse[33]; 

PHP Code:

enum
{
    
FSCM_PLATFORM,
    
FSCM_BUNNYHOP,
    
FSCM_DAMAGE,
    
FSCM_HEALER,
    
FSCM_NOFALLDAMAGE,
    
FSCM_ICE,
    
FSCM_TRAMPOLINE,
    
FSCM_SPEEDBOOST,
    
FSCM_DEATH,
    
FSCM_LOWGRAVITY,
    
FSCM_SLAP,
    
FSCM_HONEY,
    
FSCM_BARRIER_CT,
    
FSCM_BARRIER_T,
    
FSCM_GLASS,
    
FSCM_NOSLOWDOWN_BHOP,
    
FSCM_DELAYED_BHOP,
    
FSCM_INVINCIBILITY,
    
FSCM_STEALTH,
    
FSCM_BOOTSOFSPEED,
    
FSCM_AWP,
    
FSCM_HE,
    
FSCM_SMOKE,
    
FSCM_DEAGLE,
    
FSCM_FLASH
    
FSCM_XPBLOCK
}; 

PHP Code:

new const gszBlockNames[gBlockMax][32] =
{
    
"Platform",
    
"Bunnyhop",
    
"Damage",
    
"Healer",
    
"No Fall Damage",
    
"Ice",
    
"Trampoline",
    
"Speed Boost",
    
"Death",
    
"Low Gravity",
    
"Slap",
    
"Honey",
    
"CT Barrier",
    
"T Barrier",
    
"Glass",
    
"No Slow Down Bhop",
    
"Delayed Bhop",
    
"Invincibility",
    
"Stealth",
    
"Boots Of Speed",
    
"Awp",
    
"He",
    
"Smoke",
    
"Deagle",
    
"Flash",
    
"XP Block"
};

new const 
gszProperty1Name[gBlockMax][] =
{
    
"",
    
"No Fall Damage",
    
"Damage Per Interval",
    
"Health Per Interval",
    
"",
    
"",
    
"Upward Speed",
    
"Forward Speed",
    
"",
    
"Gravity",
    
"",
    
"Speed In Honey",
    
"",
    
"",
    
"",
    
"No Fall Damage",
    
" Before Dissapear",
    
"Invincibility Time",
    
"Stealth Time",
    
"Boots Of Speed Time",
    
"",
    
"",
    
"",
    
"",
    
"",
    
""
};

new const 
gszProperty1Default[gBlockMax][] =
{
    
"",
    
"0",
    
"5",
    
"1",
    
"",
    
"",
    
"500",
    
"1000",
    
"",
    
"200",
    
"",
    
"50",
    
"",
    
"",
    
"",
    
"0",
    
"1",
    
"10",
    
"10",
    
"10",
    
"",
    
"",
    
"",
    
"",
    
"",
    
""
};

new const 
gszProperty2Name[gBlockMax][] =
{
    
"",
    
"",
    
"Interval Between Damage",
    
"Interval Between Heals",
    
"",
    
"",
    
"",
    
"Upward Speed",
    
"",
    
"",
    
"",
    
"",
    
"",
    
"",
    
"",
    
"",
    
"",
    
"Delay After Usage",
    
"Delay After Usage",
    
"Delay After Usage",
    
"",
    
"",
    
"",
    
"",
    
"",
    
""
};

new const 
gszProperty2Default[gBlockMax][] =
{
    
"",
    
"",
    
"0.1",
    
"0.1",
    
"",
    
"",
    
"",
    
"200",
    
"",
    
"",
    
"",
    
"",
    
"",
    
"",
    
"",
    
"",
    
"",
    
"60",
    
"60",
    
"60",
    
"",
    
"",
    
"",
    
"",
    
"",
    
""
};

new const 
gszProperty3Name[gBlockMax][] =
{
    
"Transparency",
    
"Transparency",
    
"Transparency",
    
"Transparency",
    
"Transparency",
    
"Transparency",
    
"Transparency",
    
"Transparency",
    
"Transparency",
    
"Transparency",
    
"Transparency",
    
"Transparency",
    
"Transparency",
    
"Transparency",
    
"",
    
"Transparency",
    
"Transparency",
    
"",
    
"",
    
"Speed",
    
"",
    
"",
    
"",
    
"",
    
"",
    
""
};

new const 
gszProperty3Default[gBlockMax][] =
{
    
"",
    
"0",
    
"0",
    
"0",
    
"0",
    
"0",
    
"0",
    
"0",
    
"0",
    
"0",
    
"0",
    
"0",
    
"0",
    
"0",
    
"",
    
"0",
    
"0",
    
"",
    
"",
    
"400",
    
"0",
    
"0",
    
"0",
    
"0",
    
"",
    
""
};

new const 
gszProperty4Name[gBlockMax][] =
{
    
"",
    
"On Top Only",
    
"On Top Only",
    
"On Top Only",
    
"",
    
"",
    
"On Top Only",
    
"On Top Only",
    
"On Top Only",
    
"On Top Only",
    
"",
    
"On Top Only",
    
"On Top Only",
    
"On Top Only",
    
"",
    
"On Top Only",
    
"On Top Only",
    
"On Top Only",
    
"On Top Only",
    
"On Top Only",
    
"",
    
"",
    
"",
    
"",
    
"",
    
""
};

new const 
gszProperty4Default[gBlockMax][] =
{
    
"",
    
"0",
    
"1",
    
"1",
    
"",
    
"",
    
"0",
    
"0",
    
"1",
    
"0",
    
"",
    
"0",
    
"0",
    
"0",
    
"",
    
"0",
    
"0",
    
"1",
    
"1",
    
"1",
    
"",
    
"",
    
"",
    
"",
    
"",
    
""
};

new const 
gBlockSaveIds[gBlockMax] =
{
    
'A',
    
'B',
    
'C',
    
'D',
    
'E',
    
'F',
    
'G',
    
'H',
    
'I',
    
'J',
    
'K',
    
'L',
    
'M',
    
'N',
    
'O',
    
'P',
    
'Q',
    
'R',
    
'S',
    
'T',
    
'U',
    
'V',
    
'W',
    
'X',
    
'Z'
}; 

PHP Code:

gszBlockModels[FSCM_XPBLOCK] = gszBlockModelXP

PHP Code:

stock hnsxp_add_user_xp(clientxp)
{
    return 
hnsxp_set_user_xp(clienthnsxp_get_user_xp(client) + xp);


PHP Code:

public fwd_Touch(entidOverrideTimer)
{
    if ( 
id && id <= gMaxPlayers )
    {
        if ( 
gbAlive[id] )
        {
            if ( 
is_Block(ent) )
            {
                static 
szProperty4[33];
                
Get_BlockProperty(ent4szProperty4);
                
                if ( 
szProperty4[0] == '0' )
                {
                    new 
blockType pev(entpev_body);
                    switch ( 
blockType )
                    {
                        case 
FSCM_BUNNYHOPFSCM_NOSLOWDOWN_BHOPaction_Bhop(ent);
                        case 
FSCM_DAMAGEaction_Damage(ident);
                        case 
FSCM_HEALERaction_Heal(ident);
                        case 
FSCM_TRAMPOLINEaction_Trampoline(ident);
                        case 
FSCM_SPEEDBOOSTaction_SpeedBoost(ident);
                        case 
FSCM_DEATHfakedamage(id"The Block of Death"10000.0DMG_GENERIC);
                        case 
FSCM_LOWGRAVITYaction_LowGravity(ident);
                        case 
FSCM_HONEYaction_Honey(ident);
                        case 
FSCM_BARRIER_CTaction_BarrierCT(ident);
                        case 
FSCM_BARRIER_Taction_BarrierT(ident);
                        case 
FSCM_DELAYED_BHOPaction_DelayedBhop(ent);
                        case 
FSCM_STEALTHaction_Stealth(ident);
                        case 
FSCM_INVINCIBILITYaction_Invincible(ident);
                        case 
FSCM_BOOTSOFSPEEDaction_BootsOfSpeed(ident);
                        case 
FSCM_AWPaction_Awp(idOverrideTimer);
                        case 
FSCM_HEaction_He(idOverrideTimer);
                        case 
FSCM_SMOKEaction_Smoke(idOverrideTimer);
                        case 
FSCM_DEAGLEaction_Deagle(idOverrideTimer);
                        case 
FSCM_FLASHaction_Flash(idOverrideTimer);
                        case 
FSCM_XPBLOCKaction_XPBLOCK(idOverrideTimer);
                    }
                }
            }
        }
    }
    
    return 
PLUGIN_CONTINUE;


PHP Code:

action_XPBLOCK(idOverrideTimer)
{
    new 
Float:fTime halflife_time();
    if (
fTime >= gfXPNextUse[id] || OverrideTimer)
    {
        if(
cs_get_user_team(id) == CS_TEAM_T)
        {
            
hnsxp_add_user_xp(id40);
            
gfXPNextUse[id] = fTime 170;
            
set_hudmessage(gHudRedgHudGreengHudBluegfTextXgfTextYgHudEffectsgfHudFxTimegfHudHoldTimegfHudFadeInTimegfHudFadeOutTimegHudChannel);
            
show_hudmessage(id"YOU EARNED 40 XP!"gfHeNextUse[id] - fTime);
        }
    }


I belive this is all the code i added.

What is wrong? did i forget to add something?

Exolent[jNr] 11-29-2009 10:18

Re: Blocks don't save in BCM.
 
You forgot to add it into the save/load functions.

NiQu 11-29-2009 15:15

Re: Blocks don't save in BCM.
 
I belive i did..

There's nothing needed to be added between
PHP Code:

save_Blocks(id)
{



right?

and in the load i have this already
PHP Code:

case 'Y'create_Block(0FSCM_XPBLOCKvOriginszAxisszSizeszProperty1szProperty2szProperty3szProperty4); 

:S i dont understand what more :s, could u maybe tell me a line number of where that function is ?


All times are GMT -4. The time now is 13:41.

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