Ramil Kharitonov
Участник
- Сообщения
- 1
- Реакции
- 0
как разрешить гранаты ?
ОффтопА архивы для чего? :-D442 строка :DDDC-подобный:public OnFlashDetonate(Handle:event, const String:name[], bool:dontBroadcast) { if (!b_enable || !b_flash_freeze) { return; } new client = GetClientOfUserId(GetEventInt(event, "userid")); new Float:origin[3]; origin[0] = GetEventFloat(event, "x"); origin[1] = GetEventFloat(event, "y"); origin[2] = GetEventFloat(event, "z"); new index = MaxClients+1; decl Float:xyz[3]; while ((index = FindEntityByClassname(index, "flashbang_projectile")) != -1) { GetEntPropVector(index, Prop_Send, "m_vecOrigin", xyz); if (xyz[0] == origin[0] && xyz[1] == origin[1] && xyz[2] == origin[2]) { AcceptEntityInput(index, "kill"); } } origin[2] += 10.0; new Float:targetOrigin[3]; for (new i = 1; i <= MaxClients; i++) { if (!IsClientInGame(i) || !IsPlayerAlive(i) || ZR_IsClientHuman(i)) { continue; } GetClientAbsOrigin(i, targetOrigin); targetOrigin[2] += 2.0; if (GetVectorDistance(origin, targetOrigin) <= f_flash_freeze_distance) { new Handle:trace = TR_TraceRayFilterEx(origin, targetOrigin, MASK_SOLID, RayType_EndPoint, FilterTarget, i); if ((TR_DidHit(trace) && TR_GetEntityIndex(trace) == i) || (GetVectorDistance(origin, targetOrigin) <= 100.0)) { Freeze(i, client, f_flash_freeze_duration); CloseHandle(trace); } else { CloseHandle(trace); GetClientEyePosition(i, targetOrigin); targetOrigin[2] -= 2.0; trace = TR_TraceRayFilterEx(origin, targetOrigin, MASK_SOLID, RayType_EndPoint, FilterTarget, i); if ((TR_DidHit(trace) && TR_GetEntityIndex(trace) == i) || (GetVectorDistance(origin, targetOrigin) <= 100.0)) { Freeze(i, client, f_flash_freeze_duration); } CloseHandle(trace); } } } TE_SetupBeamRingPoint(origin, 10.0, f_flash_freeze_distance, g_beamsprite, g_halosprite, 1, 1, 0.2, 100.0, 1.0, FreezeColor, 0, 0); TE_SendToAll(); [COLOR=Red] LightCreate(FLASH, origin);[/COLOR] }
Поставил перед ней "//" и освещения больше нет - радует. :)Нужно было не так:
А вот так:C-подобный:public Action:OnSmokeDetonate(Handle:event, const String:name[], bool:dontBroadcast) { if (b_enable && b_smoke_gas) { new client = GetClientOfUserId(GetEventInt(event,"userid")); if( !IsClientConnected(client) && !IsClientInGame(client) ) return Plugin_Continue; new index = CreateEntityByName("point_hurt"); if (index == -1) return Plugin_Handled; DispatchKeyValueFloat(index, "DamageRadius", GetConVarFloat(h_greneffects_smoke_gas_distance)); new human = ZR_IsClientHuman(client); new zombie = ZR_IsClientZombie(client); [COLOR=Red] if (GetClientTeam(human) == GetClientTeam(client)) { DispatchKeyValueFloat(index, "Damage", GetConVarFloat(h_greneffects_smoke_gas_damage_h)); } else { if (GetClientTeam(zombie) == GetClientTeam(client)) { DispatchKeyValueFloat(index, "Damage", GetConVarFloat(h_greneffects_smoke_gas_damage_z)); } }[/COLOR] DispatchKeyValueFloat(index, "DamageType", 32); DispatchSpawn(index); DispatchSpawn(index); decl Float:VectorPos[3]; VectorPos[0]=GetEventFloat(event,"x"); VectorPos[1]=GetEventFloat(event,"y"); VectorPos[2]=GetEventFloat(event,"z"); TeleportEntity(index, VectorPos, NULL_VECTOR, NULL_VECTOR); SetVariantString("OnUser1 !self,kill,-1,20"); AcceptEntityInput(index, "AddOutput"); AcceptEntityInput(index, "TurnOn"); AcceptEntityInput(index, "FireUser1"); } return Plugin_Continue; }
Зомби же и люди не являются командой, чтобы им присваивать это. Можно было сделать через GetClientTeam == 2 и 3, но тогда бы терры умирали в 3 раза быстрее чем контры (когда зомби еще не появился). Но когда бы зомби появился, их бы мочило в 3 раза быстрее, чем людей в обликах террористов и контров.C-подобный:public Action:OnSmokeDetonate(Handle:event, const String:name[], bool:dontBroadcast) { if (b_enable && b_smoke_gas) { new client = GetClientOfUserId(GetEventInt(event,"userid")); if( !IsClientConnected(client) && !IsClientInGame(client) ) return Plugin_Continue; new index = CreateEntityByName("point_hurt"); if (index == -1) return Plugin_Handled; DispatchKeyValueFloat(index, "DamageRadius", GetConVarFloat(h_greneffects_smoke_gas_distance)); [COLOR=Red] if (ZR_IsClientHuman(client)) { DispatchKeyValueFloat(index, "Damage", GetConVarFloat(h_greneffects_smoke_gas_damage_h)); } if (ZR_IsClientZombie(client)) { DispatchKeyValueFloat(index, "Damage", GetConVarFloat(h_greneffects_smoke_gas_damage_z)); }[/COLOR] DispatchKeyValueFloat(index, "DamageType", 32.00); DispatchSpawn(index); decl Float:VectorPos[3]; VectorPos[0]=GetEventFloat(event,"x"); VectorPos[1]=GetEventFloat(event,"y"); VectorPos[2]=GetEventFloat(event,"z"); TeleportEntity(index, VectorPos, NULL_VECTOR, NULL_VECTOR); SetVariantString("OnUser1 !self,kill,-1,20"); AcceptEntityInput(index, "AddOutput"); AcceptEntityInput(index, "TurnOn"); AcceptEntityInput(index, "FireUser1"); } return Plugin_Continue; }
Но теперь у меня все работает. Все, кроме таймера... Фиг знает где он. Хотя этот кусок, единственно связанный с газом. Видимо дымовуха при столкновении по дефолту забирает хп по 0.2 сек. С damage = 2, он за секунду забирает 10 хп. :(
wanted241, исходник???? :rtfm:
models/props/slow/smoke_effect/slow_smoke_effect.dx80.vtx
models/props/slow/smoke_effect/slow_smoke_effect.dx90.vtx
models/props/slow/smoke_effect/slow_smoke_effect.mdl
models/props/slow/smoke_effect/slow_smoke_effect.sw.vtx
models/props/slow/smoke_effect/slow_smoke_effect.vvd
materials/models/props/slow/smoke_effect/slow_smoke_effect.vmt
materials/models/props/slow/smoke_effect/slow_smoke_effect.vtf
materials/models/props/slow/smoke_effect/slow_smoke_effect_2.vmt
materials/models/props/slow/smoke_effect/slow_smoke_effect_2.vtf
Это куда вписывать?:-D
https://forums.alliedmods.net/showthread.php?p=602270 - Скачай это и в конфиг того плагина пропиши.
хотелось бы что бы не спамил в консоли сервера вот это!
ERROR! can't create physics object for models/props/slow/smoke_effect/slow_smoke_effect.mdl
смешной залиты естественно!
заглянул в логи
L 06/11/2013 - 22:56:40: [SM] Native "IsClientInGame" reported: Client index -1 is invalid
L 06/11/2013 - 22:56:40: [SM] Displaying call stack trace for plugin "GrenadeEffects2.smx":
L 06/11/2013 - 22:56:40: [SM] [0] Line 249, GrenadeEffects2.sp::DmgDelay()
да ошибок нет но к сожалению нее буду использовать так как ошибка в консоле(( спасибо!