The problem is that sometimes my server login box appears, that in some players, and the other does not, it is only 3 buttons below including spawn!
If you click on spawn times leads them to register or fall in air
But it appears to connect the box .....
Me my first box appeared
Iara and then when I came I did not appeared!
Why, help me please?!
onplayerconnect
Код:
// MySQLCheckConnection();
// Check if the account exists
new sqlaccountstatus = MySQLCheckAccount(plname);
if(sqlaccountstatus != 0)
{
// Check if the account is locked
if (MySQLCheckAccountLocked(sqlaccountstatus) != 0)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "Accountul tau este banat!(Contactea-za un admin).");
Kick(playerid);
return 1;
}
gPlayerAccount[playerid] = 1;
PlayerInfo[playerid][pSQLID] = sqlaccountstatus;
new loginstring[128];
new loginname[64];
GetPlayerName(playerid,loginname,sizeof(loginname) );
format(loginstring,sizeof(loginstring),"{BECBFC}Bine ai venit inapoi, {95A3FF}%s{BECBFC}!\n\nScrie-ti parola pentru a te conecta la server.",loginname);
ShowPlayerDialog(playerid,12346,DIALOG_STYLE_PASSWORD ,"Login",loginstring,"Login","Exit");
}
else
{
gPlayerAccount[playerid] = 0;
new regstring[128];
new regname[64];
GetPlayerName(playerid,regname,sizeof(regname));
format(regstring,sizeof(regstring),"{BECBFC}Bine ai venit, {95A3FF}%s{BECBFC}! \n\nAcest nume nu exista, inregistreaza-te apoi conecteaza-te cu parola.\n",regname);
ShowPlayerDialog(playerid,12345,DIALOG_STYLE_PASSWORD ,"Register",regstring,"Register","Exit");
}
return 1;
}
public OtherTimer()
Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if (GetPlayerState(i) == 1) CheckForWalkingTeleport(i); // IF THE PLAYER IS IN A TELEPORT ZONE, TELEPORT THEM
new vehicleid = GetPlayerVehicleID(i);
if(SafeTime[i] > 0)
{
SafeTime[i]--;
}
if(SafeTime[i] == 1)
{
if(gPlayerAccount[i] == 1 && gPlayerLogged[i] == 0)
{
new loginname[64];
new loginstring[128];
GetPlayerName(i,loginname,64);
format(loginstring,sizeof(loginstring),"{BECBFC}Bine ai venit inapoi, {95A3FF}%s{BECBFC}!\n\nScrie-ti parola pentru a te conecta la server.",loginname);
ShowPlayerDialog(i,12346,DIALOG_STYLE_PASSWORD,"Login",loginstring,"Login","Exit");
}
}
if(GetPlayerState(i) == 2)
{
GetPla
Код:
public OnPlayerRegister(playerid, password[])
{
if(IsPlayerConnected(playerid))
{
MySQLCheckConnection();
new playername3[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername3, sizeof(playername3));
new newaccountsqlid = MySQLCreateAccount(playername3, password);
if (newaccountsqlid != 0)
gPlayerAccount[playerid] = 1;
new loginstring[128];
new loginname[64];
GetPlayerName(playerid,loginname,sizeof(loginname) );
{
PlayerInfo[playerid][pSQLID] = newaccountsqlid;
strmid(PlayerInfo[playerid][pKey], password, 0, strlen(password), 255);
OnPlayerUpdateEx(playerid);
format(loginstring,sizeof(loginstring),"{BECBFC}Bine ai venit, {95A3FF}%s{BECBFC}!\n\nScrie-ti parola pentru a te conecta la server.\n",loginname);
ShowPlayerDialog(playerid,12346,DIALOG_STYLE_PASSWORD ,"Login",loginstring,"Login","Exit");
return 1;
}
onplayerlogin
Код:
if (rcnt == 117) PlayerInfo[playerid][pCarLicS] = strval(Field);
if (rcnt == 118) PlayerInfo[playerid][pFlyLicS] = strval(Field);
if (rcnt == 119) PlayerInfo[playerid][pBoatLicS] = strval(Field);
if (rcnt == 120) PlayerInfo[playerid][pGunLicS] = strval(Field);
if (rcnt == 121) PlayerInfo[playerid][pMatsLicS] = strval(Field);
if (rcnt == 122) PlayerInfo[playerid][pCap] = strval(Field);
if (rcnt == 123) PlayerInfo[playerid][pLastLogin] = strval(Field);
rcnt++;
}
// samp_mysql_free_result();
}
else
{
new loginstring[128];
new loginname[64];
GetPlayerName(playerid,loginname,sizeof(loginname));
format(loginstring,sizeof(loginstring),"{DF0101}WRONG PASSWORD\n\nPlease enter your password below to login to your account. \n\n{FFFFFF}Star Gaming",loginname);
ShowPlayerDialog(playerid,12347,DIALOG_STYLE_PASSWORD,"Login",loginstring,"Login","Exit");
//fclose(UserFile);
gPlayerLogTries[playerid] += 1;
if(gPlayerLogTries[playerid] == 4) { Kick(playerid); }
return 1;
}
new string[256];
ResetPlayerCash(playerid);
//ConsumingMoney[playerid] = 1;
CurrentMoney[playerid] = PlayerInfo[playerid][pCash];
GivePlayerCash(playerid,PlayerInfo[playerid][pCash]);
if(PlayerInfo[playerid][pReg] == 0)
{
PlayerInfo[playerid][pLevel] = 1;
PlayerInfo[playerid][pAdmin] = 0;
PlayerInfo[playerid][pDonateRank] = 0;
PlayerInfo[playerid][gPupgrade] = 0;
PlayerInfo[playerid][pReg] = 1;
Код:
if(dialogid == 12346 || dialogid == 12347)
{
if(strlen(inputtext))
{
new tmppass[64];
strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
//Encrypt(tmppass);
OnPlayerLogin(playerid,tmppass);
new playersip[24];
GetPlayerIp(playerid, playersip, sizeof(playersip));
new playername2[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername2, sizeof(playername2));
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s s-a logat cu ip: %s.",d,m,y,h,mi,s,playername2,playersip);
LoginLog(string);
}
else
{
new loginstring[128];
new loginname[64];
GetPlayerName(playerid,loginname,sizeof(loginname));
format(loginstring,sizeof(loginstring),"WRONG PASSWORD\nPlease enter the correct password:",loginname);
ShowPlayerDialog(playerid,12347,DIALOG_STYLE_INPUT,"Login",loginstring,"Login","Exit");
gPlayerLogTries[playerid] += 1;
if(gPlayerLogTries[playerid] == 5) { Ban(playerid); }
}
}
everything related to "login"