SA-MP Forums Archive
auto capitalize function - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: auto capitalize function (/showthread.php?tid=127516)



auto capitalize function - Naruto4 - 13.02.2010

anyway has auto capitalize fuction of player name. so.. when he joins james_bond he gets changed to James_Bond


Re: auto capitalize function - Naruto4 - 22.02.2010

BUMP.


Re: auto capitalize function - Joe Staff - 22.02.2010

This post is on this page:
http://forum.sa-mp.com/index.php?top...4653#msg794653


Re: auto capitalize function - BlackFoX - 22.02.2010

Код:
new gname[MAX_PLAYER_NAME];
GetPlayerName(playerid,gname,sizeof gname);
toupper(gname[0]);
SetPlayerName(playerid,gname);



Re: auto capitalize function - ¤Adas¤ - 22.02.2010

This will not work. Functions tolower and toupper only return the character...
You can try this. Is it what you want?

pawn Код:
public OnPlayerConnect(playerid)
{
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
Name[0] = toupper(Name[0]);
Name[strfind(Name, "_", true) + 1] = toupper(Name[strfind(Name, "_", true) + 1]);
SetPlayerName(playerid, Name);
return true;
}



Re: auto capitalize function - BlackFoX - 22.02.2010

Sorry i forget that toupper returns it, before i thought that it Change the Char ^^