Raised This Month: $51 Target: $400
 12% 

Replace map medikits with Halloween versions. (Code included)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Smarmy
Senior Member
Join Date: Mar 2012
Old 10-21-2012 , 14:51   Replace map medikits with Halloween versions. (Code included)
Reply With Quote #1

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.
Attached Files
File Type: sp Get Plugin or Get Source (medikit_replacer.sp - 446 views - 2.2 KB)
Smarmy is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 10-22-2012 , 09:29   Re: Replace map medikits with Halloween versions. (Code included)
Reply With Quote #2

Why didnt he just change the model? Instead of trying to re-create them?
Mitchell is offline
Huntereb
>:) (:<
Join Date: Jul 2012
Old 10-22-2012 , 09:52   Re: Replace map medikits with Halloween versions. (Code included)
Reply With Quote #3

Stripper Source?
Huntereb is offline
lyric
Veteran Member
Join Date: Sep 2012
Old 10-22-2012 , 10:22   Re: Replace map medikits with Halloween versions. (Code included)
Reply With Quote #4

Why no twait for halloween?
lyric is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 10-22-2012 , 11:37   Re: Replace map medikits with Halloween versions. (Code included)
Reply With Quote #5

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.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 10-22-2012 at 11:37.
Powerlord is offline
guybrush_threepwood
Member
Join Date: Oct 2012
Location: Australia
Old 10-23-2012 , 09:35   Re: Replace map medikits with Halloween versions. (Code included)
Reply With Quote #6

just use Powerlord's [TF2]Force Holidays
https://forums.alliedmods.net/showthread.php?t=171012
set it to full moon mode
__________________
My Server
guybrush_threepwood is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 10-23-2012 , 09:56   Re: Replace map medikits with Halloween versions. (Code included)
Reply With Quote #7

Quote:
Originally Posted by guybrush_threepwood View Post
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.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
pubhero
Veteran Member
Join Date: Aug 2012
Location: Central Europe
Old 10-24-2012 , 10:38   Re: Replace map medikits with Halloween versions. (Code included)
Reply With Quote #8

Quote:
Originally Posted by Huntereb View Post
Stripper Source?
Tomorrow morning i will test that.
pubhero is offline
lyric
Veteran Member
Join Date: Sep 2012
Old 10-24-2012 , 18:24   Re: Replace map medikits with Halloween versions. (Code included)
Reply With Quote #9

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.
lyric is offline
Smarmy
Senior Member
Join Date: Mar 2012
Old 10-24-2012 , 20:20   Re: Replace map medikits with Halloween versions. (Code included)
Reply With Quote #10

Quote:
Originally Posted by lyric View Post
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.
Smarmy is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:20.


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