AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   Replace map medikits with Halloween versions. (Code included) (https://forums.alliedmods.net/showthread.php?t=198904)

Smarmy 10-21-2012 14:51

Replace map medikits with Halloween versions. (Code included)
 
1 Attachment(s)
Hello,

I have some code here written by Dr. McKay which attempts to do this but he currently doesn't have time to complete what's currently wrong with it. Right now it removes the kits but doesn't replace them.

Code:

#include <sourcemod>
#include <sdktools>
        #include <sdkhooks>
       
        public Plugin:myinfo = {
                name = "[TF2] Halloween Health Packs",
                author = "Dr. McKay",
                description = "Changes regular health packs to Halloween health packs",
                version = "1.0.0",
                url = "http://www.doctormckay.com"
        }
       
        new bool:ignoreNextEntity = false;
        new bool:mapRunning = false;
       
        public OnMapStart() {
                PrecacheModel("models/props_halloween/halloween_medkit_large.mdl");
                PrecacheModel("models/props_halloween/halloween_medkit_medium.mdl");
                PrecacheModel("models/props_halloween/halloween_medkit_small.mdl");
                mapRunning = true;
        }
       
        public OnMapEnd() {
                mapRunning = false;
        }
       
        public OnEntityCreated(entity, const String:classname[]) {
                if(ignoreNextEntity) {
                        ignoreNextEntity = false;
                        LogMessage("Ignored entity");
                        return;
                }
                if(!mapRunning) {
                        return;
                }
                decl String:model[128];
             
                if(StrEqual(classname, "item_healthkit_full")) {
                        Format(model, sizeof(model), "models/props_halloween/halloween_medkit_large.mdl");
                } else if(StrEqual(classname, "item_healthkit_medium")) {
                        Format(model, sizeof(model), "models/props_halloween/halloween_medkit_medium.mdl");
                } else if(StrEqual(classname, "item_healthkit_small")) {
                        Format(model, sizeof(model), "models/props_halloween/halloween_medkit_small.mdl");
                } else {
                        return; // not a healthpack
                }
             
                new Float:pos[3];
                GetEntPropVector(entity, Prop_Send, "m_vecOrigin", pos);
                AcceptEntityInput(entity, "kill");
             
                ignoreNextEntity = true;
                entity = CreateEntityByName(classname);
                DispatchKeyValue(entity, "OnPlayerTouch", "!self,Kill,,0,-1");
                DispatchKeyValue(entity, "powerup_model", model);
                DispatchSpawn(entity);
                SetEntProp(entity, Prop_Send, "m_iTeamNum", 0, 4);
                TeleportEntity(entity, pos, NULL_VECTOR, NULL_VECTOR);
        }

Thank you.

Mitchell 10-22-2012 09:29

Re: Replace map medikits with Halloween versions. (Code included)
 
Why didnt he just change the model? Instead of trying to re-create them?

Huntereb 10-22-2012 09:52

Re: Replace map medikits with Halloween versions. (Code included)
 
Stripper Source?

lyric 10-22-2012 10:22

Re: Replace map medikits with Halloween versions. (Code included)
 
Why no twait for halloween?

Powerlord 10-22-2012 11:37

Re: Replace map medikits with Halloween versions. (Code included)
 
Incidentally, if you don't use the same method of replacing healthkit models that Valve uses for its birthday healthkits, any holiday mode that changes them will override this.

guybrush_threepwood 10-23-2012 09:35

Re: Replace map medikits with Halloween versions. (Code included)
 
just use Powerlord's [TF2]Force Holidays
https://forums.alliedmods.net/showthread.php?t=171012
set it to full moon mode

Powerlord 10-23-2012 09:56

Re: Replace map medikits with Halloween versions. (Code included)
 
Quote:

Originally Posted by guybrush_threepwood (Post 1824062)
just use Powerlord's [TF2]Force Holidays
https://forums.alliedmods.net/showthread.php?t=171012
set it to full moon mode

Last I checked, the Halloween Holiday doesn't replace health kits with their Halloween versions.

pubhero 10-24-2012 10:38

Re: Replace map medikits with Halloween versions. (Code included)
 
Quote:

Originally Posted by Huntereb (Post 1823526)
Stripper Source?

Tomorrow morning i will test that. :D

lyric 10-24-2012 18:24

Re: Replace map medikits with Halloween versions. (Code included)
 
Dartninja has promised to update his plugin to include this but has failed to do so as of now. I don't think you're going to get anything working between now and hallowwen time op.

Smarmy 10-24-2012 20:20

Re: Replace map medikits with Halloween versions. (Code included)
 
Quote:

Originally Posted by lyric (Post 1825056)
Dartninja has promised to update his plugin to include this but has failed to do so as of now. I don't think you're going to get anything working between now and hallowwen time op.

Not looking that way, oh well.


All times are GMT -4. The time now is 17:13.

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