Raised This Month: $ Target: $400
 0% 

How to make mediguns give kritz and mega heal?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 02-18-2014 , 10:07   How to make mediguns give kritz and mega heal?
Reply With Quote #1

How would I force tf2 to "Seperate" the attributes "medigun charge is crit boost" and "medigun charge is megaheal" so that I can make a medigun(when uber deployed) act like a hybrid quick-fix and kritzkrieg. Atm, tf2 treats the 3 attributes for the 3 non-regular ubercharge mediguns as 1 attribute(with a numbering system from 1 to 3 with 1 being crits and 3 being resists).
Edit, may a combo of using a forward to tell when an uber was removed, event when uber was deployed, and the forward for crits.
Edit2: This is what I got started so far:
Code:
//Unnessecary code replaced by this comment
new Handle:specialcrits;
//Unnessecary code replaced by this comment
public OnPluginStart(){
	//Unnessecary code replaced by this comment
	HookEvent("player_chargedeployed", OnUberCharge);
	//Unnessecary code replaced by this comment
	specialcrits = CreateArray(2);
}
//Unnessecary code replaced by this comment
public OnUberCharge(Handle:event, const String:name[], bool:dontBroadcast){
	new medicID = GetEventInt(event, "userid");
	new targetID = GetEventInt(event, "targetid");
	new medic = GetClientOfUserId(medicID);
	new target = GetClientOfUserId(targetID);
	if(!IsValidClient(medic)){
		Flex_Debug("Medic is not a valid client anymore.");
	}else if(!IsValidClient(target)){
		Flex_Debug("Target is not a valid client or medic ubered himself.");
	}else{
		decl String:medicname[MAX_NAME_LENGTH];
		decl String:targetname[MAX_NAME_LENGTH];
		GetClientName(medic,medicname,MAX_NAME_LENGTH);
		GetClientName(target,targetname,MAX_NAME_LENGTH);
		decl buffer[2];
		new ArraySize = GetArraySize(specialcrits);
		if(ArraySize==0){
			Flex_Debug("Crits array has no size, giving it one.");
			ArraySize=1;
			ResizeArray(specialcrits, ArraySize);
		}else{
			Flex_Debug("Crits array has a size, checking if there's room.");
			GetArrayArray(specialcrits, ArraySize-1, buffer);
			if(buffer[0] > 0){
				Flex_Debug("Crits array has no room. Giving it room.");
				ArraySize++;
				ResizeArray(specialcrits, ArraySize);
			}
		}
		if(CheckCommandAccess(medic, "root_weapons_override", ADMFLAG_ROOT)){
			Flex_Debug("%s has access to root_weapons_override, %s will be given crits.", medicname, targetname);
		}
	}
}
//Unnessecary code replaced by this comment, including the function for the debug.

Last edited by WildCard65; 02-18-2014 at 11:25.
WildCard65 is offline
 



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:53.


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