Calculating login being less than 5 minutes?
#1

pawn Код:
new calc = LastLogin[playerid] - 300;
            if(LastLogin[playerid] > calc)
            {
                switch(UsingSpawn[playerid])
                {
                    case 0:
                    {
                        SetSpawnInfo(playerid, 0, skin,810.7388,-1339.9355,13.5384,46.7076 + 0.3, 0,0,0,0,0,0);
                        SpawnPlayer(playerid);
                        SetCameraBehindPlayer(playerid);
                    }
                    case 1:
                    {
                        SetSpawnInfo(playerid, 0, skin,SpawnX[Faction[playerid]], SpawnY[Faction[playerid]], SpawnZ[Faction[playerid]],90, 0,0,0,0,0,0);
                        SpawnPlayer(playerid);
                        SetCameraBehindPlayer(playerid);
                    }
                    case 2:
                    {
                        for(new hs = 1; hs < MAX_HOUSES; hs++)
                        {
                            if(HouseOwner[hs] == PlayerSQLID[playerid])
                            {
                                SetSpawnInfo(playerid, 0, skin, HouseEntX[hs], HouseEntY[hs], HouseEntZ[hs], 90, 0,0,0,0,0,0);
                                SpawnPlayer(playerid);
                                SetCameraBehindPlayer(playerid);
                                break;
                            }
                        }
                    }
                }
            }
            if(LastLogin[playerid] < calc)
            {
                SetPlayerVirtualWorld(playerid, LastVW[playerid]);
                SetPlayerInterior(playerid, LastInt[playerid]);
                SetSpawnInfo(playerid, 0, skin, LastX[playerid], LastY[playerid], LastZ[playerid],0, 0,0,0,0,0,0);
                SpawnPlayer(playerid);
                SetCameraBehindPlayer(playerid);
            }
For some reason it always returns them to the default spawn.

Could someone kindly point out what I'm doing wrong.
LastLogin is definitely saving correctly.

Thanks.
Reply


Messages In This Thread
Calculating login being less than 5 minutes? - by Dokins - 03.06.2016, 17:50
Re: Calculating login being less than 5 minutes? - by ilijap - 03.06.2016, 18:33
Re: Calculating login being less than 5 minutes? - by blanic - 03.06.2016, 19:07
Re: Calculating login being less than 5 minutes? - by PrO.GameR - 03.06.2016, 23:54

Forum Jump:


Users browsing this thread: 1 Guest(s)