AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Hook players spawn (Half-Life) (https://forums.alliedmods.net/showthread.php?t=141075)

Flipper_SPb 10-19-2010 08:43

Hook players spawn (Half-Life)
 
Please, help. I find a good way to cath the player spawn.
And I don't want to use Hamsandwich.

SaM.ThE.MaN 10-19-2010 08:46

Re: Hook players spawn (Half-Life)
 
Well Hamsandwich is a really nice way to do it ... ,

Arkshine 10-19-2010 08:47

Re: Hook players spawn (Half-Life)
 
I don't want to use Hamsandwich

Please explain why ?

Flipper_SPb 10-19-2010 08:55

Re: Hook players spawn (Half-Life)
 
I use it now. But my plugin was made for AG (Half-Life Adrenaline Gamer Mod). Most of AG servers running with amxx, but Hamsandwich doesn't work with AG without hamdata.ini edit. The pugin is very simple. And I want to make installation easier.

Arkshine 10-19-2010 09:02

Re: Hook players spawn (Half-Life)
 
If you can't use Ham, you sill can use Orpheu, just need to add the game and it should work. Hooking CBasePlayer::Spawn() (what does Ham and what can do orpheu) is the best way to hook at player spawn.

Flipper_SPb 10-19-2010 09:07

Re: Hook players spawn (Half-Life)
 
Hm. I can use Hamsandwich. But server owner need to edit hamdata.ini to make it work.
Orpheu - it is more difficult.
Is there another way? With fakemeta or ResetHUD event.

Flipper_SPb 10-19-2010 09:13

Re: Hook players spawn (Half-Life)
 
Is that correct?

PHP Code:

public plugin_init()
{
    
register_clcmd"fullupdate""fullupdate_block" )
    
register_event("ResetHUD""player_spawn""be")
 }

 
public 
player_spawn(id)
{
    
    
//.......
    
}


public 
fullupdate_block(id)
    return 
PLUGIN_HANDLED_MAIN 


dFF 10-19-2010 09:23

Re: Hook players spawn (Half-Life)
 
Try to use a task:

PHP Code:

register_event"ResetHUD""player_spawn_pre""be" )
 
public 
player_spawn_pre(id)
{
    
set_task0.8"player_spawn_post"id )
}

public 
player_spawn_post(id)
{
    
client_printid3"Spawn!!" )




Hellrock 10-19-2010 09:29

Re: Hook players spawn (Half-Life)
 
1 Attachment(s)
[EN]
In attached file u can find hamdata for AG, miniAG, OP4!

[RU]
В прикреплёном файле найдешь hamdata для AG, miniAG, OP4!

Flipper_SPb 10-19-2010 09:48

Re: Hook players spawn (Half-Life)
 
Quote:

Originally Posted by Hellrock (Post 1329313)
[EN]
In attached file u can find hamdata for AG, miniAG, OP4!

[RU]
В прикреплёном файле найдешь hamdata для AG, miniAG, OP4!

Thanks. But I can just replace @section valve windows with @section ag windows in hamdata.ini :) It's not a problem.


All times are GMT -4. The time now is 10:26.

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