smoke96
Участник
- Сообщения
- 1,134
- Реакции
- 175
Есть код для шопа , грена поджигающая и в полете тоже гореть должна. Но один баг есть, она поджигает игрока все ок , но в полете не горит , не знаю как исправить. Кусок кода без реги в шопе:
Добавлено через 3 часа 15 минут
Помогите)
PHP:
public DamageEvent(Handle:event,const String:name[],bool:dontBroadcast)
{
GetEventString(event,"weapon",Weapon,30);
new DmgDone = GetEventInt(event,"dmg_health");
new clientid = GetEventInt(event,"userid");
new iClient = GetClientOfUserId(clientid);
new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
if(g_bHasNG[attacker] && attacker && StrEqual(Weapon,"hegrenade")== true)
{
new victim = GetClientOfUserId(GetEventInt(event, "userid"));
if(victim != attacker)
{
PrintToChat(iClient,"\x01[\x04НПГ\x01] Тебя ранила и подожгла \x03Напалм-Грена \x01!");
if(DmgDone <= 30)
{
IgniteEntity(iClient,12.0);
}else if(DmgDone > 71)
{
IgniteEntity(iClient,9.0);
}else if(DmgDone > 51)
{
IgniteEntity(iClient,6.0);
}else if (DmgDone >= 31)
{
IgniteEntity(iClient,3.0);
}
}
}
}
public OnEntityCreated(iEntity, const String:classname[])
{
if(strcmp(classname, "hegrenade_projectile", false) == 0) CreateTimer(0.0, Timer_Ignite, EntIndexToEntRef(iEntity));
}
public Action:Timer_Ignite(Handle:timer, any:ref)
{
new iEntity = EntRefToEntIndex(ref);
if (iEntity != INVALID_ENT_REFERENCE && 0 < GetEntPropEnt(iEntity, Prop_Send, "m_hOwnerEntity") <= MaxClients) IgniteEntity(iEntity, 4.0);
}
public DeathEvent(Handle:event,const String:name[],bool:dontBroadcast)
{
new clientid = GetEventInt(event,"userid");
new iClient = GetClientOfUserId(clientid);
ExtinguishEntity(iClient);
}
public OnClientDisconnect(iClient)
{
if(IsClientInGame(iClient)== true)
{
ExtinguishEntity(iClient);
}
}
public bool:OnClientConnect(iClient)
{
if(IsClientInGame(iClient)== true)
{
ExtinguishEntity(iClient);
}
return true;
}
Добавлено через 3 часа 15 минут
Помогите)
Последнее редактирование модератором: