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

spawn invisible help pls :)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nicolaus1111
Junior Member
Join Date: May 2008
Location: Santa de mallorca
Old 06-12-2011 , 20:56   spawn invisible help pls :)
Reply With Quote #1

hy guys i have been on a server and they had a plugin really nice,
at the beginning of the round the players were in spawn mode u could practically walk through them, for 10 sec, i think is a pease of code borrowed from war3.
Does anyone have and idee what is the name of that plugin ?, i really like it.

Last edited by nicolaus1111; 06-12-2011 at 21:18.
nicolaus1111 is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 06-12-2011 , 21:10   Re: spawn invisible help pls :)
Reply With Quote #2

It may not be the most efficient way of doing it, but it is the only way I know how without doing a lot of searching:

PHP Code:
#include <amxmodx>
#include <engine>
#include <hamsandwich>
#include <fun>

new gIsInvis[33]

public 
plugin_init() 
{
    
register_plugin("Player invis on spawn""1.0""Jelle")
    
    
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1)
    
    
register_event("DeathMsg""player_death""a""1>0")
}

public 
fwHamPlayerSpawnPost(id)
{
    if ( 
is_user_alive(id) )
    {
        
set_user_rendering(idkRenderFxGlowShell000kRenderTransAlpha255)
        
        
entity_set_int(idEV_INT_solidSOLID_TRIGGER)
        
        
set_task(10.0"stop_invis"id)
        
        
gIsInvis[id] = true
    
}
}

public 
stop_invis(id)
{
    
set_user_rendering(id)
    
    
entity_set_int(idEV_INT_solidSOLID_BBOX)
    
    
gIsInvis[id] = false
}

public 
player_death(id)
{
    if ( 
gIsInvis[id] )
    {
        
set_user_rendering(id)
        
        
entity_set_int(idEV_INT_solidSOLID_BBOX)
    }

Not tested.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-12-2011 , 22:36   Re: spawn invisible help pls :)
Reply With Quote #3

Fixed.

PHP Code:
#include < amxmodx >
#include < fakemeta >
#include < hamsandwich >

new g_bInvis;

#define SetInvis(%1) g_bInvis |= (1<<(%1&31))
#define GetInvis(%1) (g_bInvis & (1<<(%1&31)))
#define RemoveInvis(%1) g_bInvis &= ~(1<<(%1&31))

public plugin_init( )
{
    
register_plugin"Invisible on Spawn""0.0.1""Exolent" );
    
    
register_forwardFM_AddToFullPack"FwdAddToFullPackPost");
    
    
RegisterHamHam_Spawn"player""FwdPlayerSpawnPost");
    
RegisterHamHam_Killed"player""FwdPlayerKilledPost");
}

public 
client_disconnectiPlayer )
{
    
remove_taskiPlayer );
    
    
RemoveInvisiPlayer );
}

public 
FwdAddToFullPackPostesHandleeiEntityiHostiHostFlagsiPlayerpSet )
{
    if( 
iPlayer )
    {
        if( 
iHost != iEntity
        
&&  get_orig_retval( )
        &&  
is_user_aliveiHost )
        &&  
is_user_aliveiEntity )
        &&  
GetInvisiEntity ) )
        {
            
set_esesHandleES_OriginFloat:{ 9999999.0999999.0999999.0 } );
            
            
set_esesHandleES_Effects, ( get_esesHandleES_Effects ) | EF_NODRAW ) );
        }
    }
}

public 
FwdPlayerSpawnPostiPlayer )
{
    if( 
is_user_aliveiPlayer ) )
    {
        
SetInvisiPlayer );
        
        
remove_taskiPlayer );
        
set_task10.0"TaskRemoveInvis"iPlayer );
    }
}

public 
FwdPlayerKilledPostiPlayer )
{
    
remove_taskiPlayer );
    
    
RemoveInvisiPlayer );
}

public 
TaskRemoveInvisiPlayer )
{
    
RemoveInvisiPlayer );

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 06-14-2011 at 11:41.
Exolent[jNr] is offline
nicolaus1111
Junior Member
Join Date: May 2008
Location: Santa de mallorca
Old 06-12-2011 , 22:42   Re: spawn invisible help pls :)
Reply With Quote #4

Thank you very much 4 taking the time to help me, i'm going to test it right now,
im wondering if is gonna have problems on Linux bakhos it has different libraries.
Thanks again.


Ok it has a bag, i have a plugin 4 auto restart after 60 seconds
seens the begginging of the round, when the seconds past and is
time 4 restart the server crashes.

Last edited by nicolaus1111; 06-12-2011 at 23:26.
nicolaus1111 is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 06-13-2011 , 07:08   Re: spawn invisible help pls :)
Reply With Quote #5

Why do you want to remove a task when it is only running once Exolent? It should remove itself, right?

Quote:
Originally Posted by nicolaus1111 View Post
Thank you very much 4 taking the time to help me, i'm going to test it right now,
im wondering if is gonna have problems on Linux bakhos it has different libraries.
Thanks again.


Ok it has a bag, i have a plugin 4 auto restart after 60 seconds
seens the begginging of the round, when the seconds past and is
time 4 restart the server crashes.
What happens if you disable that plugin, and use "sv_restartround 60"? Does it still crash?
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
nicolaus1111
Junior Member
Join Date: May 2008
Location: Santa de mallorca
Old 06-13-2011 , 09:51   Re: spawn invisible help pls :)
Reply With Quote #6

Hello again , so if i disable "Player invis on spawn" the server does not crash anymore
the RR plugin say's " 60 seconds until biological hazard " after dose seconds past a way
and it has to restart it does not restart, is just crushing.
nicolaus1111 is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 06-13-2011 , 11:01   Re: spawn invisible help pls :)
Reply With Quote #7

Quote:
Originally Posted by Jelle View Post
What happens if you disable that plugin, and use "sv_restartround 60"? Does it still crash?
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
nicolaus1111
Junior Member
Join Date: May 2008
Location: Santa de mallorca
Old 06-13-2011 , 11:39   Re: spawn invisible help pls :)
Reply With Quote #8

i have tested the new, disabled the auto RR plugin and is still crushing
it has emptied my server, they were 32 players playing...
nicolaus1111 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-13-2011 , 13:21   Re: spawn invisible help pls :)
Reply With Quote #9

Quote:
Originally Posted by Jelle View Post
Why do you want to remove a task when it is only running once Exolent? It should remove itself, right?
Because if a player dies, then the task will be executed on a dead player, which is unnecessary.
If a player leaves, the task will be executed on an invalid player, throwing an error.
If a player spawns again, then the task will be executed too early from the first before, then the proper one will be too late since the one from last spawn removed invis too early.

set_task() does not override existing tasks with the same id.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 06-13-2011 , 13:25   Re: spawn invisible help pls :)
Reply With Quote #10

Quote:
Originally Posted by Exolent[jNr] View Post
Because if a player dies, then the task will be executed on a dead player, which is unnecessary.
If a player leaves, the task will be executed on an invalid player, throwing an error.
If a player spawns again, then the task will be executed too early from the first before, then the proper one will be too late since the one from last spawn removed invis too early.

set_task() does not override existing tasks with the same id.
Oh. I didn't even think of that. Thanks.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
Old 06-14-2011, 03:52
Shadymn
This message has been deleted by Exolent[jNr]. Reason: Random spam.
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 06:38.


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