Getting a letter and using it -
ilikepie2221 - 21.09.2009
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?
Re: Getting a letter and using it -
iLinx - 21.09.2009
it would make more sense if your save the ip of the players and then when a player connects if checks if the user file exists and if the 2 ips equal it logs them in automatically,
if its a autologin your making, if its not i understood wrong :[
Re: Getting a letter and using it -
ilikepie2221 - 22.09.2009
Well, people might log onto different computers to play SARP, use proxies for who knows why, etc.
Re: Getting a letter and using it -
ilikepie2221 - 22.09.2009
Superbump
Re: Getting a letter and using it -
iLinx - 22.09.2009
it wouldnt log them on though becuase it would compare the ip's first.
if your method is for a autologin it would be much less secure
Re: Getting a letter and using it -
ilikepie2221 - 22.09.2009
I'll give you a hint. A-I, J-S, R-Z, dini, player info.
Re: Getting a letter and using it -
ilikepie2221 - 23.09.2009
bumper cars
Re: Getting a letter and using it -
member - 23.09.2009
It's not clear exactly what u want. Why dont you have a look at some admin scripts if you simply want to load a player's file.
Or if you wanted to get only the player's first name for other purposes then have a look at this 'split' function by Norn:
http://forum.sa-mp.com/index.php?top...5947#msg505947
Re: Getting a letter and using it -
ilikepie2221 - 23.09.2009
Quote:
Originally Posted by [B2K
Hustler ]
It's not clear exactly what u want. Why dont you have a look at some admin scripts if you simply want to load a player's file.
Or if you wanted to get only the player's first name for other purposes then have a look at this 'split' function by Norn: http://forum.sa-mp.com/index.php?top...5947#msg505947
|
Well, thanks, but I've just solved my problem.