SA-MP Forums Archive
Capital letter. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Capital letter. (/showthread.php?tid=434370)



Capital letter. - Noliax8 - 02.05.2013

Hello,

I look for a function to put a string in capital letter.

Do you know it?


Re: Capital letter. - Pro_Drifter - 02.05.2013

what u mean share code here to help you


Re: Capital letter. - Ciandlah - 02.05.2013

ummmm....

"~w~ Come fly with me"? < Lols funniest question ive heard


Re : Capital letter. - Noliax8 - 02.05.2013

I do not understand much English. ****** helps me

For example, set Name(playerid) capitalized.

CapitalLetter(Name(playerid));


Re: Capital letter. - Ciandlah - 02.05.2013

Still dont understand you


Re : Capital letter. - Noliax8 - 02.05.2013

I wanted know if it exist a function for put a chain in capital letter or if i have to make my own function
I speak little english, look:

new string[50];
new playername[50];
GetPlayerName(playerid, playername, sizeof(playername)); // Noliax8
string = Function...?(playername); // NOLIAX8

I have not code for the moment


Re : Capital letter. - scott1 - 02.05.2013

Here you are

Код:
CapitalLetter(Text[])
{
	for(new i = 0; i < strlen(Text); i++)
	{
		if(Text[i] >= 'a' && Text[i] <= 'z')
		{
		    Text[i] -= 'a' - 'A';
		}
		else
		{
			switch (Text[i])
			{
				case 'а', 'в' :
				{
					Text[i] = 'A';
				}
				case 'й', 'и', 'к':
				{
					Text[i] = 'E';
				}
				case 'о' :
				{
					Text[i] = 'I';
				}
				case 'ф' :
				{
					Text[i] = 'O';
				}
				case 'щ', 'ы' :
				{
					Text[i] = 'U';
				}
				case 'з' :
				{
					Text[i] = 'C';
				}
			}
		}
	}
        return Text;
}
Max


Re : Capital letter. - Noliax8 - 02.05.2013

Merci Maxence je vais essayer, mais je n'est mкme pas besoin du else, vu que c'est un pseudo d'utilisateur, il n'y a pas d'accent.


Re: Capital letter. - fordawinzz - 02.05.2013

toupper


Re: Capital letter. - thefatshizms - 02.05.2013

pawn Код:
For(new i = 0; i < strlen(text); ++i)
    toupper(text[i]);