Czego nie rozumiesz? Wyciagasz funkcje z pluginu i wrzucasz do np perku, odpowiednio argumentujac.
Kod na rozbrajanie
public OnPluginStart()
{
HookEvent("bomb_begindefuse", BombBeginDefuse);
HookEvent("bomb_abortdefuse", BombAbortDefuse);
}
public Action:BombBeginDefuse(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if(!IsValidClient(client))
return Plugin_Continue;
CreateTimer(0.1, C4Timer, client);
return Plugin_Continue;
}
public Action:BombAbortDefuse(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if(!IsValidClient(client))
return Plugin_Continue;
SetEntProp(client, Prop_Send, "m_iProgressBarDuration", 0);
return Plugin_Continue;
}
public Action:C4Timer(Handle:timer, any:client)
{
if(!IsValidClient(client))
return Plugin_Continue;
new ent = FindEntityByClassname(-1, "planted_c4");
if(ent != -1)
{
SetEntPropFloat(ent, Prop_Send, "m_flDefuseCountDown", GetGameTime()+1.0);
SetEntProp(client, Prop_Send, "m_iProgressBarDuration", 1);
}
return Plugin_Continue;
}