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.