Raised This Month: $ Target: $400
 0% 

Request - Christmas Tree


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
eNNkds
Member
Join Date: Sep 2012
Location: Romania
Old 12-07-2020 , 14:54   Request - Christmas Tree
Reply With Quote #1

Hi. I try to extract form Winter All in One plugin only the christmass tree.
Musical Christmas Trees, on every map, located to each team spawns!
https://forums.alliedmods.net/showthread.php?p=2375182

First i have some issues with complier.
Code of error
Quote:
scripting\xmas_tree.sma(45): warning 217: loose indentation
scripting\xmas_tree.sma(58 ): error 017: undefined symbol "set_rendering"
scripting\xmas_tree.sma(134) : warning 203: symbol is never used:"UTIL_CreateChristmasTree"
scripting\xmas_tree.sma(134): warning 203: symbol is never used: "UTIL_FindSpawnPoints"
// 1 Error.
// Could not locate output file compiled\xmas_tree.amx (compile failed).
//
// Compilation Time: 0.2 sec
PHP Code:
#include < amxmodx >
#include < amxmisc >
#include < fakemeta >
#include < hamsandwich >
#include < fun >

#define PLUGIN_VERSION    "1.0.2"
#define AMBIENT_SOUND_LARGERADIUS    8

new i;
//new gCvarEnableTrees;

enum _iRGB
{
    
iRed 0,
    
iGreen,
    
iBlue
};

new const 
szChristmasTreeModels[ ][ ] =
{
    
"models/aio_winter/christmas_tree_1.mdl",
    
"models/aio_winter/christmas_tree_2.mdl"
};

new const 
szChristmasTreeSong[ ] = "aio_winter/merry_christmas.wav";

public 
plugin_init( )
{
    
register_plugin"AIO: Winter Plugin"PLUGIN_VERSION"tuty" );
    
register_logevent"EVENT_RoundStart"2"1=Round_Start" );
    
    
RegisterHamHam_Spawn"player""bacon_PlayerSpawn");
    
RegisterHamHam_Think"ambient_generic""bacon_TreeThink");
    
    
//gCvarEnableTrees = register_cvar( "aio_winter_tree", "1" );
}

public 
plugin_precache( )
{
    for( 
0sizeof szChristmasTreeModelsi++ )
    {
        
precache_modelszChristmasTreeModels] );
    }
        
precache_soundszChristmasTreeSong );
}

public 
bacon_TreeThinkiEntity )
{
    if( 
pev_validiEntity ) )
    {
        
set_peviEntitypev_nextthinkget_gametime( ) + 0.8 );
        
        new 
Float:flOrigin];
        
peviEntitypev_originflOrigin );

        
UTIL_DynamicLightflOriginrandom256 ), random256 ), random256 ), 255 );
        
set_renderingiEntitykRenderFxGlowShellrandom256 ), random256 ), random256 ), kRenderNormalrandom_num150 ) );
    }
}

UTIL_FindSpawnPoints( )
{
    new 
iCounterTerroristSpawn engfuncEngFunc_FindEntityByStringFM_NULLENT"classname""info_player_start" );

    if( !
iCounterTerroristSpawn )
    {
        return;
    }
    
    new 
Float:flCounterTerroristOrigin];
    
peviCounterTerroristSpawnpev_originflCounterTerroristOrigin );
    
    
UTIL_CreateChristmasTreeflCounterTerroristOrigin );
    
    new 
iTerroristSpawn engfuncEngFunc_FindEntityByStringFM_NULLENT"classname""info_player_deathmatch" );
    
    if( !
iTerroristSpawn )
    {
        return;
    }
    
    new 
Float:flTerroristOrigin];
    
peviTerroristSpawnpev_originflTerroristOrigin );
    
    
UTIL_CreateChristmasTreeflTerroristOrigin );
}

UTIL_CreateChristmasTreeFloat:flOrigin] ) 
{    
    new 
iEntity engfuncEngFunc_CreateNamedEntityengfuncEngFunc_AllocString"ambient_generic" ) );
    
    if( !
pev_validiEntity ) )
    {
        return;
    }

    new 
Float:flAngles];
    
flAngles] += random_float1.0360.0 );

    
set_peviEntitypev_messageszChristmasTreeSong );
    
set_peviEntitypev_spawnflagsAMBIENT_SOUND_LARGERADIUS );
    
set_peviEntitypev_effectsEF_BRIGHTFIELD );
    
set_peviEntitypev_originflOrigin );
    
set_peviEntitypev_movetypeMOVETYPE_TOSS );
    
set_peviEntitypev_health1.0 );
    
set_peviEntitypev_anglesflAngles );
    
set_peviEntitypev_nextthinkget_gametime( ) + 0.8 );
    
    
ExecuteHamHam_SpawniEntity );

    
engfuncEngFunc_SetModeliEntityszChristmasTreeModelsrandom_num0charsmaxszChristmasTreeModels ) ) ] );
    
engfuncEngFunc_DropToFlooriEntity );
}

UTIL_DynamicLightFloat:flOrigin], rgb)
{
    
engfuncEngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYflOrigin );
    
write_byteTE_DLIGHT );
    
engfuncEngFunc_WriteCoordflOrigin] );
    
engfuncEngFunc_WriteCoordflOrigin] );
    
engfuncEngFunc_WriteCoordflOrigin] );
    
write_byte30 );
    
write_byte);
    
write_byte);
    
write_byte);
    
write_byte);
    
write_byte40 );
    
message_end( );

eNNkds is offline
Send a message via Skype™ to eNNkds
Ninja uwu
Member
Join Date: Oct 2020
Old 12-07-2020 , 16:41   Re: Request - Christmas Tree
Reply With Quote #2

find here
https://www.google.com/search?q=arbo...hrome&ie=UTF-8
Ninja uwu is offline
lexzor
Senior Member
Join Date: Nov 2020
Old 12-07-2020 , 17:23   Re: Request - Christmas Tree
Reply With Quote #3

PHP Code:

#include < amxmodx >
#include < amxmisc >
#include < fakemeta >
#include < hamsandwich >
#include < fun >
#include < engine >

#define PLUGIN_VERSION    "1.0.2"
#define AMBIENT_SOUND_LARGERADIUS    8

new i;
//new gCvarEnableTrees;

enum _iRGB
{
    
iRed 0,
    
iGreen,
    
iBlue
};

new const 
szChristmasTreeModels[ ][ ] =
{
    
"models/aio_winter/christmas_tree_1.mdl",
    
"models/aio_winter/christmas_tree_2.mdl"
};

new const 
szChristmasTreeSong[ ] = "aio_winter/merry_christmas.wav";

public 
plugin_init( )
{
    
register_plugin"AIO: Winter Plugin"PLUGIN_VERSION"tuty" );
    
register_logevent"EVENT_RoundStart"2"1=Round_Start" );
    
    
RegisterHamHam_Spawn"player""bacon_PlayerSpawn");
    
RegisterHamHam_Think"ambient_generic""bacon_TreeThink");
    
    
//gCvarEnableTrees = register_cvar( "aio_winter_tree", "1" );
}

public 
plugin_precache( )
{
    for( 
0sizeof szChristmasTreeModelsi++ )
    {
        
precache_modelszChristmasTreeModels] );
    }
        
precache_soundszChristmasTreeSong );
}

public 
bacon_TreeThinkiEntity )
{
    if( 
pev_validiEntity ) )
    {
        
set_peviEntitypev_nextthinkget_gametime( ) + 0.8 );
        
        new 
Float:flOrigin];
        
peviEntitypev_originflOrigin );

        
UTIL_DynamicLightflOriginrandom256 ), random256 ), random256 ), 255 );
        
set_renderingiEntitykRenderFxGlowShellrandom256 ), random256 ), random256 ), kRenderNormalrandom_num150 ) );
    }
}

UTIL_FindSpawnPoints( )
{
    new 
iCounterTerroristSpawn engfuncEngFunc_FindEntityByStringFM_NULLENT"classname""info_player_start" );

    if( !
iCounterTerroristSpawn )
    {
        return;
    }
    
    new 
Float:flCounterTerroristOrigin];
    
peviCounterTerroristSpawnpev_originflCounterTerroristOrigin );
    
    
UTIL_CreateChristmasTreeflCounterTerroristOrigin );
    
    new 
iTerroristSpawn engfuncEngFunc_FindEntityByStringFM_NULLENT"classname""info_player_deathmatch" );
    
    if( !
iTerroristSpawn )
    {
        return;
    }
    
    new 
Float:flTerroristOrigin];
    
peviTerroristSpawnpev_originflTerroristOrigin );
    
    
UTIL_CreateChristmasTreeflTerroristOrigin );
}

UTIL_CreateChristmasTreeFloat:flOrigin] ) 
{    
    new 
iEntity engfuncEngFunc_CreateNamedEntityengfuncEngFunc_AllocString"ambient_generic" ) );
    
    if( !
pev_validiEntity ) )
    {
        return;
    }

    new 
Float:flAngles];
    
flAngles] += random_float1.0360.0 );

    
set_peviEntitypev_messageszChristmasTreeSong );
    
set_peviEntitypev_spawnflagsAMBIENT_SOUND_LARGERADIUS );
    
set_peviEntitypev_effectsEF_BRIGHTFIELD );
    
set_peviEntitypev_originflOrigin );
    
set_peviEntitypev_movetypeMOVETYPE_TOSS );
    
set_peviEntitypev_health1.0 );
    
set_peviEntitypev_anglesflAngles );
    
set_peviEntitypev_nextthinkget_gametime( ) + 0.8 );
    
    
ExecuteHamHam_SpawniEntity );

    
engfuncEngFunc_SetModeliEntityszChristmasTreeModelsrandom_num0charsmaxszChristmasTreeModels ) ) ] );
    
engfuncEngFunc_DropToFlooriEntity );
}

UTIL_DynamicLightFloat:flOrigin], rgb)
{
    
engfuncEngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYflOrigin );
    
write_byteTE_DLIGHT );
    
engfuncEngFunc_WriteCoordflOrigin] );
    
engfuncEngFunc_WriteCoordflOrigin] );
    
engfuncEngFunc_WriteCoordflOrigin] );
    
write_byte30 );
    
write_byte);
    
write_byte);
    
write_byte);
    
write_byte);
    
write_byte40 );
    
message_end( );

lexzor is offline
Reply


Thread Tools
Display Modes

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 10:05.


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