What is wrong with with this age?
#1

So problem is that it ain't saving it shows all correctly but doesnt save a age why?
So basically what I did was taken out tutorial system and set login as last but I don't know wht it's not saving..
When I login it shows in stats age 0...
pawn Код:
else if(dialogid == 2) // Login
    {
        if(response)
        {
            new file[64], password[256], IP[16], password2[256];
            format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
            WP_Hash(password2, sizeof(password2), inputtext);
            format(password, sizeof(password), "%s", dini_Get(file, "Password"));
            if(strcmp(password, inputtext,true) && strcmp(password, password2, true))
            {
                SendClientMessage(playerid, COLOR_WHITE, "SERVER: Invalid password.");
                ShowDialog(playerid, 2);
                return 1;
            }
            if(dini_Int(file, "AdminAccount") == 1)
            {
                SendClientMessage(playerid, COLOR_WHITE, "SERVER: You can't login directly from an admin account.");
                Kick(playerid);
                return 1;
            }
            else if(sscanf(inputtext, "s[128]", inputtext))
            {
                SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must enter a password to procceed.");
                ShowDialog(playerid, 2);
                return 1;
            }
            else
            {
                SendClientMessage(playerid, COLOR_LIME, "");
                SendClientMessage(playerid, COLOR_LIME, "");
                SendClientMessage(playerid, COLOR_LIME, "");
                SendClientMessage(playerid, COLOR_LIME, "");
                SendClientMessage(playerid, COLOR_LIME, "");
                SendClientMessage(playerid, COLOR_LIME, "");
                SendClientMessage(playerid, COLOR_LIME, "");
                SendClientMessage(playerid, COLOR_LIME, "");
                SendClientMessage(playerid, COLOR_LIME, "");
                SendClientMessage(playerid, COLOR_LIME, "");
                format(PlayerInfo[playerid][pIP], 16, "%s", dini_Get(file, "IP"));
                GetPlayerIp(playerid, IP, sizeof(IP));
                dini_Set(file, "IP", IP);
                PlayerInfo[playerid][pGender] = dini_Int(file, "Gender");
                PlayerInfo[playerid][pAge] = dini_Int(file, "Age");
                LoadChar(playerid);
                PlayerInfo[playerid][pTutorial] = 1;
                SpawnChar(playerid);
                TogglePlayerControllable(playerid, 1);
                SetPlayerVirtualWorld(playerid, 0);
                SendClientMessage(playerid, COLOR_WHITE, "SERVER: You have chosen not to see the tutorial, welcome to "SCRIPT_NAME".");
                PlayerInfo[playerid][pNew] = 1;
                PlayerInfo[playerid][pModel] = 299;
                SetPlayerSkin(playerid, 299);
                PlayerInfo[playerid][pFightStyle] = FIGHT_STYLE_NORMAL;
                SpawnPlayer(playerid);
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "SERVER: You have chosen to quit the server.");
            Kick(playerid);
        }
    }
Here is my stock:
pawn Код:
stock SaveChar(playerid)
{
    if(IsPlayerLoggedIn(playerid))
    {
        if(PlayerInfo[playerid][pTutorial])
        {
            new file[64];
            format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
            if(!dini_Exists(file)) dini_Create(file);
            if(!Event[playerid])
            {
                PlayerInfo[playerid][pInt] = GetPlayerInterior(playerid);
                PlayerInfo[playerid][pVW] = GetPlayerVirtualWorld(playerid);
                GetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
                GetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
                GetPlayerArmour(playerid, PlayerInfo[playerid][pArmor]);
            }
            if(PlayerInfo[playerid][pLevel] == 0) PlayerInfo[playerid][pLevel] = 1;
            PlayerInfo[playerid][pModel] = GetPlayerSkin(playerid);
            if(PlayerInfo[playerid][vModel])
            {
                GetVehiclePos(PlayerInfo[playerid][pVeh],PlayerInfo[playerid][vX], PlayerInfo[playerid][vY], PlayerInfo[playerid][vZ]);
                GetVehicleZAngle(PlayerInfo[playerid][pVeh],PlayerInfo[playerid][vA]);
            }
            if(PlayerInfo[playerid][vVModel])
            {
                GetVehiclePos(PlayerInfo[playerid][pVVeh],PlayerInfo[playerid][vVX], PlayerInfo[playerid][vVY], PlayerInfo[playerid][vVZ]);
                GetVehicleZAngle(PlayerInfo[playerid][pVVeh],PlayerInfo[playerid][vVA]);
            }
            SaveSafeAmmo(playerid);
            // Save
            dini_Set(file, "IP", PlayerInfo[playerid][pIP]);
            dini_IntSet(file, "Gender", PlayerInfo[playerid][pGender]);
            dini_IntSet(file, "Level", PlayerInfo[playerid][pLevel]);
            dini_IntSet(file, "Minutes", PlayerInfo[playerid][pMinutes]);
            dini_IntSet(file, "Hours", PlayerInfo[playerid][pHours]);
            dini_IntSet(file, "Age", PlayerInfo[playerid][pAge]);
            dini_IntSet(file, "Religion", PlayerInfo[playerid][pReligion]);
            dini_IntSet(file, "City", PlayerInfo[playerid][City]);
            dini_IntSet(file, "Cash", PlayerInfo[playerid][pMoney]);
            dini_IntSet(file, "Bank", PlayerInfo[playerid][pBank]);
            dini_IntSet(file, "Model", PlayerInfo[playerid][pModel]);
            dini_IntSet(file, "Admin", PlayerInfo[playerid][pAdmin]);
            dini_IntSet(file, "pBanned", PlayerInfo[playerid][pBanned]);
            dini_FloatSet(file, "X", PlayerInfo[playerid][pX]);
            dini_FloatSet(file, "Y", PlayerInfo[playerid][pY]);
            dini_FloatSet(file, "Z", PlayerInfo[playerid][pZ]);
            dini_IntSet(file, "Int", PlayerInfo[playerid][pInt]);
            dini_IntSet(file, "VW", PlayerInfo[playerid][pVW]);
            dini_IntSet(file, "Fac", PlayerInfo[playerid][pFac]);
            dini_IntSet(file, "FacRank", PlayerInfo[playerid][pFacRank]);
            dini_IntSet(file, "FacLeader", PlayerInfo[playerid][pFacLeader]);
            dini_IntSet(file, "FacDiv", PlayerInfo[playerid][pFacDiv]);
            dini_IntSet(file, "FacDivLeader", PlayerInfo[playerid][pFacDivLeader]);
            dini_IntSet(file, "Duty", PlayerInfo[playerid][pFacDuty]);
            dini_IntSet(file, "wSlot0", PlayerInfo[playerid][pWeapon][0]);
            dini_IntSet(file, "wSlot0Ammo", PlayerInfo[playerid][pWeaponAmmo][0]);
            dini_IntSet(file, "wSlot1", PlayerInfo[playerid][pWeapon][1]);
            dini_IntSet(file, "wSlot1Ammo", PlayerInfo[playerid][pWeaponAmmo][1]);
            dini_IntSet(file, "wSlot2", PlayerInfo[playerid][pWeapon][2]);
            dini_IntSet(file, "wSlot2Ammo", PlayerInfo[playerid][pWeaponAmmo][2]);
            dini_IntSet(file, "wSlot3", PlayerInfo[playerid][pWeapon][3]);
            dini_IntSet(file, "wSlot3Ammo", PlayerInfo[playerid][pWeaponAmmo][3]);
            dini_IntSet(file, "wSlot4", PlayerInfo[playerid][pWeapon][4]);
            dini_IntSet(file, "wSlot4Ammo", PlayerInfo[playerid][pWeaponAmmo][4]);
            dini_IntSet(file, "wSlot5", PlayerInfo[playerid][pWeapon][5]);
            dini_IntSet(file, "wSlot5Ammo", PlayerInfo[playerid][pWeaponAmmo][5]);
            dini_IntSet(file, "wSlot6", PlayerInfo[playerid][pWeapon][6]);
            dini_IntSet(file, "wSlot6Ammo", PlayerInfo[playerid][pWeaponAmmo][6]);
            dini_IntSet(file, "wSlot7", PlayerInfo[playerid][pWeapon][7]);
            dini_IntSet(file, "wSlot7Ammo", PlayerInfo[playerid][pWeaponAmmo][7]);
            dini_IntSet(file, "wSlot8", PlayerInfo[playerid][pWeapon][8]);
            dini_IntSet(file, "wSlot8Ammo", PlayerInfo[playerid][pWeaponAmmo][8]);
            dini_IntSet(file, "wSlot9", PlayerInfo[playerid][pWeapon][9]);
            dini_IntSet(file, "wSlot9Ammo", PlayerInfo[playerid][pWeaponAmmo][9]);
            dini_IntSet(file, "wSlot10", PlayerInfo[playerid][pWeapon][10]);
            dini_IntSet(file, "wSlot10Ammo", PlayerInfo[playerid][pWeaponAmmo][10]);
            dini_IntSet(file, "wSlot11", PlayerInfo[playerid][pWeapon][11]);
            dini_IntSet(file, "wSlot11Ammo", PlayerInfo[playerid][pWeaponAmmo][11]);
            dini_IntSet(file, "wSlot12", PlayerInfo[playerid][pWeapon][12]);
            dini_IntSet(file, "wSlot12Ammo", PlayerInfo[playerid][pWeaponAmmo][12]);
            dini_IntSet(file, "Hospital", PlayerInfo[playerid][pHospital]);
            dini_IntSet(file, "Business", PlayerInfo[playerid][pBiz]);
            dini_IntSet(file, "VBusiness", PlayerInfo[playerid][pVBiz]);
            dini_IntSet(file, "House", PlayerInfo[playerid][pHouse]);
            dini_IntSet(file, "SafeAdmin", PlayerInfo[playerid][pSafeAdmin]);
            dini_IntSet(file, "vHouse", PlayerInfo[playerid][pVHouse]);
            dini_IntSet(file, "BizOwner", PlayerInfo[playerid][pOwner]);
            dini_IntSet(file, "Job", PlayerInfo[playerid][pJob]);
            dini_IntSet(file, "Mechanic", PlayerInfo[playerid][pJobSkill][JOB_MECHANIC]);
            dini_IntSet(file, "Lawyer", PlayerInfo[playerid][pJobSkill][JOB_LAWYER]);
            dini_IntSet(file, "Trucker", PlayerInfo[playerid][pJobSkill][JOB_TRUCKER]);
            dini_IntSet(file, "Fisher", PlayerInfo[playerid][pJobSkill][JOB_FISHER]);
            dini_IntSet(file, "WDealer", PlayerInfo[playerid][pJobSkill][JOB_WDEALER]);
            dini_IntSet(file, "WSmuggler", PlayerInfo[playerid][pJobSkill][JOB_WSMUGGLER]);
            dini_IntSet(file, "DDealer", PlayerInfo[playerid][pJobSkill][JOB_DDEALER]);
            dini_IntSet(file, "DSmuggler", PlayerInfo[playerid][pJobSkill][JOB_DSMUGGLER]);
            dini_IntSet(file, "CarJacker", PlayerInfo[playerid][pJobSkill][JOB_CARJACKER]);
            dini_IntSet(file, "Boxer", PlayerInfo[playerid][pJobSkill][JOB_BOXER]);
            dini_IntSet(file, "Fisher", PlayerInfo[playerid][pJobSkill][JOB_FISHER]);
            dini_IntSet(file, "TPackages", PlayerInfo[playerid][pTPackages]);
            dini_IntSet(file, "WPackages", PlayerInfo[playerid][pMPackages]);
            dini_IntSet(file, "Materials", PlayerInfo[playerid][pMaterials]);
            dini_IntSet(file, "HasCellphone", PlayerInfo[playerid][pHasCellphone]);
            dini_IntSet(file, "Cellphone", PlayerInfo[playerid][pCellphone]);
            dini_IntSet(file, "Phonebook", PlayerInfo[playerid][pPhonebook]);
            dini_IntSet(file, "Dice", PlayerInfo[playerid][pDice]);
            dini_IntSet(file, "Cigar", PlayerInfo[playerid][pCigar]);
            dini_IntSet(file, "Speedo", PlayerInfo[playerid][pSpeedo]);
            dini_IntSet(file, "Sprunk", PlayerInfo[playerid][pSprunk]);
            dini_IntSet(file, "Spray", PlayerInfo[playerid][pSpray]);
            dini_IntSet(file, "Rope", PlayerInfo[playerid][pRope]);
            dini_IntSet(file, "Blindfold", PlayerInfo[playerid][pBlindfold]);
            dini_IntSet(file, "PR", PlayerInfo[playerid][pPR]);
            dini_IntSet(file, "PRFreq", PlayerInfo[playerid][pPRF]);
            dini_IntSet(file, "Gas", PlayerInfo[playerid][pGas]);
            dini_IntSet(file, "Radio", PlayerInfo[playerid][pRadio]);
            dini_FloatSet(file, "Health", PlayerInfo[playerid][pHealth]);
            dini_FloatSet(file, "Armor", PlayerInfo[playerid][pArmor]);
            dini_IntSet(file, "Internet", PlayerInfo[playerid][pInternet]);
            dini_IntSet(file, "Song1", PlayerInfo[playerid][pSong][1]);
            dini_IntSet(file, "Song2", PlayerInfo[playerid][pSong][2]);
            dini_IntSet(file, "Prison", PlayerInfo[playerid][pPrison]);
            dini_IntSet(file, "PrisonTime", PlayerInfo[playerid][pPrisonTime]);
            dini_Set(file, "PrisonReason", PlayerInfo[playerid][pPrisonReason]);
            dini_Set(file, "PrisonBy", PlayerInfo[playerid][pPrisonBy]);
            dini_IntSet(file, "Wanted", PlayerInfo[playerid][pWanted]);
            dini_Set(file, "Wanted1", PlayerInfo[playerid][pWanted1]);
            dini_Set(file, "Wanted2", PlayerInfo[playerid][pWanted2]);
            dini_Set(file, "Wanted3", PlayerInfo[playerid][pWanted3]);
            dini_Set(file, "Wanted4", PlayerInfo[playerid][pWanted4]);
            dini_Set(file, "Wanted5", PlayerInfo[playerid][pWanted5]);
            dini_Set(file, "Wanted6", PlayerInfo[playerid][pWanted6]);
            dini_IntSet(file, "Crimes", PlayerInfo[playerid][pCrimes]);
            dini_IntSet(file, "Arrested", PlayerInfo[playerid][pArrested]);
            dini_IntSet(file, "DPackages", PlayerInfo[playerid][pDPackages]);
            dini_IntSet(file, "Weed", PlayerInfo[playerid][pWeed]);
            dini_IntSet(file, "Crack", PlayerInfo[playerid][pCrack]);
            dini_IntSet(file, "Contract", PlayerInfo[playerid][pContract]);
            dini_Set(file, "ContractBy", PlayerInfo[playerid][pContractBy]);
            dini_IntSet(file, "Tutorial", PlayerInfo[playerid][pTutorial]);
            dini_IntSet(file, "Warns", PlayerInfo[playerid][pWarns]);
            dini_Set(file, "Warn1", PlayerInfo[playerid][pWarn1]);
            dini_Set(file, "Warn2", PlayerInfo[playerid][pWarn2]);
            dini_Set(file, "Warn3", PlayerInfo[playerid][pWarn3]);
            dini_Set(file, "Flag", PlayerInfo[playerid][pFlag]);
            dini_IntSet(file, "NMute", PlayerInfo[playerid][pNMute]);
            dini_IntSet(file, "SpawnFreeze", PlayerInfo[playerid][pSpawnFreeze]);
            dini_IntSet(file, "Fam", PlayerInfo[playerid][pFam]);
            dini_IntSet(file, "FamRank", PlayerInfo[playerid][pFamRank]);
            dini_IntSet(file, "CSuccess", PlayerInfo[playerid][pCSuccess]);
            dini_IntSet(file, "CFail", PlayerInfo[playerid][pCFail]);
            dini_IntSet(file, "Helper", PlayerInfo[playerid][pHelper]);
            dini_IntSet(file, "vModel", PlayerInfo[playerid][vModel]);
            dini_FloatSet(file, "vX", PlayerInfo[playerid][vX]);
            dini_FloatSet(file, "vY", PlayerInfo[playerid][vY]);
            dini_FloatSet(file, "vZ", PlayerInfo[playerid][vZ]);
            dini_FloatSet(file, "vA", PlayerInfo[playerid][vA]);
            dini_IntSet(file, "vC1", PlayerInfo[playerid][vC1]);
            dini_IntSet(file, "vC2", PlayerInfo[playerid][vC2]);
            dini_IntSet(file, "vPJ", PlayerInfo[playerid][vPJ]);
            dini_IntSet(file, "vLocked", PlayerInfo[playerid][vLocked]);
            dini_IntSet(file, "GangMod", PlayerInfo[playerid][pGangMod]);
            dini_IntSet(file, "FacMod", PlayerInfo[playerid][pFacMod]);
            dini_IntSet(file, "BanAppealer", PlayerInfo[playerid][pBanAppealer]);
            dini_IntSet(file, "CarLicense", PlayerInfo[playerid][pCarLic]);
            dini_IntSet(file, "vModSlot0",PlayerInfo[playerid][pVehMod][0]);
            dini_IntSet(file, "vModSlot1",PlayerInfo[playerid][pVehMod][1]);
            dini_IntSet(file, "vModSlot2",PlayerInfo[playerid][pVehMod][2]);
            dini_IntSet(file, "vModSlot3",PlayerInfo[playerid][pVehMod][3]);
            dini_IntSet(file, "vModSlot4",PlayerInfo[playerid][pVehMod][4]);
            dini_IntSet(file, "vModSlot5",PlayerInfo[playerid][pVehMod][5]);
            dini_IntSet(file, "vModSlot6",PlayerInfo[playerid][pVehMod][6]);
            dini_IntSet(file, "vModSlot7",PlayerInfo[playerid][pVehMod][7]);
            dini_IntSet(file, "vModSlot8",PlayerInfo[playerid][pVehMod][8]);
            dini_IntSet(file, "vModSlot9",PlayerInfo[playerid][pVehMod][9]);
            dini_IntSet(file, "vModSlot10",PlayerInfo[playerid][pVehMod][10]);
            dini_IntSet(file, "vModSlot11",PlayerInfo[playerid][pVehMod][11]);
            dini_IntSet(file, "vModSlot12",PlayerInfo[playerid][pVehMod][12]);
            dini_IntSet(file, "vModSlot13",PlayerInfo[playerid][pVehMod][13]);
            dini_IntSet(file, "VIP", PlayerInfo[playerid][pVIP]);
            dini_IntSet(file, "VIPBuddy", PlayerInfo[playerid][pVIPBuddy]);
            dini_IntSet(file, "VIPDay", PlayerInfo[playerid][pVIPDay]);
            dini_IntSet(file, "VIPMonth", PlayerInfo[playerid][pVIPMonth]);
            dini_IntSet(file, "VIPHour", PlayerInfo[playerid][pVIPHour]);
            dini_IntSet(file, "VIPJob", PlayerInfo[playerid][pVIPJob]);
            dini_IntSet(file, "VIPTemp", PlayerInfo[playerid][pVIPTemp]);
            // VIP CAR
            dini_IntSet(file, "vVModel", PlayerInfo[playerid][vVModel]);
            dini_FloatSet(file, "vVX", PlayerInfo[playerid][vVX]);
            dini_FloatSet(file, "vVY", PlayerInfo[playerid][vVY]);
            dini_FloatSet(file, "vVZ", PlayerInfo[playerid][vVZ]);
            dini_FloatSet(file, "vVA", PlayerInfo[playerid][vVA]);
            dini_IntSet(file, "vVC1", PlayerInfo[playerid][vVC1]);
            dini_IntSet(file, "vVC2", PlayerInfo[playerid][vVC2]);
            dini_IntSet(file, "vVPJ", PlayerInfo[playerid][vVPJ]);
            dini_IntSet(file, "vVLocked", PlayerInfo[playerid][vVLocked]);
            dini_IntSet(file, "vVModSlot0",PlayerInfo[playerid][pVVehMod][0]);
            dini_IntSet(file, "vVModSlot1",PlayerInfo[playerid][pVVehMod][1]);
            dini_IntSet(file, "vVModSlot2",PlayerInfo[playerid][pVVehMod][2]);
            dini_IntSet(file, "vVModSlot3",PlayerInfo[playerid][pVVehMod][3]);
            dini_IntSet(file, "vVModSlot4",PlayerInfo[playerid][pVVehMod][4]);
            dini_IntSet(file, "vVModSlot5",PlayerInfo[playerid][pVVehMod][5]);
            dini_IntSet(file, "vVModSlot6",PlayerInfo[playerid][pVVehMod][6]);
            dini_IntSet(file, "vVModSlot7",PlayerInfo[playerid][pVVehMod][7]);
            dini_IntSet(file, "vVModSlot8",PlayerInfo[playerid][pVVehMod][8]);
            dini_IntSet(file, "vVModSlot9",PlayerInfo[playerid][pVVehMod][9]);
            dini_IntSet(file, "vVModSlot10",PlayerInfo[playerid][pVVehMod][10]);
            dini_IntSet(file, "vVModSlot11",PlayerInfo[playerid][pVVehMod][11]);
            dini_IntSet(file, "vVModSlot12",PlayerInfo[playerid][pVVehMod][12]);
            dini_IntSet(file, "vVModSlot13",PlayerInfo[playerid][pVVehMod][13]);
            dini_IntSet(file, "DeliverTruck", PlayerInfo[playerid][pDeliverTruck]);
            dini_IntSet(file, "New", PlayerInfo[playerid][pNew]);
            dini_IntSet(file, "RefPoints", PlayerInfo[playerid][pRefPoints]);
            dini_IntSet(file, "Tester", PlayerInfo[playerid][pTester]);
            dini_IntSet(file, "FightStyle", PlayerInfo[playerid][pFightStyle]);
            dini_IntSet(file, "Scope", PlayerInfo[playerid][pScope]);
            dini_IntSet(file, "Cookies", PlayerInfo[playerid][pCookies]);
            dini_IntSet(file, "OldSchool", PlayerInfo[playerid][pOldSchool]);
            dini_IntSet(file, "Reward", PlayerInfo[playerid][pReward]);
            dini_IntSet(file, "Fish1", PlayerInfo[playerid][pFish][0]);
            dini_IntSet(file, "Fish2", PlayerInfo[playerid][pFish][1]);
            dini_IntSet(file, "Fish3", PlayerInfo[playerid][pFish][2]);
            dini_IntSet(file, "Fish4", PlayerInfo[playerid][pFish][3]);
            dini_IntSet(file, "Fish5", PlayerInfo[playerid][pFish][4]);
            SaveToys(playerid, file);
            dini_IntSet(file, "Loyal", PlayerInfo[playerid][pLoyal]);
            dini_IntSet(file, "LoyalTag", PlayerInfo[playerid][pLoyalTag]);
            dini_IntSet(file, "LPoints", PlayerInfo[playerid][pLPoints]);
            dini_IntSet(file, "Gate1", PlayerInfo[playerid][pGate][0]);
            dini_IntSet(file, "Gate2", PlayerInfo[playerid][pGate][1]);
            dini_IntSet(file, "Gate3", PlayerInfo[playerid][pGate][2]);
        }
    }
    return 1;
}
Reply
#2

Show me where you change the value to the variable PlayerInfo[playerid][pAge].

o use:
pawn Код:
PlayerInfo[playerid][pAge] = dini_Get(file, "Age");
Reply
#3

pawn Код:
else if(dialogid == 4)
    {
        if(response)
        {
            new age = strval(inputtext);
            if(VIP[playerid])
            {
                if(age < 18 || age > 90)
                {
                    SendClientMessage(playerid, COLOR_WHITE, "SERVER: Age must be beteen 18 and 90.");
                    ShowDialog(playerid, 4);
                }
                else
                {
                    new string[128];
                    PlayerInfo[playerid][pAge] = strval(inputtext);
                    format(string, sizeof(string), "SERVER: You've set your character's age to %d", PlayerInfo[playerid][pAge]);
                    SendClientMessage(playerid, COLOR_WHITE, string);
                }
                VIP[playerid] = 0;
            }
            else
            {
                if(age < 18 || age > 90)
                {
                    SendClientMessage(playerid, COLOR_WHITE, "SERVER: Age must be beteen 18 and 90.");
                    ShowDialog(playerid, 4);
                }
                else
                {
                    new string[128];
                    PlayerInfo[playerid][pAge] = strval(inputtext);
                    format(string, sizeof(string), "SERVER: You've set your character's age to %d", PlayerInfo[playerid][pAge]);
                    SendClientMessage(playerid, COLOR_WHITE, string);
                }
            }
        }
        else
        {
            if(!VIP[playerid])
            {
                SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must pick an age for your character.");
                ShowDialog(playerid, 4);
            }
            VIP[playerid] = 0;
        }
        ShowPlayerDialog(playerid, dregister2, DIALOG_STYLE_LIST, "Okay. Where are you from?","Los Santos\nSan Fierro\nLas Venturas\nVice City\nLiberty City\n", "Select", "Cancel");
    }
Reply
#4

pawn Код:
else if(dialogid == 4)
    {
        if(response)
        {
            new age = strval(inputtext);
            if(VIP[playerid])
            {
                if(age < 18 || age > 90)
                {
                    SendClientMessage(playerid, COLOR_WHITE, "SERVER: Age must be beteen 18 and 90.");
                    ShowDialog(playerid, 4);
                }
                else
                {
                    new string[128];
                    PlayerInfo[playerid][pAge] = age;
                    format(string, sizeof(string), "SERVER: You've set your character's age to %d", PlayerInfo[playerid][pAge]);
                    SendClientMessage(playerid, COLOR_WHITE, string);
                }
                VIP[playerid] = 0;
            }
            else
            {
                if(age < 18 || age > 90)
                {
                    SendClientMessage(playerid, COLOR_WHITE, "SERVER: Age must be beteen 18 and 90.");
                    ShowDialog(playerid, 4);
                }
                else
                {
                    new string[128];
                    PlayerInfo[playerid][pAge] = age;
                    format(string, sizeof(string), "SERVER: You've set your character's age to %d", PlayerInfo[playerid][pAge]);
                    SendClientMessage(playerid, COLOR_WHITE, string);
                }
            }
        }
        else
        {
            if(!VIP[playerid])
            {
                SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must pick an age for your character.");
                ShowDialog(playerid, 4);
            }
            VIP[playerid] = 0;
        }
        ShowPlayerDialog(playerid, dregister2, DIALOG_STYLE_LIST, "Okay. Where are you from?","Los Santos\nSan Fierro\nLas Venturas\nVice City\nLiberty City\n", "Select", "Cancel");
    }
Reply
#5

Still the same problem...

Here is what I deleted...
pawn Код:
forward Tut1(playerid);
public Tut1(playerid)
{
    TextDrawShowForPlayer(playerid, TutorialTD);
    SetPlayerInterior(playerid, 0);
    SetPlayerVirtualWorld(playerid, 94375);
    TogglePlayerControllable(playerid, 0);
    SetPlayerCameraPos(playerid, 1668.9432,-1458.1198,120.6119);
    SetPlayerCameraLookAt(playerid,1586.5640,-1281.9943,120.6119);
    SetPlayerPos(playerid,1582.0026,-1274.0721,119.7132);
    SendClientMessage(playerid, COLOR_LIME, "_____| "SCRIPT_NAME" Tutorial |_____");
    SendClientMessage(playerid, COLOR_WHITE, "A very hearty and warm welcome to "SCRIPT_NAME"!");
    SendClientMessage(playerid, COLOR_WHITE, "As this is probably your first time here you'll have to go through our tutorial.");
    SendClientMessage(playerid, COLOR_WHITE, "The tutorial is essential to get known to important things we have currently here.");
    SendClientMessage(playerid, COLOR_RED,   "Please concentrate because the tutorial will have lots of information about the gameplay.");
    SendClientMessage(playerid, COLOR_WHITE, "Here is a short introduction to the "SCRIPT_NAME" Development Team.");
    SendClientMessage(playerid, COLOR_WHITE, "* Server Development Team:");
    SendClientMessage(playerid, COLOR_WHITE, "Head Developers: Vishnu");
    SendClientMessage(playerid, COLOR_WHITE, "Senior Developers: N/A");
    SendClientMessage(playerid, COLOR_WHITE, "Junior Developers: N/A");
    Tut[playerid] = SetTimerEx("Tut2", 12000, false, "i", playerid);
    return 1;
}
forward Tut2(playerid);
public Tut2(playerid)
{
    InterpolateCameraPos(playerid, 1668.9432,-1458.1198,120.6119, 1506.6499,-1675.8396,41.2007, 3000, CAMERA_MOVE);
    InterpolateCameraLookAt(playerid, 1586.5640,-1281.9943,120.6119, 1554.6344,-1675.5366,16.1953, 3000, CAMERA_MOVE);
    SetPlayerPos(playerid,1554.6344,-1675.5366,16.1953-3);
    SendClientMessage(playerid, COLOR_LIME, "_____| Tutorial: Part 1 - Factions |_____");
    SendClientMessage(playerid, COLOR_WHITE, "In "SCRIPT_NAME" we have some factions, we will only speak about two of them:");
    SendClientMessage(playerid, COLOR_WHITE, "");
    SendClientMessage(playerid, COLOR_LIME, "- Los Santos Police Department [LSPD]");
    SendClientMessage(playerid, COLOR_WHITE, " The LSPD is the only Law Enforcement Faction on "SCRIPT_NAME".");
    SendClientMessage(playerid, COLOR_WHITE, " This means it takes care of everything related to law and crimes.");
    SendClientMessage(playerid, COLOR_WHITE, " If you get arrested you will be transported to the prison which is also being guarded by the LSPD");
    SendClientMessage(playerid, COLOR_WHITE, "");
    SendClientMessage(playerid, COLOR_WHITE, "If you wish to be come an officer you can apply on "SCRIPT_WEBURL"");
    SendClientMessage(playerid, COLOR_WHITE, "");
    Tut[playerid] = SetTimerEx("Tut3", 16000, false, "i", playerid);
    return 1;
}
forward Tut3(playerid);
public Tut3(playerid)
{
    InterpolateCameraPos(playerid, 1506.6499,-1675.8396,41.2007, 1444.9666,-1709.8527,42.3163, 3000, CAMERA_MOVE);
    InterpolateCameraLookAt(playerid, 1554.6344,-1675.5366,16.1953, 1483.7808,-1762.6996,18.7958, 3000, CAMERA_MOVE);
    SetPlayerPos(playerid,1483.7808,-1762.6996,18.7958-3);
    SendClientMessage(playerid, COLOR_LIME, "- The Government [Los Santos Executive Branch]");
    SendClientMessage(playerid, COLOR_WHITE, " The Government is a political faction, which means they don't get weapons from the state, etc.");
    SendClientMessage(playerid, COLOR_WHITE, " The Government basically consists of the president and their staff who are elected by civilians.");
    SendClientMessage(playerid, COLOR_WHITE, "");
    SendClientMessage(playerid, COLOR_WHITE, " The government's role is to make laws for the LSPD to follow, set taxes on civilians");
    SendClientMessage(playerid, COLOR_WHITE, " and finally to pay LSPD their paychecks.");
    SendClientMessage(playerid, COLOR_WHITE, "");
    SendClientMessage(playerid, COLOR_WHITE, " If you wish to be a part of the government you can apply on "SCRIPT_WEBURL"");
    SendClientMessage(playerid, COLOR_WHITE, "");
    SendClientMessage(playerid, COLOR_WHITE, "");
    Tut[playerid] = SetTimerEx("Tut4", 16000, false, "i", playerid);
    return 1;
}
forward Tut4(playerid);
public Tut4(playerid)
{
    InterpolateCameraPos(playerid, 1444.9666,-1709.8527,42.3163, 2441.1738,-1698.3149,31.4247, 3000, CAMERA_MOVE);
    InterpolateCameraLookAt(playerid, 1483.7808,-1762.6996,18.7958, 2507.3250,-1648.5522,13.8510, 3000, CAMERA_MOVE);
    /*SetPlayerCameraPos(playerid,2441.1738,-1698.3149,31.4247);
    SetPlayerCameraLookAt(playerid, 2507.3250,-1648.5522,13.8510);*/

    SetPlayerPos(playerid,2507.3250,-1648.5522,13.8510-3);
    SendClientMessage(playerid, COLOR_LIME, "_____| Tutorial: Part 2 - Families |_____");
    SendClientMessage(playerid, COLOR_WHITE, "There are 10 family slots in "SCRIPT_NAME".");
    SendClientMessage(playerid, COLOR_WHITE, "This means the maximum official families around is 10, this is to keep order on the server.");
    SendClientMessage(playerid, COLOR_WHITE, "");
    SendClientMessage(playerid, COLOR_WHITE, "You may still create your own unofficial family and roleplay your way with it.");
    SendClientMessage(playerid, COLOR_WHITE, "");
    SendClientMessage(playerid, COLOR_WHITE, "");
    SendClientMessage(playerid, COLOR_WHITE, "If you wish to join a family you should contact family leaders ICly about it, found on /families.");
    SendClientMessage(playerid, COLOR_WHITE, "");
    SendClientMessage(playerid, COLOR_WHITE, "If you wish to create your own family, a spot can be applied for on "SCRIPT_WEBURL"");
    Tut[playerid] = SetTimerEx("Tut5", 16000, false, "i", playerid);
    return 1;
}
forward Tut5(playerid);
public Tut5(playerid)
{
    InterpolateCameraPos(playerid, 2441.1738,-1698.3149,31.4247, 1733.3695,2300.4736,28.1169, 3000, CAMERA_MOVE);
    InterpolateCameraLookAt(playerid,2507.3250,-1648.5522,13.8510, 1677.3669,2340.1497,9.8972, 3000, CAMERA_MOVE);
    /*SetPlayerCameraPos(playerid,1733.3695,2300.4736,28.1169);
    SetPlayerCameraLookAt(playerid, 1677.3669,2340.1497,9.8972);*/

    SetPlayerPos(playerid,1677.3669,2340.1497,9.8972-3);
    SendClientMessage(playerid, COLOR_LIME, "_____| Tutorial: Part 3 - Businesses |_____");
    SendClientMessage(playerid, COLOR_WHITE, ""SCRIPT_NAME" has 6 different types of businesses any player can own.");
    SendClientMessage(playerid, COLOR_WHITE, "24/7 Market - Clothes Shop - Ammunation - Advertisement Agency - Club - Fast Food");
    SendClientMessage(playerid, COLOR_WHITE, "");
    SendClientMessage(playerid, COLOR_WHITE, "24/7 Market: Sells general things any player would need like a cellphone and sprunks.");
    SendClientMessage(playerid, COLOR_WHITE, "Clothes Shop: This is where you can change your skin. (( RPly Clothes ))");
    SendClientMessage(playerid, COLOR_WHITE, "Ammunation: You can buy ammo for your weapons from an ammunation.");
    SendClientMessage(playerid, COLOR_WHITE, "Advertisement Agency: You can place advertisements for everybody to see there.");
    SendClientMessage(playerid, COLOR_WHITE, "Club: A place for partying, you can get drunk in there too.");
    SendClientMessage(playerid, COLOR_WHITE, "Fast Food: You can get meals to recover health from a fast food.");
    Tut[playerid] = SetTimerEx("Tut6", 18000, false, "i", playerid);
    return 1;
}
forward Tut6(playerid);
public Tut6(playerid)
{
    InterpolateCameraPos(playerid, 1733.3695,2300.4736,28.1169, 979.7817,-1468.0079,41.3712, 3000, CAMERA_MOVE);
    InterpolateCameraLookAt(playerid, 1677.3669,2340.1497,9.8972, 1030.9037,-1441.5906,13.5546, 3000, CAMERA_MOVE);
    /*SetPlayerCameraPos(playerid,979.7817,-1468.0079,41.3712);
    SetPlayerCameraLookAt(playerid, 1030.9037,-1441.5906,13.5546);*/

    SetPlayerPos(playerid,1030.9037,-1441.5906,13.5546-3);
    SendClientMessage(playerid, COLOR_LIME, "_____| Tutorial: Part 4 - Jobs |_____");
    SendClientMessage(playerid, COLOR_WHITE, ""SCRIPT_NAME" has different types of jobs any player can have, only 7 of them are listed below.");
    SendClientMessage(playerid, COLOR_WHITE, "");
    SendClientMessage(playerid, COLOR_WHITE, "Mechanic: Can repair, add modifications like nitros and hydraulics to vehicles.");
    SendClientMessage(playerid, COLOR_WHITE, "Lawyer: Can reduce prison sentence or even remove someone's crime if he hasn't been arrested yet.");
    SendClientMessage(playerid, COLOR_WHITE, "Trucker: Can deliver products to the packages dropoff so business buy products off it and operate.");
    SendClientMessage(playerid, COLOR_WHITE, "Weapons Dealer: Can create/sell weapons using materials, or even sell materials.");
    SendClientMessage(playerid, COLOR_WHITE, "Weapons Smuggler: Can smuggle materials then sell them to anybody.");
    SendClientMessage(playerid, COLOR_WHITE, "Drugs Dealer: Can get Weed/Crack from the Drug House or Crack Lab and use/sell them.");
    SendClientMessage(playerid, COLOR_WHITE, "Drugs Smuggler: Smuggles drugs to Drug House or Crack Lab for dealers to be able to sell.");
    Tut[playerid] = SetTimerEx("Tut7", 25000, false, "i", playerid);
    return 1;
}
forward Tut7(playerid);
public Tut7(playerid)
{
    InterpolateCameraPos(playerid, 979.7817,-1468.0079,41.3712, 1111.8488,-1202.7986,52.5143, 3000, CAMERA_MOVE);
    InterpolateCameraLookAt(playerid, 1030.9037,-1441.5906,13.5546, 1153.9945,-1180.8960,32.8187, 3000, CAMERA_MOVE);
    /*SetPlayerCameraPos(playerid,1111.8488,-1202.7986,52.5143);
    SetPlayerCameraLookAt(playerid, 1153.9945,-1180.8960,32.8187);*/

    SetPlayerPos(playerid,1153.9945,-1180.8960,32.8187-3);
    SendClientMessage(playerid, COLOR_LIME, "_____| Tutorial: Part 5 - Telecom Company |_____");
    SendClientMessage(playerid, COLOR_WHITE, "The telecom company will be where you buy a sim card (Phone number) or activate");
    SendClientMessage(playerid, COLOR_WHITE, "the Internet service which requires smartphone.");
    SendClientMessage(playerid, COLOR_WHITE, "Internet service allows you to download music and play them on your smartphone. It also allows you to place");
    SendClientMessage(playerid, COLOR_WHITE, "advertisements from anywhere with double the price any Advertisement Agency would cost you.");
    SendClientMessage(playerid, COLOR_WHITE, "Money taken from the Telecom Company will go to the state's tax vault.");
    SendClientMessage(playerid, COLOR_WHITE, "");
    SendClientMessage(playerid, COLOR_WHITE, "");
    SendClientMessage(playerid, COLOR_WHITE, "");
    SendClientMessage(playerid, COLOR_WHITE, "");
    Tut[playerid] = SetTimerEx("TutFinal", 15000, false, "i", playerid);
    return 1;
}
forward TutFinal(playerid);
public TutFinal(playerid)
{
    SendClientMessage(playerid, COLOR_LIME, "_____| Tutorial: Part 6 - The End |_____");
    SendClientMessage(playerid, COLOR_WHITE, "That was the end of our tutorial. If you have questions about anything feel free to");
    SendClientMessage(playerid, COLOR_WHITE, "ask over /newbie chat or /report.");
    SendClientMessage(playerid, COLOR_WHITE, "");
    SendClientMessage(playerid, COLOR_WHITE, "");
    SendClientMessage(playerid, COLOR_WHITE, "If you wish to make money you should try either trucker or drugs smuggler job, both on /search.");
    SendClientMessage(playerid, COLOR_WHITE, "");
    SendClientMessage(playerid, COLOR_WHITE, "");
    SendClientMessage(playerid, COLOR_WHITE, "We hope you enjoy your stay here.");
    SendClientMessage(playerid, COLOR_WHITE, "");
    for(new i=0; i<100; i++)
    {
        SendClientMessage(playerid, COLOR_WHITE, "");
    }
    [B]// Player First Spawn
    SetPlayerPos(playerid, SPAWN_POINT);
    SetPlayerFacingAngle(playerid, 360.0);
    SetPlayerInterior(playerid, 0);
    PlayerInfo[playerid][pTutorial] = 1;
    SpawnChar(playerid);
    TogglePlayerControllable(playerid, 1);
    SetPlayerVirtualWorld(playerid, 0);
    TextDrawHideForPlayer(playerid, TutorialTD);
    // Starter Package
    PlayerInfo[playerid][pNew] = 1;
    PlayerInfo[playerid][pModel] = 299;
    SetPlayerSkin(playerid, 299);
    PlayerInfo[playerid][pFightStyle] = FIGHT_STYLE_NORMAL;
    return 1;[/B] //This par I puted under login!
}
pawn Код:
else if(dialogid == 2) // Login
    {
        if(response)
        {
            new file[64], password[256], IP[16], password2[256];
            format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
            WP_Hash(password2, sizeof(password2), inputtext);
            format(password, sizeof(password), "%s", dini_Get(file, "Password"));
            if(strcmp(password, inputtext,true) && strcmp(password, password2, true))
            {
                SendClientMessage(playerid, COLOR_WHITE, "SERVER: Invalid password.");
                ShowDialog(playerid, 2);
                return 1;
            }
            if(dini_Int(file, "AdminAccount") == 1)
            {
                SendClientMessage(playerid, COLOR_WHITE, "SERVER: You can't login directly from an admin account.");
                Kick(playerid);
                return 1;
            }
            else if(sscanf(inputtext, "s[128]", inputtext))
            {
                SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must enter a password to procceed.");
                ShowDialog(playerid, 2);
                return 1;
            }
            else
            {
                SendClientMessage(playerid, COLOR_LIME, "");
                SendClientMessage(playerid, COLOR_LIME, "");
                SendClientMessage(playerid, COLOR_LIME, "");
                SendClientMessage(playerid, COLOR_LIME, "");
                SendClientMessage(playerid, COLOR_LIME, "");
                SendClientMessage(playerid, COLOR_LIME, "");
                SendClientMessage(playerid, COLOR_LIME, "");
                SendClientMessage(playerid, COLOR_LIME, "");
                SendClientMessage(playerid, COLOR_LIME, "");
                SendClientMessage(playerid, COLOR_LIME, "");
                format(PlayerInfo[playerid][pIP], 16, "%s", dini_Get(file, "IP"));
                GetPlayerIp(playerid, IP, sizeof(IP));
                dini_Set(file, "IP", IP);
                PlayerInfo[playerid][pGender] = dini_Int(file, "Gender");
                PlayerInfo[playerid][pAge] = dini_Int(file, "Age");
                LoadChar(playerid);
                SpawnChar(playerid);
                TogglePlayerControllable(playerid, 1);
                SetPlayerVirtualWorld(playerid, 0);
                SendClientMessage(playerid, COLOR_WHITE, "Welcome to "SCRIPT_NAME".");
                PlayerInfo[playerid][pNew] = 1;
                PlayerInfo[playerid][pModel] = 299;
                SetPlayerSkin(playerid, 299);
                PlayerInfo[playerid][pFightStyle] = FIGHT_STYLE_NORMAL;
                SpawnPlayer(playerid);
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "SERVER: You have chosen to quit the server.");
            Kick(playerid);
        }
    }
Reply
#6

Ensure that no east placing in 0 the variable PlayerInfo[playerid][pAge]
Reply
#7

Only under stock ClearChar(playerid) pAge is set to 0
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)