Commit 403eb2d8 authored by Mikleo's avatar Mikleo

--

parent 67ebed08
Pipeline #9438 passed with stages
in 34 seconds
......@@ -9,7 +9,7 @@
#include <updater>
#define PluginVersion "1.00"
#define PluginVersion "1.01"
float pVersion;
// note linearmap field is unstable
......
......@@ -65,10 +65,9 @@ void Funcs_OnPluginStart()
AddCommand("TargetParams",TargetParamsCommand,0);
AddCommand("FilterTeam",FilterTeamCommand,1);
AddCommand("SetHealth",SetHealthCommand,1);
AddCommand("Cancel",CancelCommand,1);
AddCommand("Cancel",CancelCommand,100);
AddCommand("RunIf",RunIfCommand,6);
AddCommand("AddDamageFilter",AddDamageFilterCommand,100);
RegAdminCmd("sm_clearscripts", Command_Clear_Scripts, ADMFLAG_SLAY);
......@@ -1224,6 +1223,48 @@ public int CancelCommand(int entity,char[] args,char[] remainder)
public int AddDamageFilterCommand(int entity,char[] args,char[] remainder)
{
if(IsValidEntity(entity) )
{
SDKHook(entity, SDKHook_OnTakeDamage, AddDamageFilter_OnTakeDamage);
CreateCommand(entity,INVALID_HANDLE,AddDamageFilter_Close,remainder,"",args,0);
SetEntPropString(entity,Prop_Data,"m_iszDamageFilterName",args);
}
return entity;
}
public void AddDamageFilter_Close(int commandID)
{
CommandTrack commandTrack;
commands.GetArray(commandID,commandTrack);
if(IsValidEntity(commandTrack.entRef))
{
SDKUnhook(commandTrack.entRef,SDKHook_OnTakeDamage,AddDamageFilter_OnTakeDamage);
}
}
public Action:AddDamageFilter_OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype, &weapon, Float:damageForce[3], Float:damagePosition[3])
{
char args[64];
GetEntPropString(victim,Prop_Data,"m_iszDamageFilterName",args,sizeof(args));
if(StrContains(args,"NoTeamDamage") != -1 && GetEntProp(victim,Prop_Send,"m_iTeamNum") == GetEntProp(inflictor,Prop_Send,"m_iTeamNum"))
{
damage = 0.0;
return Plugin_Changed;
}
if(StrContains(args,"NoBulletDamage") != -1 && damagetype & DMG_BULLET == 1)
{
damage = 0.0;
return Plugin_Changed;
}
return Plugin_Continue;
}
void WritePackVector(DataPack dataPack,float[3] vector)
{
WritePackFloat(dataPack,vector[0]);
......
......@@ -9,7 +9,7 @@
"OnScenarioLoaded" "Run Introduction Introduction2"
"Introduction" "After 60 -> ChatText *Gen. Strickland:TXTCLR_DF Listen up, the artifact in the ruins will provide us an enormous technological advantage in the war to come* *Gen. Mendez:TXTCLR_DF Intel has detected an artifact in the south east ruins with enormous strategic value* **"
"Introduction2" "After 65 -> ChatText *Gen. Strickland:TXTCLR_DF Our objective is clear, defend the artifact at any cost.* *Gen. Mendez:TXTCLR_DF Our objective is clear, destroy the artifact at any cost.* **"
"OnGameStart" "TargetName artifact -> Run ObjectiveTimer Warning DestroyTrigger AirStrikeExec1 AirStrikeExec2 SmartIdeas AirStrikeExec3"
"OnGameStart" "TargetName artifact -> AddDamageFilter NoTeamDamage -> Run ObjectiveTimer Warning DestroyTrigger AirStrikeExec1 AirStrikeExec2 SmartIdeas AirStrikeExec3"
"ObjectiveTimer" "TextTimer 1200 *Defend The Artifact\TIME_LEFT $[m_iHealth]HP* *Destroy The Artifact\TIME_LEFT $[m_iHealth]HP* -> TargetParams -> Input InputNFWin 0 EndActivator"
"DestroyTrigger" "OnOutput OnBreak -> TargetParams -> Input InputImpWin 0 EndActivator"
"Warning" "After 400 -> ChatText *Gen. Strickland:TXTCLR_DF Intel has revealed that the enemy are planning airstrikes on key buildings at our location. Don't take any defences for granted!* *Gen. Mendez:TXTCLR_DF Be alert, We have allied bombers in the area which will deliver precision airstrikes on enemy targets* **"
......@@ -3118,7 +3118,7 @@
"5000009"
{
"className" "light_dynamic"
"position" "10787.546875 -10935.142578 201.400070"
"position" "10787.546875 -10935.142578 160.400070"
"angles" "0.000000 0.000000 0.000000"
"coords" "E1"
"name" "EndActivator"
......
......@@ -4,7 +4,7 @@
{
"Version"
{
"Latest" "1.00"
"Latest" "1.01"
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment