AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Correctly block spawn (https://forums.alliedmods.net/showthread.php?t=127441)

Phant 05-21-2010 07:54

Correctly block spawn
 
How I can correctly block spawn on the map?
Player select Team (CT/T), select Model and spawn on map now, how I can block it? Need to block spawn and move player to "Dead Spectators" (player in selected team, but he dead).

Thanks...

Brreaker 05-21-2010 09:08

Re: Correctly block spawn
 
PHP Code:

public plugin_init() {
    
RegisterHam(Ham_Spawn"player""fwdHamSpawn");
}
public 
fwdHamSpawn(id) {
    
    
user_kill(id,); //so he doesn't get +1 death (thx unny)
    
return HAM_IGNORED;
    



Phant 05-21-2010 09:40

Re: Correctly block spawn
 
Kill — not correctly method.

Brreaker 05-21-2010 09:42

Re: Correctly block spawn
 
You want them dead.How do you want them to get dead without getting killed? :-?

unnyquee 05-21-2010 09:47

Re: Correctly block spawn
 
Returning HAM_SUPERCEDE in Ham_Spawn Pre, but I don't think it is a really good idea :/
..or.. I might be wrong :/

Or you might just register Ham_Spawn in Post and kill (or silent_kill) the client.

wrecked_ 05-21-2010 15:50

Re: Correctly block spawn
 
Quote:

Originally Posted by Brreaker (Post 1186759)
PHP Code:

public plugin_init() {
    
RegisterHam(Ham_Spawn"player""fwdHamSpawn");
}
public 
fwdHamSpawn(id) {
    
    
user_kill(id,); //so he doesn't get +1 death (thx unny)
    
return HAM_IGNORED;
    



You can't kill a user before he's spawned. That forward is registered for before he spawns. If you want to register a post ham hook, make the fourth parameter 1 in the registry.

This topic has been discussed before. Search. (I believe minimiller started it, but there was a very recent one in the past month or so)


All times are GMT -4. The time now is 03:35.

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