05.01.2012, 16:45
Hey,
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.
Here is my code:
However this is incorrect for some reason.
Could anyone help me please
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.
Here is my code:
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"
};
Код:
C:\Users\Michael\Desktop\Los Santos Cops And Robbers\gamemodes\Server.pwn(155) : error 033: array must be indexed (variable "CapsL") C:\Users\Michael\Desktop\Los Santos Cops And Robbers\gamemodes\Server.pwn(157) : error 006: must be assigned to an array C:\Users\Michael\Desktop\Los Santos Cops And Robbers\gamemodes\Server.pwn(526) : error 035: argument type mismatch (argument 1) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Errors.
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;
}