Senior Member
Join Date: Sep 2015
Location: Location:
|
06-14-2019
, 09:07
Re: DHooks (Dynamic Hooks - Dev Preview)
|
#684
|
Quote:
Originally Posted by nosoop
|
Welp, didn't succeed. All I did was find another way to crash the game with a ragdoll signature.
Here's the dhook:
PHP Code:
public MRESReturn OnTakeDamage(client, Handle hReturn, Handle hParams) { PrintToServer("DHooksHacks = Victim %i, Attacker %i, Inflictor %i, Damage %f", client, DHookGetParamObjectPtrVar(hParams, 1, 40, ObjectValueType_Ehandle), DHookGetParamObjectPtrVar(hParams, 1, 36, ObjectValueType_Ehandle), DHookGetParamObjectPtrVar(hParams, 1, 48, ObjectValueType_Float)); if (!IsValidEntity(client) || !IsClientInGame(client) || (GetClientTeam(client) != 2 && GetClientTeam(client) != 3 && GetClientTeam(client) != 4)) return MRES_Ignored; /*if(client <= MaxClients && client > 0 && !IsFakeClient(client)) { DHookSetParamObjectPtrVar(hParams, 1, 48, ObjectValueType_Float, 0.0); PrintToChat(client, "Pimping your hp"); }*/ float damageForce[3], damagePosition[3], damageReportedPosition[3]; DHookGetParamObjectPtrVarVector(hParams, 1, 12, ObjectValueType_Vector, damageForce); DHookGetParamObjectPtrVarVector(hParams, 1, 12, ObjectValueType_Vector, damagePosition); DHookGetParamObjectPtrVarVector(hParams, 1, 24, ObjectValueType_Vector, damageReportedPosition); int inflictor = DHookGetParamObjectPtrVar(hParams, 1, 36, ObjectValueType_Ehandle); int attacker = DHookGetParamObjectPtrVar(hParams, 1, 36, ObjectValueType_Ehandle); int weapon = DHookGetParamObjectPtrVar(hParams, 1, 36, ObjectValueType_Ehandle); float flDamage = DHookGetParamObjectPtrVar(hParams, 1, 36, ObjectValueType_Float); float bitsDamageType = DHookGetParamObjectPtrVar(hParams, 1, 36, ObjectValueType_Int); float damagecustom = DHookGetParamObjectPtrVar(hParams, 1, 36, ObjectValueType_Int); //Action result = CallOnTakeDamage(victim, attacker, inflictor, flDamage, //bitsDamageType, weapon, damageForce, damagePosition, damagecustom); Call_StartForward(g_FwdOnTakeDamage); // There is already a forward defined in OnPluginStart, and it's the same forward in the TF2 CTakeDamageInfo scripting file minus the CritType. Call_PushCell(client); Call_PushCellRef(attacker); Call_PushCellRef(inflictor); Call_PushFloatRef(flDamage); Call_PushCellRef(bitsDamageType); Call_PushCellRef(weapon); Call_PushArrayEx(damageForce, 3, SM_PARAM_COPYBACK); Call_PushArrayEx(damagePosition, 3, SM_PARAM_COPYBACK); Call_PushCell(damagecustom); Action result; Call_Finish(result); SDKCall(hCreateRagdoll, client, result); //g_DamageInfo[client] = result; return MRES_Ignored; }
Last edited by Shadowysn; 06-14-2019 at 09:12.
|
|