DOD Spawn Forward (Module Fix)
by Wilson [29th ID] · 2008-03-23 · 16 replies · 13024 views · 89 downloads
From the first post
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.
The thread
All 17 posts from 7 people on DOD Spawn Forward (Module Fix), kept as they were written.
Threads: 57
Joined: Oct 2005
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.
Threads: 12
Joined: Aug 2006
hell ill give it a go ill post back if any problems sounds good to me
Threads: 75
Joined: Jun 2006
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!
Threads: 103
Joined: May 2005
ohh wait so 3679 has the fix already? cause the build number hasnt changed for like months now
Threads: 57
Joined: Oct 2005
gah! why you no tell me before!
Threads: 23
Joined: Aug 2007
Was this a windows server only problem?nIt looks like they were the only files fixed.
Threads: 75
Joined: Nov 2007
@ meathead rnrnI belive the linux module is fixed too http://www.amxmodx.org/autobuilds/1.8.1-3679/linux-i386/
Threads: 75
Joined: Jun 2006
Well the last build was:nn
1.8.1-3679/ 08-Jan-2008 01:00nnAnd I updated the files:nnModified 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 MessagennSo it should be in there.nnCheers!Threads: 54
Joined: May 2005
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}rnThreads: 75
Joined: Jun 2006
Ok, have been looking at this hopefully I have it now...just going to compile it on linux and see what happens...
Threads: 103
Joined: May 2005
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:npublic 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:npublic 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 fineThreads: 103
Joined: May 2005
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
Threads: 103
Joined: May 2005
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)nnnthen add this and do whatever you want here... client_print obviously is just for testing...npublic 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}nnnthe 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)Threads: 75
Joined: Nov 2007
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!
Threads: 103
Joined: May 2005
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
Threads: 103
Joined: May 2005
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...

