Код:
public OnPlayerConnect(playerid)
{
//**********//
Invited[playerid]= -1;
Dueling[playerid]= false;
Duelist[playerid]= -1;
TextDrawShowForPlayer(playerid, Rules);
TextDrawShowForPlayer(playerid, StartLogo);
/*TextDrawShowForPlayer(playerid, startbox);
TextDrawShowForPlayer(playerid, welcome);
TextDrawShowForPlayer(playerid, to);
TextDrawShowForPlayer(playerid, advance);
TextDrawShowForPlayer(playerid, copyright);*/
format(MessageStrl6, 170, MessageStrl5);
format(MessageStrl5, 170, MessageStrl4);
format(MessageStrl4, 170, MessageStrl3);
format(MessageStrl3, 170, MessageStrl2);
format(MessageStrl2, 170, MessageStr);
new name[MAX_PLAYER_NAME+1];
GetPlayerName(playerid, name, sizeof(name)); // getting the player name
format(MessageStr,sizeof MessageStr,"~g~[JOIN]~w~%s(~g~%d~w~) has ~g~joined ~w~the server.", name, playerid); //formatting line 3 text
new STR[510]; //creating a new string to merge the 3 strings into a one 3 lines string
format(STR, sizeof(STR), "%s~n~%s~n~%s~n~%s~n~%s~n~%s", MessageStrl6,MessageStrl5,MessageStrl4,MessageStrl3, MessageStrl2, MessageStr); //formatting the newly created string
TextDrawSetString(Message, STR); //showing it on the screen
if (udb_Exists(PlayerName2(playerid)))
{
if(PlayerInfo[playerid][LoggedIn] == 0)
{
new string[200];
format(string, sizeof(string),""cblue"Welcome "cred"%s "cblue"you are already registered\nKindly enter password to login to your account", PlayerName2(playerid));
ShowPlayerDialog(playerid, 125, DIALOG_STYLE_PASSWORD, "Login",string,"Login","Kick");
}
}
if (!udb_Exists(PlayerName2(playerid)))
{
if(PlayerInfo[playerid][Registered] == 0)
{
new string[200];
format(string, sizeof(string),""cgreen"Welcome "cred"%s "cgreen"you are not registered\nKindly enter password to register your account", PlayerName2(playerid));
ShowPlayerDialog(playerid, 126, DIALOG_STYLE_PASSWORD, "Register",string,"Register","Kick");
}
}
if(PlayerInfo[playerid][LoggedIn] == 1)
{
new pname[128];
new file[128];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), savefolder,pname);
if(!dini_Exists(file))
{
dini_Create(file);
dini_IntSet(file, "Score", 0);
dini_IntSet(file, "Money", 0);
SetPlayerScore(playerid, dini_Int(file, "Score"));
SetPlayerMoney(playerid, dini_Int(file, "Money"));
}
else
{
SetPlayerScore(playerid, dini_Int(file, "Score"));
SetPlayerMoney(playerid, dini_Int(file, "Money"));
}
}