I have write a new plugins..and I got this error logs
PHP Code:
L 10/23/2012 - 12:43:05: [SM] Native "GetEntPropEnt" reported: Property "m_jockeyVictim" not found (entity 0/worldspawn)
L 10/23/2012 - 12:43:05: [SM] Displaying call stack trace for plugin "L4d2_Jockey acid swipe.smx":
L 10/23/2012 - 12:43:05: [SM] [0] Line 79, D:\steamapps\common\left 4 dead 2\left4dead2\addons\sourcemod\scripting\L4d2_Jockey Acid Swipe.sp::Event_PlayerHurt()
PHP Code:
public Action:Event_PlayerHurt(Handle:event, const String:name[], bool:dontBroadcast)
{
new Jockey = GetClientOfUserId(GetEventInt(event, "attacker"));
new target = GetClientOfUserId(GetEventInt(event, "userid"));
new duration = GetConVarInt(FindConVar("sm_Jockey_acidswipe_duration"));
new stack = GetConVarInt(FindConVar("sm_Jockey_acidswipe_stack"));
new Jockey_Victim = GetEntPropEnt(Jockey, Prop_Send, "m_jockeyVictim");
decl String:weapon[64];
GetEventString(event, "weapon", weapon, sizeof(weapon));
if((GetClientTeam(target) == 2) && (StrEqual(weapon, "jockey_claw")))
{
if (IsValidEntity(Jockey_Victim) && Jockey_Victim != 0)
{
return Plugin_Continue;
} else
{
attacker[target] = Jockey;
if(hurtsLeft[target] <= 0)
{
hurtsLeft[target] = duration;
CreateTimer(1.0, Acid_Damage, target);
} else
{
if(stack == -1)
{
hurtsLeft[target] = duration;
} else
{
if(stack >= 0)
{
hurtsLeft[target] += stack;
} else
{
//sm_Jockey_acidswipe_stack has invalid value so log error
LogError("sm_Jockey_acidswipe_stack has an invalid value. Accepted values are -1 and higher.");
}
}
}
}
}
return Plugin_Continue;
}
public Action:Acid_Damage(Handle:timer, any:client)
{
if(hurtsLeft[client] <= 0)
{
attacker[client] = 0;
return;
} else
{
hurtsLeft[client] -= 1;
}
if(client == 0)
{
attacker[client] = 0;
hurtsLeft[client] = 0;
return;
}
if(!IsClientInGame(client))
{
attacker[client] = 0;
hurtsLeft[client] = 0;
return;
}
if(!IsPlayerAlive(client))
{
attacker[client] = 0;
hurtsLeft[client] = 0;
return;
}
if(GetClientTeam(client) != 2)
{
attacker[client] = 0;
hurtsLeft[client] = 0;
return;
}
#if defined DEBUG
EmitSoundToClient(Client, Acid_Sound);
#endif
DamageEffect(client);
if(hurtsLeft[client] > 0)
{
CreateTimer(1.0, Acid_Damage, client);
}
return;
}
PHP Code:
public OnMapStart()
{
PrecacheSound(Acid_Sound, true);
}
public Action:round_start(Handle:event, const String:name[], bool:dontBroadcast)
{
if(timer_handle != INVALID_HANDLE )
{
KillTimer(timer_handle);
timer_handle=INVALID_HANDLE;
}
if(timer_handle == INVALID_HANDLE)
{
timer_handle=CreateTimer(GetConVarFloat(sm_Jockey_Msg_time), Msg, 0, TIMER_REPEAT);
}
}
public Action:Event_RoundEnd(Handle:event, String:event_name[], bool:dontBroadcast)
{
if(timer_handle != INVALID_HANDLE)
{
KillTimer(timer_handle);
timer_handle=INVALID_HANDLE;
}
}