Day of Defeat Plugins Community
This site is an archive — everything is readable and downloadable, nothing can be posted. Admin

DOD Spawn Forward (Module Fix)

by Wilson [29th ID] · 2008-03-23 · 16 replies · 13024 views · 89 downloads

Read the thread (17 posts)

From the first post

The current DoDx module uses the native dod_client_spawn to hook player spawns. However, this does not get called when the round restarts due to a flag cap-out. It also does not get called on simple plugin-based respawns.
rn
rnUntil the module is fixed, I have written a forward to replace it that gets called every time a player spawns no matter the circumstances. To give proper credit, Zor actually found the hook method but hasn't had time to release the fix yet.
rn
rnThis forward is dod_player_spawn (notice the different word so they do not conflict), and will be called whenever a player spawns, including after a round restart/cap-out.
rn
rnTo use this, simply edit all your plugins that are affected and replace dod_client_spawn with dod_player_spawn. Make sure this plugin is listed in your plugins.ini and that's all you'll need to do. No linking, no nothing.
rn
rnEnjoy.

Files

dod_spawn_fwd.sma v1.0 1 KB 89 dl Download Compile

The thread

All 17 posts from 7 people on DOD Spawn Forward (Module Fix), kept as they were written.

Wilson [29th ID]
started this thread
Posts: 623
Threads: 57
Joined: Oct 2005
03-23-2008, 05:14 PM #1

The current DoDx module uses the native dod_client_spawn to hook player spawns. However, this does not get called when the round restarts due to a flag cap-out. It also does not get called on simple plugin-based respawns.rnrnUntil the module is fixed, I have written a forward to replace it that gets called every time a player spawns no matter the circumstances. To give proper credit, Zor actually found the hook method but hasn't had time to release the fix yet.rnrnThis forward is dod_player_spawn (notice the different word so they do not conflict), and will be called whenever a player spawns, including after a round restart/cap-out.rnrnTo use this, simply edit all your plugins that are affected and replace dod_client_spawn with dod_player_spawn. Make sure this plugin is listed in your plugins.ini and that's all you'll need to do. No linking, no nothing.rnrnEnjoy.

{DwP} 325th ABN
posted here
Posts: 231
Threads: 12
Joined: Aug 2006
03-23-2008, 06:20 PM #2

hell ill give it a go ill post back if any problems sounds good to me

Zor
posted here
Posts: 688
Threads: 75
Joined: Jun 2006
03-23-2008, 09:46 PM #3

The newest module fixes this problem...however, you have to get it and use it instead of the current version of amxmodx.nnCheers!nnhttp://www.amxmodx.org/autobuildsnnI have uploaded the fixed version using pstatus as willson did here. If you don't want to use the sma forward, you can use the new version of the DoDx.nnCheers!

diamond-optic
posted here
Posts: 2,068
Threads: 103
Joined: May 2005
03-23-2008, 10:53 PM #4

ohh wait so 3679 has the fix already? cause the build number hasnt changed for like months now

Wilson [29th ID]
started this thread
Posts: 623
Threads: 57
Joined: Oct 2005
03-24-2008, 01:18 AM #5

gah! why you no tell me before!

meathead
posted here
Posts: 337
Threads: 23
Joined: Aug 2007
03-24-2008, 07:57 AM #6

Was this a windows server only problem?nIt looks like they were the only files fixed.

Dr.G
posted here
Posts: 776
Threads: 75
Joined: Nov 2007
03-24-2008, 09:40 AM #7

@ meathead rnrnI belive the linux module is fixed too http://www.amxmodx.org/autobuilds/1.8.1-3679/linux-i386/

Zor
posted here
Posts: 688
Threads: 75
Joined: Jun 2006
03-24-2008, 11:16 AM #8

Well the last build was:nn

1.8.1-3679/ 08-Jan-2008 01:00
nnAnd I updated the files:nn
Modified Fri Dec 28 19:13:24 2007 UTC (2 months, 3 weeks ago) by zornFile length: 13339 byte(s)nDiff to previous 3538nnRemoved the olddeadflag from CPlayer and moved the spawn forward intonthe PStatus Client Message
nnSo it should be in there.nnCheers!

=|[76AD]|= TatsuSaisei
posted here
Posts: 794
Threads: 54
Joined: May 2005
05-19-2008, 08:19 PM #9

neither work properly !!! And here is why...rn rndropobject rn rnWhen a user drops an "object" (primarily tnt or satchel) a "spawn" is falsely triggered !!!rn rnupon further "research" of the PStatus method... additional criteria is needed ... as status == 0 is applicable to a "spawn" as well as "dropobject" (this ALSO includes the "usage" of an object)rn rn

 rnpublic msg_PStatus(msgid,msgdest,id)rn{rn new player = get_msg_arg_int(1);rn new status = get_msg_arg_int(2);rn    rn if(is_user_connected(player) && status == 0 [B][COLOR=red]&& msgdest == 2 && !id[/COLOR][/B]) set_task(Float:0.2,"spawn_forward",player);rn}rn
Zor
posted here
Posts: 688
Threads: 75
Joined: Jun 2006
05-19-2008, 09:31 PM #10

Ok, have been looking at this hopefully I have it now...just going to compile it on linux and see what happens...

diamond-optic
posted here
Posts: 2,068
Threads: 103
Joined: May 2005
01-27-2009, 10:12 PM #11

just figured id post how to hook player spawn with hamsandwich since ive seen it not being used correctlynnregister it in plugin_init:n

RegisterHam(Ham_Spawn,"player","func_HamSpawn")
then add this function:n
public func_HamSpawn(id)n    if(is_user_connected(id) && get_user_team(id))n        set_task(Float:0.1,"player_spawn",id)
then use this function to do whatever you want:n
public player_spawn(id)n{n    if(is_user_alive(id)n        client_print(id,print_chat,"SPAWNED!")nnn//etc etc etc etcnn}
if you dont check to see if the player is a on team in the func_HamSpawn then it will also be called when a player connects to the server... idk if theres a diff way to detect just the actual spawning and not when a player connects without checking the team.. but it worksnnalso, you could *try* doing stuff right in the func_HamSpawn function, but in some basic testing i found the player wasnt 'alive' and most things didnt work right.. but the 0.1 second task works fine

Dr.G
posted here
Posts: 776
Threads: 75
Joined: Nov 2007
01-27-2009, 10:41 PM #12

Nice! Thanks

diamond-optic
posted here
Posts: 2,068
Threads: 103
Joined: May 2005
01-27-2009, 10:43 PM #13

yeah i think its a bit more simple and a little easier to understand then wilson & tatsu's PStatus method that I have been using for a while now..nnplus HamSandwich is great lol and im starting to use it more and more as i figure more out about it

diamond-optic
posted here
Posts: 2,068
Threads: 103
Joined: May 2005
01-27-2009, 10:54 PM #14

ok my mistake, i forgot to try it in post... as doing so, the player is alive.. so forget about what i posted above.. lets do this again lol..nnregister it in plugin_init:n

nRegisterHam(Ham_Spawn,"player","func_HamSpawn",1)n
nnthen add this and do whatever you want here... client_print obviously is just for testing...n
public func_HamSpawn(id)n{n    if(is_user_alive(id) && is_user_connected(id) && get_user_team(id))n        {n        client_print(0,print_chat,"SPAWN TEST")nn        //etc etc etcn        }n}n
nnthe get_user_team check is still needed as it still is called when a player joins the server (tho i tested it only with bots, so maybe its just the creation of a bot.. but either way since alot of servers have bots on them at one point or another, i think its best to leave it in even if that is the case)

Dr.G
posted here
Posts: 776
Threads: 75
Joined: Nov 2007
01-28-2009, 09:12 AM #15

lol...i dont get why that get_user_team have to be there, especially not since its returns the team id... but wth if u say it have to be there its good enough to me :) An yes this is way more simple and understandable then Pstatus thing, again gj!

diamond-optic
posted here
Posts: 2,068
Threads: 103
Joined: May 2005
01-28-2009, 01:11 PM #16

you know what.. you make a good point.. im late for work so cant bother with it now..nnbut it actually probably isnt needed lol.. but anyway the reason i put it there tho was cause when a player connects their team is 0 so it wont go past that check.. where as if they actually spawn while on a team it has a value and it passes thru it..nnbut now that i think about it, the is_user_alive should cover that anyway lol..nni really fucked this up hahah

diamond-optic
posted here
Posts: 2,068
Threads: 103
Joined: May 2005
01-28-2009, 03:21 PM #17

ok i just tried it out...nnwithout checking get_user_team it is still called on connection.. for some reason they are marked as being alive even when they havent joined a team...

DoD Plugins Archive · Repository · Old Forum Threads · Maps · Admin · built 14 Sep 2026 00:34 UTC