As a follow up for this old thread, I have an question...
How can one set the amount of cloak and then force the cloak? Of course, naturally only the spy could self-toggle the cloak.
Here is what I have:
PHP Code:
new CloakMeterPointer;
public OnPluginStart()
{
HookEvent("arena_round_start", ArenaRound, EventHookMode_PostNoCopy);
CloakMeterPointer = FindSendPropInfo("CTFPlayer", "m_flCloakMeter");
}
public ArenaRound(Handle:event, const String:name[], bool:dontBroadcast) //Begin round
{
CreateTimer(0.3, Delay_Timer);
}
public Action:Delay_Timer(Handle:timer)
{
for(new i = 1; i <= MaxClients; i++)
{
if(IsClientInGame(i) && IsPlayerAlive(i) && IsValidEntity(i))
{
SetEntDataFloat(i, CloakMeterPointer, 3.0, true);
TF2_AddCondition(i, TFCond_Cloaked, -1.0);
}
}
}
I am just using 3 seconds as a test, but it appears as though the player has no cloak amount. They do the normal cloaking, but just uncloak as they no juice left.
Must be something simple that I am missing here, but I just don't know what it is.