On alot of my newer servers I try to prevent the use of CAPS. I think it makes the chat look rather horrid therefor I have chosen to introduce a new method of disabling the caps lock key.
pawn Код:
stock DisableCaps(text[])
{
for(new n=0; n<strlen(text); n++)
{
for(new nx=0; nx<sizeof(CapsL); nx++)
{
if(text[n] == CapsL[nx])
{
text[n] = NCaps[nx];
}
}
}
return text;
}
new CapsL[26][] =
{
"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O",
"P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"
};
new NCaps[26][] =
{
"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o",
"p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"
};
pawn Код:
public OnPlayerText(playerid,text[])
{
if(DisablePlayersCapKeys[playerid])
{
new Text[128];
format(Text,sizeof(Text),"%s",DisableCaps(playerid));
SendClientMessageToAll(GetPlayerColor(playerid),Text);
return 0;
}
return 1;
}