changing name is not saving password
#1

When I change someones name. There is no password that goes with it. Meaning they dont need to input password when logging in. Since it does not take the password Line.


pawn Код:
CMD:setname(playerid, params[])
{
    new playerb ,string[256], string2[128], file[64], idx, idx2, idx3, idx4, text[MAX_PLAYER_NAME];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(PlayerInfo[playerid][pAdmin] < 4 && !Approve[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
    if(!aDuty[playerid] && PlayerInfo[playerid][pAdmin] < 7) return SendClientMessage(playerid, COLOR_GREY, "You are not on Admin Duty.");
    if(Approve[playerid]) Approve[playerid] = 0;
    if(sscanf(params, "us[24]", playerb, text)) return SendClientMessage(playerid, USAGE, "[Usage]: /setname [playerid] [name]");
    if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
    // Start of detecting space in name
    new end, temp[32], temp2[32];
    end = strfind(text, " ",true);
    if(end != -1)
    {
        strmid(temp, text, 0, end);
        format(temp, sizeof(temp), "%s_", temp);
        strdel(text, 0, end);
        strmid(temp2, text, 1, strlen(text));
        format(text, 24, "");
        strcat(text, temp, sizeof(temp));
        strcat(text, temp2, sizeof(temp2));
    }
    // End of detecting space in name
    format(string, sizeof(string), "AdmCmd: %s has changed %s's name to %s.", RPN(playerid), RPN(playerb), text);
    format(string2, sizeof(string2), " Administrator %s has changed your name to {FF6347}%s{FFFFFF}.", RPN(playerid), text);
    format(file, sizeof(file), "users/%s.ini", text);
    if(dini_Exists(file)) return SendClientMessage(playerid, COLOR_GREY, "Name already in use.");
    idx = PlayerInfo[playerb][pBiz];
    idx2 = PlayerInfo[playerb][pHouse];
    idx3 = PlayerInfo[playerb][pVBiz];
    idx4 = PlayerInfo[playerb][pVHouse];
    format(file, sizeof(file), "users/%s.ini", RPNU(playerb));
    dini_Remove(file);
    SetPlayerName(playerb, text);
    PlayerInfo[playerb][pBiz] = idx;
    format(file, sizeof(file), "users/%s.ini", RPNU(playerb));
    dini_Create(file);
    SaveChar(playerb);
    SendAdminMessage(COLOR_DARKRED, 1, string);
    SendClientMessage(playerb, COLOR_WHITE, string2);
    if(idx)
    {
        format(BizInfo[idx][bOwner], 32, "%s", text);
        format(string, sizeof(string), "{33AA33}%s{FFFFFF}\nBusiness %s\nBusiness type: %s\n%s", BizInfo[idx][bName], BizInfo[idx][bOwner], RBT(idx), RBS(idx));
        UpdateDynamic3DTextLabelText(BizInfo[idx][bText], COLOR_WHITE, string);
    }
    if(idx2)
    {
        idx = idx2;
        format(HouseInfo[idx][hOwner], 32, "%s", text);
        format(string, sizeof(string), "{00C0FF}House of %s\nHouse Type: %s\nStatus: %s", HouseInfo[idx][hOwner], HT(idx), RHS(idx));
        UpdateDynamic3DTextLabelText(HouseInfo[idx][hText], COLOR_WHITE, string);
    }
    if(idx3)
    {
        idx = idx3;
        format(BizInfo[idx][bOwner], 32, "%s", text);
        format(string, sizeof(string), "{33AA33}%s{FFFFFF}\nBusiness %s\nBusiness type: %s\n%s", BizInfo[idx][bName], BizInfo[idx][bOwner], RBT(idx), RBS(idx));
        UpdateDynamic3DTextLabelText(BizInfo[idx][bText], COLOR_WHITE, string);
    }
    if(idx4)
    {
        idx = idx4;
        format(HouseInfo[idx][hOwner], 32, "%s", text);
        format(string, sizeof(string), "{00C0FF}House of %s\nHouse Type: %s\nStatus: %s", HouseInfo[idx][hOwner], HT(idx), RHS(idx));
        UpdateDynamic3DTextLabelText(HouseInfo[idx][hText], COLOR_WHITE, string);
    }
    return 1;
}
Reply
#2

Changing their name shouldn't do that. Show us your player save function.
Reply
#3

pawn Код:
dini_Set(file, "IP", PlayerInfo[playerid][pIP]);
            dini_IntSet(file, "Gender", PlayerInfo[playerid][pGender]);
            dini_IntSet(file, "Level", PlayerInfo[playerid][pLevel]);
            dini_IntSet(file, "UpgradePoints", PlayerInfo[playerid][pUpgradePoints]);
            dini_IntSet(file, "ArmorUpgrade", PlayerInfo[playerid][pArmorUpgrade]);
            dini_IntSet(file, "Minutes", PlayerInfo[playerid][pMinutes]);
            dini_IntSet(file, "TMinutes", PlayerInfo[playerid][pTMinutes]);
            dini_IntSet(file, "Hours", PlayerInfo[playerid][pHours]);
            dini_IntSet(file, "Age", PlayerInfo[playerid][pAge]);
            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, "Mapper", PlayerInfo[playerid][pMapper]);
            dini_IntSet(file, "pBanned", PlayerInfo[playerid][pBanned]);
            dini_IntSet(file, "Phnumber", PlayerInfo[playerid][pNumber]);
            dini_IntSet(file, "AdMute", PlayerInfo[playerid][pADMute]);
            dini_IntSet(file, "JackSkill", PlayerInfo[playerid][pJackSkill]);
            dini_IntSet(file, "Death", PlayerInfo[playerid][pDeath]);
            dini_IntSet(file, "Kill", PlayerInfo[playerid][pKill]);
            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, "Hours", PlayerInfo[playerid][pExp]);
            dini_IntSet(file, "VW", PlayerInfo[playerid][pVW]);
            dini_IntSet(file, "VehVW", PlayerInfo[playerid][pVehVW]);
            dini_IntSet(file, "WalkStyle", PlayerInfo[playerid][pWalkStyle]);
            dini_IntSet(file, "Neon", PlayerInfo[playerid][pNeon]);
            dini_IntSet(file, "vNeon", PlayerInfo[playerid][pVNeon]);
            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, "Garage", PlayerInfo[playerid][pGarage]);
            dini_IntSet(file, "wtSlot1", PlayerInfo[playerid][pTGun][0]);
            dini_IntSet(file, "wtSlot1Ammo", PlayerInfo[playerid][pTGunAmmo][0]);
            dini_IntSet(file, "wtSlot2", PlayerInfo[playerid][pTGun][1]);
            dini_IntSet(file, "wtSlot2Ammo", PlayerInfo[playerid][pTGunAmmo][1]);
            dini_IntSet(file, "vwtSlot1", PlayerInfo[playerid][pvTGun][0]);
            dini_IntSet(file, "vwtSlot1Ammo", PlayerInfo[playerid][pvTGunAmmo][0]);
            dini_IntSet(file, "vwtSlot2", PlayerInfo[playerid][pvTGun][1]);
            dini_IntSet(file, "vwtSlot2Ammo", PlayerInfo[playerid][pvTGunAmmo][1]);
            dini_IntSet(file, "HouseOwner", 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, "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, "MedMaterials", PlayerInfo[playerid][pMMaterials]);
            dini_IntSet(file, "HighMaterials", PlayerInfo[playerid][pHMaterials]);
            dini_IntSet(file, "MWPackages", PlayerInfo[playerid][pMMPackages]);
            dini_IntSet(file, "HWPackages", PlayerInfo[playerid][pHPackages]);
            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, "WT", PlayerInfo[playerid][pWT]);
            dini_IntSet(file, "WTC", PlayerInfo[playerid][pWTC]);
            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, "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_Set(file, "Wanted7", PlayerInfo[playerid][pWanted7]);
            dini_Set(file, "Wanted8", PlayerInfo[playerid][pWanted8]);
            dini_Set(file, "Wanted9", PlayerInfo[playerid][pWanted9]);
            dini_Set(file, "Wanted10", PlayerInfo[playerid][pWanted10]);
            dini_Set(file, "Wanted11", PlayerInfo[playerid][pWanted11]);
            dini_Set(file, "Wanted12", PlayerInfo[playerid][pWanted12]);
            dini_Set(file, "Wanted13", PlayerInfo[playerid][pWanted13]);
            dini_Set(file, "Wanted14", PlayerInfo[playerid][pWanted14]);
            dini_Set(file, "Wanted15", PlayerInfo[playerid][pWanted15]);
            dini_Set(file, "Wanted16", PlayerInfo[playerid][pWanted16]);
            dini_Set(file, "Wanted17", PlayerInfo[playerid][pWanted17]);
            dini_Set(file, "Wanted18", PlayerInfo[playerid][pWanted18]);
            dini_Set(file, "Wanted19", PlayerInfo[playerid][pWanted19]);
            dini_Set(file, "Wanted20", PlayerInfo[playerid][pWanted20]);
            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, "cocaine", PlayerInfo[playerid][pcocaine]);
            dini_IntSet(file, "TrunkWeed", PlayerInfo[playerid][pTWeed]);
            dini_IntSet(file, "Trunkcocaine", PlayerInfo[playerid][pTcocaine]);
            dini_IntSet(file, "vTrunkWeed", PlayerInfo[playerid][pvTWeed]);
            dini_IntSet(file, "vTrunkcocaine", PlayerInfo[playerid][pvTcocaine]);
            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, "RMute", PlayerInfo[playerid][pRMute]);
            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, "FlyLicense", PlayerInfo[playerid][pFlyLic]);
            dini_IntSet(file, "WepLicense", PlayerInfo[playerid][pWepLic]);
            dini_Set(file, "Accent", PlayerInfo[playerid][pAccent]);
            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, "pDay", PlayerInfo[playerid][pDay]);
            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][pJob2]);
            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]);
            /*Third Car*/
            dini_IntSet(file, "vVVModel", PlayerInfo[playerid][vVVModel]);
            dini_FloatSet(file, "vVVX", PlayerInfo[playerid][vVVX]);
            dini_FloatSet(file, "vVVY", PlayerInfo[playerid][vVVY]);
            dini_FloatSet(file, "vVVZ", PlayerInfo[playerid][vVVZ]);
            dini_FloatSet(file, "vVVA", PlayerInfo[playerid][vVVA]);
            dini_IntSet(file, "vVVC1", PlayerInfo[playerid][vVVC1]);
            dini_IntSet(file, "vVVC2", PlayerInfo[playerid][vVVC2]);
            dini_IntSet(file, "vVVPJ", PlayerInfo[playerid][vVVPJ]);
            dini_IntSet(file, "vVVLocked", PlayerInfo[playerid][vVVLocked]);
            dini_IntSet(file, "vVVModSlot0",PlayerInfo[playerid][pVVVehMod][0]);
            dini_IntSet(file, "vVVModSlot1",PlayerInfo[playerid][pVVVehMod][1]);
            dini_IntSet(file, "vVVModSlot2",PlayerInfo[playerid][pVVVehMod][2]);
            dini_IntSet(file, "vVVModSlot3",PlayerInfo[playerid][pVVVehMod][3]);
            dini_IntSet(file, "vVVModSlot4",PlayerInfo[playerid][pVVVehMod][4]);
            dini_IntSet(file, "vVVModSlot5",PlayerInfo[playerid][pVVVehMod][5]);
            dini_IntSet(file, "vVVModSlot6",PlayerInfo[playerid][pVVVehMod][6]);
            dini_IntSet(file, "vVVModSlot7",PlayerInfo[playerid][pVVVehMod][7]);
            dini_IntSet(file, "vVVModSlot8",PlayerInfo[playerid][pVVVehMod][8]);
            dini_IntSet(file, "vVVModSlot9",PlayerInfo[playerid][pVVVehMod][9]);
            dini_IntSet(file, "vVVModSlot10",PlayerInfo[playerid][pVVVehMod][10]);
            dini_IntSet(file, "vVVModSlot11",PlayerInfo[playerid][pVVVehMod][11]);
            dini_IntSet(file, "vVVModSlot12",PlayerInfo[playerid][pVVVehMod][12]);
            dini_IntSet(file, "vVVModSlot13",PlayerInfo[playerid][pVVVehMod][13]);

            /* End third car */
            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, "Oldskool", PlayerInfo[playerid][pOldskool]);
            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]);
        }
        // All Saved
        //SendClientMessage(playerid, COLOR_GREY, "SERVER: {FFFFFF}Your character files have saved successfully.");
    }
    return 1;
}

stock LoadChar(playerid)
{
    new file[64];
    format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
    // Logged in
    PlayerInfo[playerid][pLoggedIn] = 1;
    PlayerInfo[playerid][pSpawn] = 1;
    // Load
    format(PlayerInfo[playerid][pIP], 16, "%s", dini_Get(file, "IP"));
    PlayerInfo[playerid][pGender] = dini_Int(file, "Gender");
    PlayerInfo[playerid][pLevel] = dini_Int(file, "Level");
    PlayerInfo[playerid][pUpgradePoints] = dini_Int(file, "UpgradePoints");
    PlayerInfo[playerid][pArmorUpgrade] = dini_Int(file, "ArmorUpgrade");
    if(PlayerInfo[playerid][pLevel] == 0) PlayerInfo[playerid][pLevel] = 1;
    PlayerInfo[playerid][pMinutes] = dini_Int(file, "Minutes");
    PlayerInfo[playerid][pTMinutes] = dini_Int(file, "TMinutes");
    PlayerInfo[playerid][pHours] = dini_Int(file, "Hours");
    PlayerInfo[playerid][pAge] = dini_Int(file, "Age");
    PlayerInfo[playerid][pMoney] = dini_Int(file, "Cash");
    PlayerInfo[playerid][pExp] = dini_Int(file, "Hours");
    PlayerInfo[playerid][pADMute] = dini_Int(file, "ADMute");
    PlayerInfo[playerid][pBank] = dini_Int(file, "Bank");
    PlayerInfo[playerid][pModel] = dini_Int(file, "Model");
    PlayerInfo[playerid][pAdmin] = dini_Int(file, "Admin");
    PlayerInfo[playerid][pMapper] = dini_Int(file, "Mapper");
    PlayerInfo[playerid][pBanned] = dini_Int(file, "pBanned");
    PlayerInfo[playerid][pNumber] = dini_Int(file, "Phnumber");
    PlayerInfo[playerid][pKill] = dini_Int(file, "Kill");
    PlayerInfo[playerid][pDeath] = dini_Int(file, "Death");
    PlayerInfo[playerid][pX]  = dini_Float(file, "X");
    PlayerInfo[playerid][pY] = dini_Float(file, "Y");
    PlayerInfo[playerid][pZ] = dini_Float(file, "Z");
    PlayerInfo[playerid][pInt] = dini_Int(file, "Int");
    PlayerInfo[playerid][pVW] = dini_Int(file, "VW");
    PlayerInfo[playerid][pVehVW] = dini_Int(file, "VehVW");
    PlayerInfo[playerid][pJackSkill] = dini_Int(file, "JackSkill");
    PlayerInfo[playerid][pWalkStyle] = dini_Int(file, "WalkStyle");
    PlayerInfo[playerid][pNeon] = dini_Int(file, "Neon");
    PlayerInfo[playerid][pVNeon] = dini_Int(file, "vNeon");
    PlayerInfo[playerid][pFac] = dini_Int(file, "Fac");
    PlayerInfo[playerid][pFacRank] = dini_Int(file, "FacRank");
    PlayerInfo[playerid][pFacLeader] = dini_Int(file, "FacLeader");
    PlayerInfo[playerid][pFacDiv] = dini_Int(file, "FacDiv");
    PlayerInfo[playerid][pFacDivLeader] = dini_Int(file, "FacDivLeader");
    PlayerInfo[playerid][pFacDuty] = dini_Int(file, "Duty");
    PlayerInfo[playerid][pWeapon][0] = dini_Int(file, "wSlot0");
    PlayerInfo[playerid][pWeaponAmmo][0] = dini_Int(file, "wSlot0Ammo");
    PlayerInfo[playerid][pWeapon][1] = dini_Int(file, "wSlot1");
    PlayerInfo[playerid][pWeaponAmmo][1] = dini_Int(file, "wSlot1Ammo");
    PlayerInfo[playerid][pWeapon][2] = dini_Int(file, "wSlot2");
    PlayerInfo[playerid][pWeaponAmmo][2] = dini_Int(file, "wSlot2Ammo");
    PlayerInfo[playerid][pWeapon][3] = dini_Int(file, "wSlot3");
    PlayerInfo[playerid][pWeaponAmmo][3] = dini_Int(file, "wSlot3Ammo");
    PlayerInfo[playerid][pWeapon][4] = dini_Int(file, "wSlot4");
    PlayerInfo[playerid][pWeaponAmmo][4] = dini_Int(file, "wSlot4Ammo");
    PlayerInfo[playerid][pWeapon][5] = dini_Int(file, "wSlot5");
    PlayerInfo[playerid][pWeaponAmmo][5] = dini_Int(file, "wSlot5Ammo");
    PlayerInfo[playerid][pWeapon][6] = dini_Int(file, "wSlot6");
    PlayerInfo[playerid][pWeaponAmmo][6] = dini_Int(file, "wSlot6Ammo");
    PlayerInfo[playerid][pWeapon][7] = dini_Int(file, "wSlot7");
    PlayerInfo[playerid][pWeaponAmmo][7] = dini_Int(file, "wSlot7Ammo");
    PlayerInfo[playerid][pWeapon][8] = dini_Int(file, "wSlot8");
    PlayerInfo[playerid][pWeaponAmmo][8] = dini_Int(file, "wSlot8Ammo");
    PlayerInfo[playerid][pWeapon][9] = dini_Int(file, "wSlot9");
    PlayerInfo[playerid][pWeaponAmmo][9] = dini_Int(file, "wSlot9Ammo");
    PlayerInfo[playerid][pWeapon][10] = dini_Int(file, "wSlot10");
    PlayerInfo[playerid][pWeaponAmmo][10] = dini_Int(file, "wSlot10Ammo");
    PlayerInfo[playerid][pWeapon][11] = dini_Int(file, "wSlot11");
    PlayerInfo[playerid][pWeaponAmmo][11] = dini_Int(file, "wSlot11Ammo");
    PlayerInfo[playerid][pWeapon][12] = dini_Int(file, "wSlot12");
    PlayerInfo[playerid][pWeaponAmmo][12] = dini_Int(file, "wSlot12Ammo");
    PlayerInfo[playerid][pHospital] = dini_Int(file, "Hospital");
    PlayerInfo[playerid][pBiz] = dini_Int(file, "Business");
    PlayerInfo[playerid][pSafeAdmin] = dini_Int(file, "HouseOwner");
    PlayerInfo[playerid][pVBiz] = dini_Int(file, "VBusiness");
    PlayerInfo[playerid][pOwner] = dini_Int(file, "BizOwner");
    PlayerInfo[playerid][pJob] = dini_Int(file, "Job");
Reply
#4

Bump
Reply
#5

pawn Код:
CMD:setname(playerid, params[])
{
    new playerb ,string[256], string2[128], file[64], idx, idx2, idx3, idx4, text[MAX_PLAYER_NAME];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(PlayerInfo[playerid][pAdmin] < 4 && !Approve[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
    if(!aDuty[playerid] && PlayerInfo[playerid][pAdmin] < 7) return SendClientMessage(playerid, COLOR_GREY, "You are not on Admin Duty.");
    if(Approve[playerid]) Approve[playerid] = 0;
    if(sscanf(params, "us[24]", playerb, text)) return SendClientMessage(playerid, USAGE, "[Usage]: /setname [playerid] [name]");
    if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
    // Start of detecting space in name
    new end, temp[32], temp2[32];
    end = strfind(text, " ",true);
    if(end != -1)
    {
        strmid(temp, text, 0, end);
        format(temp, sizeof(temp), "%s_", temp);
        strdel(text, 0, end);
        strmid(temp2, text, 1, strlen(text));
        format(text, 24, "");
        strcat(text, temp, sizeof(temp));
        strcat(text, temp2, sizeof(temp2));
    }
    // End of detecting space in name
    format(string, sizeof(string), "AdmCmd: %s has changed %s's name to %s.", RPN(playerid), RPN(playerb), text);
    format(string2, sizeof(string2), " Administrator %s has changed your name to {FF6347}%s{FFFFFF}.", RPN(playerid), text);
    format(file, sizeof(file), "users/%s.ini", text);
    if(dini_Exists(file)) return SendClientMessage(playerid, COLOR_GREY, "Name already in use.");
    idx = PlayerInfo[playerb][pBiz];
    idx2 = PlayerInfo[playerb][pHouse];
    idx3 = PlayerInfo[playerb][pVBiz];
    idx4 = PlayerInfo[playerb][pVHouse];
    new password[256];
    format(file, sizeof(file), "users/%s.ini", RPNU(playerb));
    format(password, sizeof(password), "%s", dini_Get(file, "Password"));
    dini_Remove(file);
    SetPlayerName(playerb, text);
    PlayerInfo[playerb][pBiz] = idx;
    format(file, sizeof(file), "users/%s.ini", RPNU(playerb));
    dini_Create(file);
    dini_Set(file, "Password", password);
    SaveChar(playerb);
    SendAdminMessage(COLOR_DARKRED, 1, string);
    SendClientMessage(playerb, COLOR_WHITE, string2);
    if(idx)
    {
        format(BizInfo[idx][bOwner], 32, "%s", text);
        format(string, sizeof(string), "{33AA33}%s{FFFFFF}\nBusiness %s\nBusiness type: %s\n%s", BizInfo[idx][bName], BizInfo[idx][bOwner], RBT(idx), RBS(idx));
        UpdateDynamic3DTextLabelText(BizInfo[idx][bText], COLOR_WHITE, string);
    }
    if(idx2)
    {
        idx = idx2;
        format(HouseInfo[idx][hOwner], 32, "%s", text);
        format(string, sizeof(string), "{00C0FF}House of %s\nHouse Type: %s\nStatus: %s", HouseInfo[idx][hOwner], HT(idx), RHS(idx));
        UpdateDynamic3DTextLabelText(HouseInfo[idx][hText], COLOR_WHITE, string);
    }
    if(idx3)
    {
        idx = idx3;
        format(BizInfo[idx][bOwner], 32, "%s", text);
        format(string, sizeof(string), "{33AA33}%s{FFFFFF}\nBusiness %s\nBusiness type: %s\n%s", BizInfo[idx][bName], BizInfo[idx][bOwner], RBT(idx), RBS(idx));
        UpdateDynamic3DTextLabelText(BizInfo[idx][bText], COLOR_WHITE, string);
    }
    if(idx4)
    {
        idx = idx4;
        format(HouseInfo[idx][hOwner], 32, "%s", text);
        format(string, sizeof(string), "{00C0FF}House of %s\nHouse Type: %s\nStatus: %s", HouseInfo[idx][hOwner], HT(idx), RHS(idx));
        UpdateDynamic3DTextLabelText(HouseInfo[idx][hText], COLOR_WHITE, string);
    }
    return 1;
}
Pretty simple, you just get the player's old password and then overlap it on the new hashed password.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)