Копировал чужой код в свою функцию:Код
public shake(client, Float:time)
{
new Handle:hBf=StartMessageOne("Shake", client); //начинаем создавать энтити env_shake
if(hBf!=INVALID_HANDLE) //удалось создать
{
BfWriteByte(hBf, 0);
BfWriteFloat(hBf, 10.0); //амплитуда взрыва
BfWriteFloat(hBf, 1.0);
BfWriteFloat(hBf, time); //длительность
EndMessage();
}
}
Когда использую функцию сервер падает с логами
Код
[SM] Call stack trace:
L 07/01/2016 - 15:48:02: [SM] [0] StartMessage
L 07/01/2016 - 15:48:02: [SM] [1] Line 256, D:\wcsource\csgo\addons\sourcemod\scripting\include\usermessages.inc::StartMessageOne()
L 07/01/2016 - 15:48:02: [SM] [2] Line 328, D:\wcsource\csgo\addons\sourcemod\scripting\Skills_kiborg.sp::shake()
L 07/01/2016 - 15:48:02: [SM] [3] Line 383, D:\wcsource\csgo\addons\sourcemod\scripting\Skills_kiborg.sp::OnTakeDamage()
L 07/01/2016 - 15:48:02: [SM] Exception reported: Unable to execute a new message, there is already one in progress
L 07/01/2016 - 15:48:02: [SM] Blaming: Skills_kiborg.smx()
L 07/01/2016 - 15:48:02: [SM] Call stack trace:
L 07/01/2016 - 15:48:02: [SM] [0] StartMessage
L 07/01/2016 - 15:48:02: [SM] [1] Line 256, D:\wcsource\csgo\addons\sourcemod\scripting\include\usermessages.inc::StartMessageOne()
L 07/01/2016 - 15:48:02: [SM] [2] Line 328, D:\wcsource\csgo\addons\sourcemod\scripting\Skills_kiborg.sp::shake()
L 07/01/2016 - 15:48:02: [SM] [3] Line 383, D:\wcsource\csgo\addons\sourcemod\scripting\Skills_kiborg.sp::OnTakeDamage()
Исправте пжлст кому не леньДобавлено (01.07.2016, 16:22:41)
---------------------------------------------
Все, нашел для кс го вот так
Код
public shake(client, Float:time)
{
new Handle:hBf = StartMessageOne("Shake", client);
if(hBf != INVALID_HANDLE)
{
PbSetInt(hBf, "command", 0);
PbSetFloat(hBf, "local_amplitude", 16.0);
PbSetFloat(hBf, "frequency", 1.0);
PbSetFloat(hBf, "duration", time);
EndMessage();
}
}