Raised This Month: $32 Target: $400
 8% 

respawn/reset lights on the map


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
red_bull2oo6
Senior Member
Join Date: Mar 2012
Location: Braila, Romania
Old 08-30-2015 , 15:18   respawn/reset lights on the map
Reply With Quote #1

Hi, we meet again.

I'm working on a trivia plugin which has a custom map where you can answer the question via buttons.

I made a test map with 2 buttons and 2 lights. Each button turns on a light ( Yes = Blue, Red = No ).
When i choose any of the options ( Yes or No ) , the light comes on and it remains on until round restarts.

There will be no round restarts when the plugin is finished.
All i need is to tell me if there is any way to reset all the lights ( 2 lights for each player ) on the map.
By resetting them i mean turning them of.. just how it happens when round restart is triggered.
I want to know how to set default 'properties' to an entity.

This is my test plugin.
PHP Code:
//* Plugin generated by AMXX-Studio */

    #include < amxmodx >
    //#include < amxmisc >
    //#include < cstrike >
    #include < engine >
    #include < fakemeta >
    #include < hamsandwich >
    
    
    #pragma semicolon 1
    
    
new const
        
PLUGIN_NAME[ ]         = "New Plugin",
        
PLUGIN_VERSION[ ]     = "1.0";
        
    new 
bool:g_bUsed33 ];    

                
public 
plugin_init( )
{
    
register_plugin
    
(
        
PLUGIN_NAME,
        
PLUGIN_VERSION,
        
"Askhanar"
    
);
    
register_clcmd"say /rt""say_RT" );
    
    
RegisterHamHam_Spawn"player""ham_SpawnPlayerPost"true );
    
    if( 
engfunc(EngFunc_FindEntityByString,-,"classname""func_button"))
        
RegisterHamHam_Use"func_button""ham_ButtonUsed" );
    
    
// Add your code here...
}

public 
client_putinserverid )    g_bUsedid ] = false;
public 
client_disconnectid )    g_bUsedid ] = false;

public 
ham_SpawnPlayerPostid )
{
    if( 
is_user_aliveid ) )
    {
        
g_bUsedid ] = false;
    }
    
}

public 
say_RTid )
{
    
client_printidprint_center"RESET!" );
    
g_bUsedid ] = false;
}

public 
ham_ButtonUsedthisidcalleridactivatoruse_typeFloat:value )
{
    if( 
idcaller != idactivator ) return HAM_IGNORED;
    
    
    if( 
g_bUsedidcaller ] )
    {
        
client_printidcallerprint_center"You allready answered!" );
        return 
HAM_SUPERCEDE;
    }
    
    new 
szName32 ];
    
    
entity_get_stringthisEV_SZ_targetszNamesizeofszName ) -);
    if( 
containszName"Yes" ) != -)
        
client_printidcallerprint_center"You answered Yes!" );
    else 
        
client_printidcallerprint_center"You answered NO!" );
        
        
    
g_bUsedidcaller ] = true;
    
    return 
HAM_IGNORED;

This is my test map( how it looks )


LE: Sorry for the thread, just came in my mind to search for spawnflags and found this.
PHP Code:
set_peviEntpev_spawnflags);
        
dllfuncDLLFunc_SpawniEnt ); 
__________________

My PC Themes . .

Last edited by red_bull2oo6; 08-30-2015 at 15:45.
red_bull2oo6 is offline
safetymoose
Senior Member
Join Date: Feb 2015
Old 08-30-2015 , 17:55   Re: respawn/reset lights on the map
Reply With Quote #2

try using call_think(your_button)
safetymoose 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 21:17.


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