27.11.2013, 14:47
Why the heck can't I get the first character of a player name when they connect?
name[0] = 1SlonCHL, name[1] = SlonCHL, WTF
pawn Код:
public OnPlayerConnect(playerid)
{
new name[MAX_PLAYER_NAME+1];
GetPlayerName(playerid,name,sizeof(name));
printf("Name0: %s", name[0]);
printf("Name1: %s", name[1]);
if(name[0] == 0 || name[0] == 1 || name[0] == 2 || name[0] == 3 || name[0] == 4 || name[0] == 5 || name[0] == 6 || name[0] == 7 || name[0] == 8 || name[1] == 9)
{
SendClientMessage(playerid, 0xFF5E81FF, "The first character of your name cannot be a number");
SetTimerEx("InitiateKick", 500, false, "i", playerid);
}
return 1;
}
Код:
[23:41:25] [join] 1SlonCHL has joined the server (0:192.168.1.2) [23:41:25] Name0: 1SlonCHL [23:41:25] Name1: SlonCHL