Restarting a round
by Vet · 2008-12-29 · 7 replies · 3613 views · 12 downloads
From the first post
The thread
All 8 posts from 2 people on Restarting a round, kept as they were written.
Threads: 24
Joined: Oct 2006
Is there already a plugin available to restart a round? Like if you're playing along, and just decide you want to restart the current round. Any time I do a search on restart and/or round, I get 500 hits and I don't want to wade through all that.
Threads: 75
Joined: Nov 2007
yea there are already one https://www.dodplugins.net/forums/showthread.php?t=38 I used it for like 1 year ago and it worked fine
Threads: 24
Joined: Oct 2006
Ah, thanks. I wrote one too, but didn't want to post it if another one does the same thing.
Threads: 75
Joined: Nov 2007
Its in the old/disconnected section... post the one u made, i cant see why not to...
Threads: 24
Joined: Oct 2006
Here's the one I made. I don't really consider it a full-fledged plugin. It only restarts a round. Plus it hasn't been fully tested other than on my local server. But the method used is kinda unique and can be a tutorial for others.rnrnCommand: round_restart - Restarts the roundrnCVars: NonernNotes: This plugin forces a 'Use' action on a dod_score_ent entity. So... if another plugin hooks a 'Use' of a dod_score_ent entity AFTER this plugin, strange things may occur. You are warned.rnrnIf a map does not have a 'dod_control_point_master' AND a 'dod_score_ent' entity, the plugin will terminate.rnrnThe current scores remain the same. Perhaps some enterprising coder will add the ability to subtract points earned before the restart.rn-
Threads: 75
Joined: Nov 2007
nice lets hope it gets approved lol
Threads: 75
Joined: Nov 2007
Nice... well a bit offtopic, but arent these two stocks the same?rnrn#1rn
stock set_keyvalue(ent, key[], value[])rn{rn new classname[32]rn pev(ent, pev_classname, classname, 31)rn set_kvd(0, KV_ClassName, classname)rn set_kvd(0, KV_KeyName, key)rn set_kvd(0, KV_Value, value)rn set_kvd(0, KV_fHandled, 0)rn rn dllfunc(DLLFunc_KeyValue, ent, 0)rn}rnrn#2rnstock fm_set_kvd(entity, const key[], const value[], const classname[]) rn{rn set_kvd(0, KV_ClassName, classname)rn set_kvd(0, KV_KeyName, key)rn set_kvd(0, KV_Value, value)rn set_kvd(0, KV_fHandled, 0)rnrn return dllfunc(DLLFunc_KeyValue, entity, 0)rn}rnrnThe first one is one i found at allied modders, cant remember where tho.. Ive used it to set some values of an entity, but it didnt work with this ie.set_keyvalue(ent, "wait", "20")rnWith others it did work tho... The one u use might be better/working :)rnrnrnAnd a last one :) Is this really needed??:rn#define fm_find_ent_by_class(%1,%2) engfunc(EngFunc_FindEntityByString, %1, "classname", %2)rnrnrnCuz ive used:rnengfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, classname))rnrnWithout:rnrn#define fm_create_entity(%1) engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, %1))rnrnAnd that worked fine....Threads: 24
Joined: Oct 2006
IDK about the set_keyvalue. Bailopan suggested to me one time that I use the FM version, so that's what I do. I figure he knows a hell of a lot more than me. lolrnrnAs far as the calls, there's no difference. I just like to use the define/sub method because I feel its easier for others to understand what's going on using them. Seeing 'fm_create_entity' seems a lot more clear than a big ol' eng/dll function call. And I don't think there's an advantage either way because the function defined is substituted upon compiling. So it all ends up the same.

