Quote:
Originally Posted by Marttt
I heard that is possible to do that with left4dhooks vscripts functions, but I was never able to make it run.
One example from left4dhooks_test
PHP Code:
char buffer[128]; Format(buffer, sizeof(buffer), "GetCurrentFlowPercentForPlayer(%d)", client); if( L4D2_GetVScriptOutput(buffer, buffer, sizeof(buffer)) ) PrintToServer("VScript: GetCurrentFlowPercentForPlayer(%d) = %s", client, buffer);
|
This is a VScript function I used in my mutation to check if a given non human entity is in the starting safe room:
Code:
/**
* Checks whether or not an entity is in the starting safe room
*
* @param entity Entity to check
* @return true if entity is in start safe room, false otherwise.
* @notes This works for the safe area on the first chapter of a campaign.
*/
function IsEntityInStartSafeRoom(entity)
{
local origin = entity.GetOrigin();
local navArea = NavMesh.GetNearestNavArea(origin, 2048, true, true);
if(navArea != null)
{
// Some stupid maps like Blood Harvest finale and The Passing finale have CHECKPOINT inside a FINALE marked area.
if(navArea.HasSpawnAttributes(64))
{
return false;
}
// https://developer.valvesoftware.com/wiki/List_of_L4D_Series_Nav_Mesh_Attributes
else if(navArea.HasSpawnAttributes(2048) && GetFlowPercentForPosition(origin, false) <= 50.0)
{
return true;
}
}
return false;
}
Maybe you can ask Silvers to allow making a file in addition to your plugin to declare VScript functions and then allow yourself to call them.
__________________
I am available to make plugins for pay.
Discord: Eyal282#1334