public OnPlayerConnect(playerid)
{
new string[MAX_PLAYER_NAME];
new plname[MAX_PLAYER_NAME];
gPlayerAccount[playerid] = 0;
RegistrationStep[playerid] = 0;
gPlayerLogged[playerid] = 0;
PlayerInfo[playerid][pLevel] = 0;
PlayerInfo[playerid][pCash] = 0;
PlayerInfo[playerid][pReg] = 0;
CurrentMoney[playerid] = 0;
gPlayerLogTries[playerid] = 0;
gActivePlayers[playerid]++;
SetPlayerColor(playerid,COLOR_GRAD2);
GetPlayerName(playerid, plname, sizeof(plname));
ONazwa[playerid]=plname;
format(string, sizeof(string), "Konta/%s.ini", plname);
if(fexist(string))
{
gPlayerAccount[playerid] = 1;//show login
}
else
{
gPlayerAccount[playerid] = 0;//show register
}
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
// new string[128];
if (RegistrationStep[playerid] == 0 && gPlayerLogged[playerid] != 1)
{
ClearChatbox(playerid, 10);
if (gPlayerAccount[playerid] != 0)
{
// SetPlayerCameraPos(playerid, 1111.3206,-1324.8296,72.4714);
// SetPlayerCameraLookAt(playerid, 1111.4764,-1537.8735,29.9035);
ShowPlayerDialog(playerid, LOGOWANIE, DIALOG_STYLE_PASSWORD, "Logowanie", "Witaj na polskim serwerze role play true life, ta postac jest\n zarejestrowana, wpisz haslo aby sie zalogowac:", "Zaloguj", "Wyjdz");
}
else
{
// SetPlayerCameraPos(playerid, 1111.3206,-1324.8296,72.4714);
// SetPlayerCameraLookAt(playerid, 1111.4764,-1537.8735,29.9035);
ShowPlayerDialog(playerid, REJESTRACJA, 1, "Rejestracja", "Witaj na Polskim Serwerze Role Play True Life, ta postac nie jest jeszcze\n zarejestrowana, aby ja zarejestrowac wpisz ponizej haslo dla tej postaci:", "Zarejestruj", "Wyjdz");
}
}
else
{
SpawnPlayer(playerid);
}
return 0;
}
#undef MAX_PLAYER_NAME
#define MAX_PLAYER_NAME 24
new string[MAX_PLAYER_NAME + 10]; *
To solve your problem you must increase, at least 10 cells, the size of "string" ! |
Would that be fine then?
new string[MAX_PLAYER_NAME + 12]; new plname[MAX_PLAYER_NAME + 12]; |