Не могу назвать себя оптимизатором, но вот мой вариант.
Сделал код более приятным (возможно усложнил НУ ЯЖ ни аптимизатор).
PHP код:
// В самый вверх мода, константы.
#define COLOR_PURPLE ( 0xE3B1E1AA )
const
Float: EAT_LEVEL_UP = 30.0;
// Участок Вашего кода.
// Для удобства.
#define level pInfo[playerid][pLevel]
new
Float: health,
_: hour;
GetPlayerHealth( playerid, health );
gettime( hour, _, _ );
if( health >= 100.0 || level > 3 )
return ( level > 3 && health < 100.0 ) ? SendClientMessage( playerid, -1, "Ошибка: Вы уже не новичок." ) : (
( health >= 100.0 && level < 3 ) ? SendClientMessage( playerid, -1, "Ошибка: Вы уже сыты." ) : 1 );
SetPlayerHealth( playerid, health + EAT_LEVEL_UP );
switch( hour )
{
case 7 .. 11: SetPlayerChatBubble( playerid, "завтракает", COLOR_PURPLE, 30, 5000 );
case 12 .. 16: SetPlayerChatBubble( playerid, "обедает", COLOR_PURPLE, 30, 5000 );
case 17 .. 21: SetPlayerChatBubble( playerid, "ужинает", COLOR_PURPLE, 30, 5000 );
default: SetPlayerChatBubble( playerid, "кушает", COLOR_PURPLE, 30, 5000 );
}
ApplyAnimation( playerid, "FOOD", "EAT_Burger", 4.1, 0, 1, 1, 0, 1 );
#undef level
return 1;