Jump to content
  • 0

Problema LastLogin


iReal.ro

Question

Am si eu o problema !

Nu imi citeste LastLogin

Folosesc MYSQL si la tabel e selectat Timer Stamp ...samp..cum e !

Iar in gm am urmatoarele !

	pLastLogin[64],

	// 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, "This account has been locked and cannot be accessed. Please contact an admin.");
        Kick(playerid);
        return 1;
    }
    gPlayerAccount[playerid] = 1;
    PlayerInfo[playerid][pSQLID] = sqlaccountstatus;
    new loginstring[128];
    new loginname[64];
    GetPlayerName(playerid,loginname,sizeof(loginname) );
	new lastlogin[64];
	lastlogin = PlayerInfo[playerid][pLastLogin];
	format(loginstring,sizeof(loginstring),"{BECBFC}Welcome back, {95A3FF}%s{BECBFC}!\n\nPlease enter your password below to login to your account. \n\n{FFFFFF}* Last Login: %s *",loginname,lastlogin);
    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}Welcome, {95A3FF}%s{BECBFC}! \n\nThis name is not registered so please register with entering a password below.\n",regname);
    ShowPlayerDialog(playerid,12345,DIALOG_STYLE_PASSWORD ,"Register",regstring,"Register","Exit");
	}
  return 1;
}
public OtherTimer()
{
	new string[256];
	new Float:oldposx, Float:oldposy, Float:oldposz;
    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);
					new lastlogin[64];
					lastlogin = PlayerInfo[i][pLastLogin];
 				format(loginstring,sizeof(loginstring),"{BECBFC}Welcome back, {95A3FF}%s{BECBFC}!\n\nPlease enter your password below to login to your account. \n\n{FFFFFF}* Last Login: %s *",loginname,lastlogin);
					ShowPlayerDialog(i,12346,DIALOG_STYLE_INPUT,"Login",loginstring,"Login","Exit");
				}
			}
			MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "LastLogin", PlayerInfo[playerid][pLastLogin]);

			if (rcnt == 110) PlayerInfo[playerid][pLastLogin] = strval(Field);

	if(PlayerInfo[playerid][pLevel] == -999) //autoban
	{
		Ban(playerid);
	}
	else if(PlayerInfo[playerid][pCK] > 0)
	{
		Kick(playerid);
	}

	// Add an entry to the login log
	new ipaddress[16];
	GetPlayerIp(playerid,ipaddress,sizeof(ipaddress));
	MySQLAddLoginRecord(PlayerInfo[playerid][pSQLID], ipaddress);

	ClearChatbox(playerid, 8);
	StopAudioStreamForPlayer(playerid);
	format(string2, sizeof(string2), "Welcome to Star Gaming, %s.",playernamesplit[0]);
	SendClientMessage(playerid, COLOR_WHITE, string2);
	printf("%s has logged in.",playername2);
	new string[256];
	new dd,mm,yy;
	new ore,mn,sec;
	getdate(yy,mm,dd);
    gettime(ore,mn,sec);
	format(string,sizeof(string),  "%d/%d/%d   %d:%d:%d",dd,mm,yy,ore,mn,sec);
	strmid(PlayerInfo[playerid][pLastLogin], string, 0, strlen(string), 255);
	SetPlayerInterior(playerid,0);
	if (PlayerInfo[playerid][pDonateRank] > 1)


ASTA E LA ONPLAYERLOGIN

si uitati cum arata !

http://postimage.org/image/nf53qkq5d/

Nu citeste lastlogin oare de ce ?!

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.