TolikCorp
Участник
- Сообщения
- 874
- Реакции
- 334
Оригинал https://forums.alliedmods.net/showthread.php?p=1314733
Изменил:
На:
1) добавил #include <protobuf>
2)
И тишина, никто не пробовал переделать под КСГО?
Добавлено через 1 час 32 минуты
Изменил:
PHP:
stock Shake(client, Float:flAmplitude, Float:flDuration)
{
new Handle:hBf=StartMessageOne("Shake", client);
if(hBf!=INVALID_HANDLE)
BfWriteByte(hBf, 0);
BfWriteFloat(hBf, flAmplitude);
BfWriteFloat(hBf, 1.0);
BfWriteFloat(hBf, flDuration);
EndMessage();
}
На:
1) добавил #include <protobuf>
2)
PHP:
stock Shake(client, Float:flAmplitude, Float:flDuration)
{
new Handle:hBf=StartMessageOne("Shake", client);
if (hBf != INVALID_HANDLE)
{
PbSetInt(hBf, "command", 0);
PbSetFloat(hBf, "local_amplitude", flAmplitude);
PbSetFloat(hBf, "frequency", 1.0);
PbSetFloat(hBf, "duration", flDuration);
EndMessage();
}
}
И тишина, никто не пробовал переделать под КСГО?
Добавлено через 1 час 32 минуты
PHP:
public Action:player_hurt(Handle:event, const String:name[], bool:dontBroadcast)
{
GetEventString(event, "weapon", weapon, sizeof(weapon));
if(StrEqual(weapon,"hegrenade"))
{
new client = GetClientOfUserId(GetEventInt(event,"userid"));
if(g_Cvar_nsEnabledDmg)
{
new Float:damage = GetEventFloat(event, "dmg_health");
Shake(client, damage, DUR_SHAKE);
}
else
{
Shake(client, AMP_SHAKE, DUR_SHAKE);
}
}
return Plugin_Continue;
}
stock Shake(client, Float:flAmplitude, Float:flDuration)
{
new Handle:hBf=StartMessageOne("Shake", client);
if(hBf!=INVALID_HANDLE)
PbSetInt(hBf, "command", 0);
PbSetFloat(hBf, "local_amplitude", flAmplitude);
PbSetFloat(hBf, "frequency", 1.0);
PbSetFloat(hBf, "duration", flDuration);
EndMessage();
}
Последнее редактирование: