Getting a letter and using it
#1

I'm making a system where when a player connects, that players name, specifically the first name, is retrieved. It is then used to load some shit, like that player's info. However, I dont want to have to specify EVERY letter. For example,

pawn Код:
public OnPlayerConnect(playerid)
{
  new name[MAX_PLAYER_NAME],firstletter[2];
  GetPlayerName(playerid,name,sizeof(name));
  strmid(firstletter,name,0,1,sizeof(firstletter));
  switch(firstletter[0])
  {
     case 'a', 'A', 'b', 'B': print("example")
     case 'c', 'C', 'd', 'D': print("well, yeah")
  }
  return 1;
}
Cept not have to type EVERY letter. Any help?
Reply


Messages In This Thread
Getting a letter and using it - by ilikepie2221 - 21.09.2009, 23:23
Re: Getting a letter and using it - by iLinx - 21.09.2009, 23:55
Re: Getting a letter and using it - by ilikepie2221 - 22.09.2009, 01:20
Re: Getting a letter and using it - by ilikepie2221 - 22.09.2009, 23:24
Re: Getting a letter and using it - by iLinx - 22.09.2009, 23:26
Re: Getting a letter and using it - by ilikepie2221 - 22.09.2009, 23:40
Re: Getting a letter and using it - by ilikepie2221 - 23.09.2009, 20:09
Re: Getting a letter and using it - by member - 23.09.2009, 20:15
Re: Getting a letter and using it - by ilikepie2221 - 23.09.2009, 20:53

Forum Jump:


Users browsing this thread: 1 Guest(s)