Post by AttackerCat33 on Jul 22, 2022 9:08:23 GMT
Hi i am going to show you the correct way to create message_begin() until the end like premium servers:
The Wrong Code: (Example)
Correct Code: (Recommeded):
If You Use ScreenFade Or Shake Code:
Wrong one:
Correct One:
If You use status icon
Wrong code:
Correct One:
Make Sure if you start any message you need to do this
Sorry For My Bad English Thanks For Anyone Read This Thread
The Wrong Code: (Example)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_BEAMENTPOINT);
write_short(pevAttacker | 0x1000);
engfunc(EngFunc_WriteCoord, vecEndPos[0]);
engfunc(EngFunc_WriteCoord, vecEndPos[1]);
engfunc(EngFunc_WriteCoord, vecEndPos[2]);
write_short(g_sModelIndexLaser);
write_byte(0);
write_byte(0);
write_byte(1);
write_byte(30);
write_byte(0);
write_byte(0);
write_byte(200);
write_byte(0);
write_byte(200);
write_byte(0);
message_end();
Correct Code: (Recommeded):
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
{
write_byte(TE_BEAMENTPOINT);
write_short(pevAttacker | 0x1000);
engfunc(EngFunc_WriteCoord, vecEndPos[0]);
engfunc(EngFunc_WriteCoord, vecEndPos[1]);
engfunc(EngFunc_WriteCoord, vecEndPos[2]);
write_short(g_sModelIndexLaser);
write_byte(0);
write_byte(0);
write_byte(1);
write_byte(30);
write_byte(0);
write_byte(0);
write_byte(200);
write_byte(0);
write_byte(200);
write_byte(0);
}
message_end();
If You Use ScreenFade Or Shake Code:
Wrong one:
message_begin(MSG_ONE, g_iMsgScreenFade, .player = this)
write_short(iUnits);
write_short(iUnits);
write_short(FFADE_IN);
write_byte(0);
write_byte(0);
write_byte(0);
write_byte(250);
message_end();
Correct One:
message_begin(MSG_ONE, g_iMsgScreenFade, .player = this)
{
write_short(iUnits);
write_short(iUnits);
write_short(FFADE_IN);
write_byte(0);
write_byte(0);
write_byte(0);
write_byte(250);
}
message_end();
If You use status icon
Wrong code:
message_begin( MSG_ONE_UNRELIABLE, get_user_msgid("StatusIcon"), _, id );
write_byte( clamp( iStatus, 0, 2 ) ); // Status (0 = hide | 1 = show | 2 = flash)
write_string( szIcon ); // Sprite name
write_byte( clamp( iRed, 0, 255 ) ); // Red
write_byte( clamp( iGreen, 0, 255 ) ); // Green
write_byte( clamp( iBlue, 0, 255 ) ); // Blue
message_end( );
Correct One:
// Send status icon message
message_begin( MSG_ONE_UNRELIABLE, get_user_msgid("StatusIcon"), _, id );
{
write_byte( clamp( iStatus, 0, 2 ) ); // Status (0 = hide | 1 = show | 2 = flash)
write_string( szIcon ); // Sprite name
write_byte( clamp( iRed, 0, 255 ) ); // Red
write_byte( clamp( iGreen, 0, 255 ) ); // Green
write_byte( clamp( iBlue, 0, 255 ) ); // Blue
}
message_end( );
Make Sure if you start any message you need to do this
message_begin(.......)
{
add what you want
}
message_end()
Sorry For My Bad English Thanks For Anyone Read This Thread