Help, Vortex Server Question
#7

I have run into yet another problem that occurs on the vortex host and not on my local host, with the user files... I thought it was because of the dini so I converted over to Y_INI and it does work better but it's still doing one annoying thing. It loading player positions and skins from from the last user file to log off.. For new users after the registration dialogs I have a set position for them to spawn and that works. And if I log back in with the same name it loads correctly. Then I go to a different user I already have it loads correctly. Then when I go back to the other name and log back in it spawns me at the last users location with their skin.

pawn Код:
#include <YSI\y_ini>
#define     SavePath        "RSRP/USERS/%s.ini"
pawn Код:
enum pInfo
{
    pPassword,
    pAdminLevel,
    Float:X,
    Float:Y,
    Float:Z,
    Float:A,
    pInt,
    pVW,
    pPSkin,
    pHasPhone,
    pPhoneNumber,
    pPhonebook,
    pID,
    pCash,
    pScore,
    pTutorial,
    pSex,
    pDOB,
    pMOB,
    pYOB,
    pOrigin,
    pHasMap,
    pClothes1,
    pClothes2,
    pClothes3,
    pFaggioRental,
    pFaggioID,
    pRentalRefund,
    pLegalJob,
    pJobTime,
    pFishingTime,
    pDLicense,
    pBLicense,
    pDeliveryScore,
    pSweepingScore,
    pCollectingScore,
    pFishingScore,
    pOwnsBizz,
    pLevelTime,
    pHungerTime,
    pHunger,
    Float:pHealth,
    pBank,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
pawn Код:
public OnPlayerConnect(playerid)
{
    gPlayerLogged[playerid] = 0; Mobile[playerid] = 255;
   
    check_timer[playerid] = SetTimerEx("MoneyCheck",CHECKING_INT,1,"i",playerid);
    SetPlayerWorldBounds(playerid, 20000.0000, -20000.0000, 20000.0000, -20000.0000);
    if(fexist(Path(playerid)))
    {
        INI_ParseFile(Path(playerid),"LoadUserData_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, 2, DIALOG_STYLE_PASSWORD, "Hi your registered","Welcome, Input your password below", "Login", "Leave");
        RentingFaggio[playerid] = 0;
        PlayerInfo[playerid][pFaggioID] = 0;
        PlayerInfo[playerid][pFaggioRental] = 0;
    }
    else
    {
        new INI:file = INI_Open(Path(playerid));
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Hi your not registered", "Welcome, input your new password below", "Register", "Leave");
        INI_SetTag(file,"QGRP");
        INI_WriteInt(file, "Score",PlayerInfo[playerid][pScore] = 0);
        INI_WriteInt(file, "LevelTime",PlayerInfo[playerid][pLevelTime] = 3600);
        INI_WriteInt(file, "HungerTime",PlayerInfo[playerid][pHungerTime] = 900);
        INI_WriteInt(file, "Hunger", PlayerInfo[playerid][pHunger] = 100);
        INI_WriteFloat(file, "Health", PlayerInfo[playerid][pHealth] = 100);
        INI_WriteFloat(file, "Bank", PlayerInfo[playerid][pBank] = 1000);
        INI_Close(file);
    }

    return 1;
}
pawn Код:
public OnPlayerDisconnect(playerid)
{
    if(gPlayerLogged[playerid] == 1)
    {
        new INI:file = INI_Open(Path(playerid));
        INI_WriteInt(file, "Score", PlayerInfo[playerid][pScore]);
        INI_WriteInt(file, "Money", PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid));
        INI_WriteInt(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel]);
        INI_WriteInt(file, "Int",PlayerInfo[playerid][pInt]);
        INI_WriteInt(file, "VW",PlayerInfo[playerid][pVW]);
        INI_WriteInt(file, "PSkin",PlayerInfo[playerid][pPSkin]);
        INI_WriteInt(file, "HasPhone", PlayerInfo[playerid][pHasPhone]);
        INI_WriteInt(file, "PhoneNumber", PlayerInfo[playerid][pPhoneNumber]);
        INI_WriteInt(file, "Phonebook", PlayerInfo[playerid][pPhonebook]);
        INI_WriteInt(file, "ID", PlayerInfo[playerid][pID]);
        INI_WriteInt(file, "Tutorial", PlayerInfo[playerid][pTutorial]);
        INI_WriteInt(file, "Sex", PlayerInfo[playerid][pSex]);
        INI_WriteInt(file, "DOB", PlayerInfo[playerid][pDOB]);
        INI_WriteInt(file, "MOB", PlayerInfo[playerid][pMOB]);
        INI_WriteInt(file, "YOB", PlayerInfo[playerid][pYOB]);
        INI_WriteInt(file, "Origin", PlayerInfo[playerid][pOrigin]);
        INI_WriteInt(file, "HasMap", PlayerInfo[playerid][pHasMap]);
        INI_WriteInt(file, "Clothes1", PlayerInfo[playerid][pClothes1]);
        INI_WriteInt(file, "Clothes2", PlayerInfo[playerid][pClothes2]);
        INI_WriteInt(file, "Clothes3", PlayerInfo[playerid][pClothes3]);
        INI_WriteInt(file, "FaggioRental", PlayerInfo[playerid][pFaggioRental]);
        INI_WriteInt(file, "FaggioID", PlayerInfo[playerid][pFaggioID]);
        INI_WriteInt(file, "RentalRefund", PlayerInfo[playerid][pRentalRefund]);
        INI_WriteInt(file, "LegalJob", PlayerInfo[playerid][pLegalJob]);
        INI_WriteInt(file, "JobTime", PlayerInfo[playerid][pJobTime]);
        INI_WriteInt(file, "FishingTime", PlayerInfo[playerid][pFishingTime]);
        INI_WriteInt(file, "DLicense", PlayerInfo[playerid][pDLicense]);
        INI_WriteInt(file, "BLicense", PlayerInfo[playerid][pBLicense]);
        INI_WriteInt(file, "DeliveryScore", PlayerInfo[playerid][pDeliveryScore]);
        INI_WriteInt(file, "SweepingScore", PlayerInfo[playerid][pSweepingScore]);
        INI_WriteInt(file, "CollectingScore", PlayerInfo[playerid][pCollectingScore]);
        INI_WriteInt(file, "FishingScore", PlayerInfo[playerid][pFishingScore]);
        INI_WriteInt(file, "OwnsBizz", PlayerInfo[playerid][pOwnsBizz]);
        INI_WriteInt(file, "LevelTime", PlayerInfo[playerid][pLevelTime]);
        INI_WriteInt(file, "HungerTime", PlayerInfo[playerid][pHungerTime]);
        INI_WriteInt(file, "Hunger", PlayerInfo[playerid][pHunger]);
        INI_WriteFloat(file, "Health", PlayerInfo[playerid][pHealth]);
        INI_WriteInt(file, "Bank", PlayerInfo[playerid][pBank]);
        INI_WriteFloat(file, "PositionX", x);
        INI_WriteFloat(file, "PositionY", y);
        INI_WriteFloat(file, "PositionZ", z);
        INI_WriteFloat(file, "PositionA", a);
        INI_WriteFloat(file, "Health", PlayerHealth);
        INI_Close(file);
    }
    return 1;
}
pawn Код:
if (dialogid == 2)//login dialog
    {
        new name[MAX_PLAYERS];
        GetPlayerName(playerid, name, sizeof(name));
        if(!response) return Kick(playerid);
        if (!strlen(inputtext)) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Hi your registered", "Fucken awesome mate, your registered :D. Inpute your pw below", "Login", "Leave");
        new tmp = PlayerInfo[playerid][pPassword];
        if(udb_hash(inputtext) != tmp)
        {
            SendClientMessage(playerid, COLOR_RED, "[QG'S RP]: Wrong Password");
            ShowPlayerDialog(playerid, 2, DIALOG_STYLE_PASSWORD, "Hi your registered", "Welcome, input Your Password Below", "Login", "Leave");
        }
        else
        {
            gPlayerLogged[playerid] = 1;
            SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
            SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
            GivePlayerMoney2(playerid, PlayerInfo[playerid][pCash]-GetPlayerMoney(playerid));
            SendClientMessage(playerid,COLOR_RED, "[SYSTEM]: Successfully logged in!");
            ShowProgressBarForPlayer(playerid, plhunger[playerid]);
            TextDrawShowForPlayer(playerid, hungertext);
            if(PlayerInfo[playerid][pTutorial] == 0)
            {
                SendClientMessage(playerid, COLOR_RED, "Begin Tutorial");
                TutTime[playerid] = 1;
                return 1;
            }
        }
    }
pawn Код:
forward LoadUserData_user(playerid, name[], value[]);
public LoadUserData_user(playerid, name[], value[])
{
    INI_Int("Password", PlayerInfo[playerid][pPassword]);
    INI_Int("AdminLevel", PlayerInfo[playerid][pAdminLevel]);
    INI_Float("PositionX", PlayerInfo[playerid][X]);
    INI_Float("PositionY", PlayerInfo[playerid][Y]);
    INI_Float("PositionZ", PlayerInfo[playerid][Z]);
    INI_Float("PositionA", PlayerInfo[playerid][A]);
    INI_Int("Int", PlayerInfo[playerid][pInt]);
    INI_Int("VW", PlayerInfo[playerid][pVW]);
    INI_Int("PSkin", PlayerInfo[playerid][pPSkin]);
    INI_Int("HasPhone", PlayerInfo[playerid][pHasPhone]);
    INI_Int("PhoneNumber", PlayerInfo[playerid][pPhoneNumber]);
    INI_Int("Phonebook", PlayerInfo[playerid][pPhonebook]);
    INI_Int("ID", PlayerInfo[playerid][pID]);
    INI_Int("Money", PlayerInfo[playerid][pCash]);
    INI_Int("Score", PlayerInfo[playerid][pScore]);
    INI_Int("Tutorial", PlayerInfo[playerid][pTutorial]);
    INI_Int("Sex", PlayerInfo[playerid][pSex]);
    INI_Int("DOB", PlayerInfo[playerid][pDOB]);
    INI_Int("MOB", PlayerInfo[playerid][pMOB]);
    INI_Int("YOB", PlayerInfo[playerid][pYOB]);
    INI_Int("Origin", PlayerInfo[playerid][pOrigin]);
    INI_Int("HasMap", PlayerInfo[playerid][pHasMap]);
    INI_Int("Clothes1", PlayerInfo[playerid][pClothes1]);
    INI_Int("Clothes2", PlayerInfo[playerid][pClothes2]);
    INI_Int("Clothes3", PlayerInfo[playerid][pClothes3]);
    INI_Int("FaggioRental", PlayerInfo[playerid][pFaggioRental]);
    INI_Int("FaggioID", PlayerInfo[playerid][pFaggioID]);
    INI_Int("RentalRefund", PlayerInfo[playerid][pRentalRefund]);
    INI_Int("LegalJob", PlayerInfo[playerid][pLegalJob]);
    INI_Int("JobTime", PlayerInfo[playerid][pJobTime]);
    INI_Int("FishingTime", PlayerInfo[playerid][pFishingTime]);
    INI_Int("DLicense", PlayerInfo[playerid][pDLicense]);
    INI_Int("BLicense", PlayerInfo[playerid][pBLicense]);
    INI_Int("DeliveryScore", PlayerInfo[playerid][pDeliveryScore]);
    INI_Int("SweepingScore", PlayerInfo[playerid][pSweepingScore]);
    INI_Int("CollectingScore", PlayerInfo[playerid][pCollectingScore]);
    INI_Int("FishingScore", PlayerInfo[playerid][pFishingScore]);
    INI_Int("OwnsBizz", PlayerInfo[playerid][pOwnsBizz]);
    INI_Int("LevelTime", PlayerInfo[playerid][pLevelTime]);
    INI_Int("HungerTime", PlayerInfo[playerid][pHungerTime]);
    INI_Int("Hunger", PlayerInfo[playerid][pHunger]);
    INI_Float("Health", PlayerInfo[playerid][pHealth]);
    INI_Int("Bank", PlayerInfo[playerid][pBank]);
    return 1;
}
And another thing, the ini files created by the server are empty but the info is still saved somehow!


This is a user file that I uploaded, that was created by my local host server.


This is a user file created by the server on vortex! It's blank :O

And obviously now when a player tries to log back in it tells them that the password is incorrect everytime even if it is correct, which doesn't happen on my local host
Reply


Messages In This Thread
Help, Vortex Server Question - by Quincy_Gatlin - 10.01.2014, 01:53
Re: Help, Vortex Server Question - by 1FreeHost - 10.01.2014, 05:58
Re: Help, Vortex Server Question - by Quincy_Gatlin - 10.01.2014, 06:03
Re: Help, Vortex Server Question - by Tingesport - 10.01.2014, 06:31
Re: Help, Vortex Server Question - by Quincy_Gatlin - 10.01.2014, 07:21
Re: Help, Vortex Server Question - by Tingesport - 10.01.2014, 10:15
Re: Help, Vortex Server Question - by Quincy_Gatlin - 11.01.2014, 08:19
Re: Help, Vortex Server Question - by Quincy_Gatlin - 11.01.2014, 21:25
Re: Help, Vortex Server Question - by TheOriginal1337 - 11.01.2014, 21:42
Re: Help, Vortex Server Question - by Quincy_Gatlin - 12.01.2014, 03:20

Forum Jump:


Users browsing this thread: 1 Guest(s)