public OnEntityCreated(iEntity, const String:sClassName[])
{
if ( StrEqual(sClassName, "hegrenade_projectile") )
{
new iFireEntity = CreateEntityByName("env_fire_trail");
DispatchSpawn(iFireEntity);
SetVariantString("!activator");
AcceptEntityInput(iFireEntity, "SetParent", iEntity);
}
}
public void OnEntityCreated(int iEnt, const char[] classname)
{
if (StrEqual(classname, "hegrenade_projectile"))
{
IgniteEntity(iEnt, 1.0);
}
}
public void OnEntityCreated(int iEnt, const char[] classname)
{
if (StrEqual(classname, "hegrenade_projectile"))
{
CreateTimer(0.0, OnGrndSpawn, iEnt);
}
}
public Action OnGrndSpawn(Handle hTimer, any iHeEnt)
{
IgniteEntity(iHeEnt, 1.0);
}
А таймер там нафига? Не умеем свои ф-ции создавать? Там задержки нет.Если не сработает то так:
PHP:public void OnEntityCreated(int iEnt, const char[] classname) { if (StrEqual(classname, "hegrenade_projectile")) { CreateTimer(0.0, OnGrndSpawn, iEnt); } } public Action OnGrndSpawn(Handle hTimer, any iHeEnt) { IgniteEntity(iHeEnt, 1.0); }
а как в данном случае проверить кто бросил? получить индекс брошевшего гранату нужно..@White Wolf, если нужно проверять того кто бросал то нужен либо таймер либо SDKHook_SpawnPost
public void OnEntityCreated(int iEnt, const char[] classname)
{
if (StrEqual(classname, "hegrenade_projectile"))
{
CreateTimer(0.0, OnGrndSpawn, iEnt);
}
}
public Action OnGrndSpawn(Handle hTimer, any iHeEnt)
{
if (iHeEnt == -1 || FindDataMapOffs(iHeEnt, "m_hThrower") == -1) return;
int iClient = GetEntPropEnt(iHeEnt, Prop_Data, "m_hThrower");
}
Я читал на alliedmods что таймеры меньше 0.0 превращаются в 0.1@Колян,
PHP:public void OnEntityCreated(int iEnt, const char[] classname) { if (StrEqual(classname, "hegrenade_projectile")) { CreateTimer(0.0, OnGrndSpawn, iEnt); } } public Action OnGrndSpawn(Handle hTimer, any iHeEnt) { if (iHeEnt == -1 || FindDataMapOffs(iHeEnt, "m_hThrower") == -1) return; int iClient = GetEntPropEnt(iHeEnt, Prop_Data, "m_hThrower"); }
Это не такЯ читал на alliedmods что таймеры меньше 0.0 превращаются в 0.1
@Колян,
PHP:public void OnEntityCreated(int iEnt, const char[] classname) { if (StrEqual(classname, "hegrenade_projectile")) { CreateTimer(0.0, OnGrndSpawn, iEnt); } } public Action OnGrndSpawn(Handle hTimer, any iHeEnt) { if (iHeEnt == -1 || FindDataMapOffs(iHeEnt, "m_hThrower") == -1) return; int iClient = GetEntPropEnt(iHeEnt, Prop_Data, "m_hThrower"); }
public void OnEntityCreated(int iEnt, const char[] classname)
{
if (StrEqual(classname, "hegrenade_projectile"))
{
CreateTimer(0.0, OnGrndSpawn, iEnt);
}
}
public Action OnGrndSpawn(Handle hTimer, any iHeEnt)
{
if (iHeEnt == -1 || !IsValidEntity(iHeEnt) || FindDataMapOffs(iHeEnt, "m_hThrower") == -1) return;
int iClient = GetEntPropEnt(iHeEnt, Prop_Data, "m_hThrower");
}
public void OnEntityCreated(int iEnt, const char[] classname)
{
if (StrEqual(classname, "hegrenade_projectile"))
{
CreateTimer(0.0, OnGrndSpawn, iEnt);
}
}
public Action OnGrndSpawn(Handle hTimer, any iHeEnt)
{
if (iHeEnt == -1 || !IsValidEntity(iHeEnt) || FindDataMapInfo(iHeEnt, "m_hThrower") == -1) return;
int iClient = GetEntPropEnt(iHeEnt, Prop_Data, "m_hThrower");
}
получить индекс брошевшего гранату
new client = GetEntPropEnt(entity, Prop_Send, "m_hOwnerEntity");
2 одинаковых кода же... там тоже не кактит))) та же ошибка....фикс ксс
PHP:public void OnEntityCreated(int iEnt, const char[] classname) { if (StrEqual(classname, "hegrenade_projectile")) { CreateTimer(0.0, OnGrndSpawn, iEnt); } } public Action OnGrndSpawn(Handle hTimer, any iHeEnt) { if (iHeEnt == -1 || !IsValidEntity(iHeEnt) || FindDataMapOffs(iHeEnt, "m_hThrower") == -1) return; int iClient = GetEntPropEnt(iHeEnt, Prop_Data, "m_hThrower"); }
а вот так под кс го (не проверял)
PHP:public void OnEntityCreated(int iEnt, const char[] classname) { if (StrEqual(classname, "hegrenade_projectile")) { CreateTimer(0.0, OnGrndSpawn, iEnt); } } public Action OnGrndSpawn(Handle hTimer, any iHeEnt) { if (iHeEnt == -1 || !IsValidEntity(iHeEnt) || FindDataMapInfo(iHeEnt, "m_hThrower") == -1) return; int iClient = GetEntPropEnt(iHeEnt, Prop_Data, "m_hThrower"); }
это для ксс и для ксго пойдет?PHP:new client = GetEntPropEnt(entity, Prop_Send, "m_hOwnerEntity");
Ругается на эту сроку - if (iHeEnt == -1 || FindDataMapOffs(iHeEnt, "m_hThrower") == -1) а не на int iClient = GetEntPropEnt(iHeEnt, Prop_Data, "m_hThrower");PHP:new client = GetEntPropEnt(entity, Prop_Send, "m_hOwnerEntity");
2 одинаковых кода же... там тоже не кактит))) та же ошибка....
--- Добавлено позже ---
это для ксс и для ксго пойдет?
--- Добавлено позже ---
Ругается на эту сроку - if (iHeEnt == -1 || FindDataMapOffs(iHeEnt, "m_hThrower") == -1) а не на int iClient = GetEntPropEnt(iHeEnt, Prop_Data, "m_hThrower");
--- Добавлено позже ---
СТОП. Я не догоняю а зачем нам нужно вообще делать - FindDataMapOffs(iHeEnt, "m_hThrower") == -1 ??))) АХАХАХ индекс у нас есть... проериои на валидность и все)))
2 одинаковых кода же
Начиная с версии SM 1.6.0-manual. Принципиальной разницы нет.Первое под sm < 1.8,второе выше