26.12.2018, 04:10
pawn Код:
ShowPlayerMessage(playerid, message[], seconds = 0, sound = 0)
{
KillTimer(PLAYER_TEMP[playerid][pt_TIMERS][17]);
for(new len = strlen(message), pos; pos < len; pos ++)
{
switch(message[pos])
{
case 'а': message[pos] = 151;
case 'б': message[pos] = 152;
case 'в': message[pos] = 153;
case 'д': message[pos] = 154;
case 'А': message[pos] = 128;
case 'Б': message[pos] = 129;
case 'В': message[pos] = 130;
case 'Д': message[pos] = 131;
case 'и': message[pos] = 157;
case 'й': message[pos] = 158;
case 'к': message[pos] = 159;
case 'л': message[pos] = 160;
case 'И': message[pos] = 134;
case 'Й': message[pos] = 135;
case 'К': message[pos] = 136;
case 'Л': message[pos] = 137;
case 'м': message[pos] = 161;
case 'н': message[pos] = 162;
case 'о': message[pos] = 163;
case 'п': message[pos] = 164;
case 'М': message[pos] = 138;
case 'Н': message[pos] = 139;
case 'О': message[pos] = 140;
case 'П': message[pos] = 141;
case 'т': message[pos] = 165;
case 'у': message[pos] = 166;
case 'ф': message[pos] = 167;
case 'ц': message[pos] = 168;
case 'Т': message[pos] = 142;
case 'У': message[pos] = 143;
case 'Ф': message[pos] = 144;
case 'Ц': message[pos] = 145;
case 'щ': message[pos] = 169;
case 'ъ': message[pos] = 170;
case 'ы': message[pos] = 171;
case 'ь': message[pos] = 172;
case 'Щ': message[pos] = 146;
case 'Ъ': message[pos] = 147;
case 'Ы': message[pos] = 148;
case 'Ь': message[pos] = 149;
case 'с': message[pos] = 174;
case 'С': message[pos] = 173;
case 'Ў': message[pos] = 64;
case 'ї': message[pos] = 175;
case '`': message[pos] = 177;
case '&': message[pos] = 38;
default: message[pos] = message[pos];
}
}
PlayerTextDrawSetString(playerid, PlayerTextdraws[playerid][ptextdraw_MESSAGE], message);
PlayerTextDrawShow(playerid, PlayerTextdraws[playerid][ptextdraw_MESSAGE]);
if(seconds) PLAYER_TEMP[playerid][pt_TIMERS][17] = SetTimerEx("HidePlayerMessage", seconds * 1000, false, "i", playerid);
if(sound) PlayerPlaySoundEx(playerid, sound, 0.0, 0.0, 0.0);
return 1;
}
HidePlayerMessage(playerid);
public HidePlayerMessage(playerid)
{
KillTimer(PLAYER_TEMP[playerid][pt_TIMERS][17]);
PlayerTextDrawSetString(playerid, PlayerTextdraws[playerid][ptextdraw_MESSAGE], "_");
PlayerTextDrawHide(playerid, PlayerTextdraws[playerid][ptextdraw_MESSAGE]);
return 1;
}