Question

B чем проблемма ребят, не сохраняются префиксы базе данных mysql

Спойлер

        case 3014:
        {
            if(response)
            {
                strmid(PlayerInfo[GetPVarInt(playerid,"idPrefix")][aPrefix], inputtext, 0, strlen(inputtext), 255);
                SCMF(playerid, -1, "Âû èçìåíèëè %s'ó ïðåôèêñ íà %s.",PlayerInfo[GetPVarInt(playerid,"idPrefix")][pNames],PlayerInfo[GetPVarInt(playerid,"idPrefix")][aPrefix]);
            }
            else return 1;
        }

Спойлер

stock OnPlayerSaveAccount(playerid)
{
    if(PlayerInfo[playerid][pLogin] != true) return print("Îøèáêà ñîõðàíåíèÿ | Èãðîê íå àâòîðèçîâàí");
    new string[340];
    mysql_format(connects,string,340,"UPDATE `accounts` SET `pFuelcar` = '%f',`pFuelcar1` = '%f',`pFuelcar2` = '%f',`pCash` = '%d',`pMuteTime` = '%d',`pRMuteTime` = '%d',`pChar` = '%d', `pPrisonTime` = '%d', `pJailTime` = '%d', `pJailed` = '%d', `pPm` = '%d', `aPrefix` = '%s' WHERE `id` = '%i'",
    PlayerInfo[playerid][pFuelCar][0],PlayerInfo[playerid][pFuelCar][1],PlayerInfo[playerid][pFuelCar][2],PlayerInfo[playerid][pCash],PlayerInfo[playerid][pMuteTime],PlayerInfo[playerid][pRMuteTime],PlayerInfo[playerid][pChar],
    PlayerInfo[playerid][pPrison][1],PlayerInfo[playerid][pJailTime],PlayerInfo[playerid][pJailed],PlayerInfo[playerid][pPm],PlayerInfo[playerid][aPrefix],PlayerInfo[playerid][pID]);
    mysql_empty(connects, string);
    printf("Name: %s [%d] | pID: [%d] - ñîõðàíåí",PlayerInfo[playerid][pNames],playerid,PlayerInfo[playerid][pID]);
    return 1;
}

Спойлер

CMD:prefix(playerid, params[])
{
    if(PlayerInfo[playerid][pLogin] != true) return SCM(playerid,0xFF0000AA, "[Îøèáêà] {ffffff}Âû åù¸ íå àâòîðèçîâàëèñü!");
    if(IsFDPlayer(PlayerInfo[playerid][pNames]))
    {
        if(sscanf(params,"d",params[0])) return SCM(playerid,COLOR_YELLOW,"[Ïîäñêàçêà] {ffffff}Èñïîëüçóéòå /prefix [id]. Äëÿ óäàëåíèÿ ïðîïèøèòå ïðåôèêñ \"None\"");
        if(PlayerInfo[params[0]][pLogin] != true) return SCM(playerid,0xFF0000AA, "[Îøèáêà] {ffffff}Èãðîê åù¸ íå àâòîðèçîâàëñÿ.");
        SetPVarInt(playerid,"idPrefix",params[0]);
        ShowPlayerDialog(playerid, 3014, DIALOG_STYLE_INPUT, "Ïðåôèêñ", "Ââåäèòå íàèìåíîâàíèå ïðåôèêñà:", "Ïðèíÿòü", "Îòìåíà");
        //strmid(PlayerInfo[params[0]][aPrefix], params[1], 0, strlen(params[1]), 255);
        //SCMF(playerid, -1, "Âû èçìåíèëè %s'ó ïðåôèêñ íà %s.",PlayerInfo[params[0]][pNames],PlayerInfo[params[0]][aPrefix]);
        return true;
    }
    else SCM(playerid,0xFF0000AA, "[Îøèáêà] {ffffff}Íåò äîñòóïà!");
    return true;
}

 

Share this post


Link to post

8 answers to this question

  • 0

Как я понял, у тебя вот это пишет администратору который ставит префикс сам префикс который он ввёл. SCMF(playerid, -1, "Âû èçìåíèëè %s'ó ïðåôèêñ íà %s.",PlayerInfo[GetPVarInt(playerid,"idPrefix")][pNames],PlayerInfo[GetPVarInt(playerid,"idPrefix")][aPrefix]);, если же да то он пишет верный префикс ? 

Share this post


Link to post
  • 0

@Покемон Да, но он не сохраняет после релога пропадает а должен БД сохраняться 

Share this post


Link to post
  • 0
29 минут назад, FENRIS сказал:

@Покемон Да, но он не сохраняет после релога пропадает а должен БД сохраняться 

покажи структуру базы данных.

Share this post


Link to post
  • 0

@Покемон т.е pInfo?

Share this post


Link to post
  • 0

Структуру базы данных accounts

Share this post


Link to post
  • 0

@Покемон 

Спойлер

CREATE TABLE IF NOT EXISTS `accounts` (
`id` int(11) NOT NULL,
  `pKey` varchar(32) NOT NULL,
  `Name` varchar(24) NOT NULL,
  `pLevel` int(11) NOT NULL,
  `pPhousekey` int(11) NOT NULL DEFAULT '1',
  `pHotel` int(11) NOT NULL DEFAULT '-1',
  `pPbiskey` int(11) NOT NULL DEFAULT '-1',
  `pPsbiskey` int(11) NOT NULL DEFAULT '-1',
  `bAdmin` int(11) NOT NULL DEFAULT '0',
  `pFuelcar` float NOT NULL DEFAULT '50',
  `pFuelcar1` float NOT NULL DEFAULT '50',
  `pFuelcar2` float NOT NULL DEFAULT '50',
  `pCar` int(11) NOT NULL DEFAULT '462',
  `pCar2` int(11) NOT NULL DEFAULT '462',
  `pCar3` int(11) NOT NULL DEFAULT '462',
  `pHelper` int(11) NOT NULL DEFAULT '0',
  `pDMInections` int(11) NOT NULL,
  `pDRInections` int(11) NOT NULL DEFAULT '0',
  `pSex` int(11) NOT NULL,
  `pMuted` int(11) NOT NULL DEFAULT '0',
  `pExp` int(11) NOT NULL DEFAULT '0',
  `pCash` int(11) NOT NULL,
  `pJailed` int(11) NOT NULL DEFAULT '0',
  `pJailTime` int(11) NOT NULL DEFAULT '0',
  `pMats` int(11) NOT NULL DEFAULT '0',
  `pDrugs` varchar(32) NOT NULL DEFAULT '0,0,0,0,0',
  `pLeader` int(11) NOT NULL DEFAULT '0',
  `pMember` int(11) NOT NULL DEFAULT '0',
  `pRank` int(11) NOT NULL DEFAULT '0',
  `pJob` int(11) NOT NULL DEFAULT '0',
  `pSDPistol` int(11) NOT NULL DEFAULT '100',
  `pDesertEagle` int(11) NOT NULL DEFAULT '100',
  `pShotGun` int(11) NOT NULL DEFAULT '100',
  `pMP5` int(11) NOT NULL DEFAULT '100',
  `pAK47` int(11) NOT NULL DEFAULT '100',
  `pM4` int(11) NOT NULL DEFAULT '100',
  `pChar` int(11) NOT NULL,
  `pModel` int(11) NOT NULL,
  `pPnumber` int(11) NOT NULL,
  `pPayDayHad` int(11) NOT NULL DEFAULT '0',
  `pWarns` int(11) NOT NULL DEFAULT '0',
  `punWarns` int(11) NOT NULL DEFAULT '0',
  `punWarnstime` int(11) NOT NULL DEFAULT '0',
  `pFuel` int(11) NOT NULL DEFAULT '0',
  `pMarried` int(11) NOT NULL DEFAULT '0',
  `pMuteTime` int(11) NOT NULL DEFAULT '0',
  `pBank` int(11) NOT NULL DEFAULT '0',
  `pHospital` int(11) NOT NULL DEFAULT '0',
  `pZakonp` int(11) NOT NULL,
  `pMestoJail` int(11) NOT NULL DEFAULT '0',
  `pWanted` int(11) NOT NULL DEFAULT '0',
  `pHousecash` int(11) NOT NULL DEFAULT '0',
  `pDataReg` varchar(64) NOT NULL,
  `pIpReg` varchar(16) NOT NULL,
  `pTut` int(11) NOT NULL,
  `pNumbercar` varchar(64) NOT NULL,
  `pEmail` varchar(64) NOT NULL,
  `pGetonDate` varchar(32) NOT NULL,
  `pGetonIP` varchar(32) NOT NULL,
  `pAvig` int(11) NOT NULL DEFAULT '0',
  `vig` int(11) NOT NULL DEFAULT '0',
  `pSpawn` int(11) NOT NULL DEFAULT '0',
  `pPhonePlayer` int(11) NOT NULL DEFAULT '0',
  `CarX` float NOT NULL DEFAULT '0',
  `CarY` float NOT NULL DEFAULT '0',
  `CarZ` float NOT NULL DEFAULT '0',
  `CarC` float NOT NULL DEFAULT '0',
  `family` int(11) NOT NULL DEFAULT '0',
  `pIP` varchar(16) NOT NULL,
  `pRub` int(11) NOT NULL DEFAULT '0',
  `pRubPlus` int(11) NOT NULL DEFAULT '0',
  `pRubTimePlus` int(11) NOT NULL DEFAULT '0',
  `site_reg` int(10) NOT NULL,
  `site_status` varchar(30) NOT NULL,
  `site_star` int(5) NOT NULL,
  `pMedCard` int(11) NOT NULL DEFAULT '0',
  `pVoted` int(11) NOT NULL DEFAULT '0',
  `pAcessories1` int(11) NOT NULL DEFAULT '0',
  `pAcessories2` int(11) NOT NULL DEFAULT '0',
  `ACfOffsetX` float NOT NULL DEFAULT '0',
  `ACfOffsetY` float NOT NULL DEFAULT '0',
  `ACfOffsetZ` float NOT NULL DEFAULT '0',
  `ACfRotX` float NOT NULL DEFAULT '0',
  `ACfRotY` float NOT NULL DEFAULT '0',
  `ACfRotZ` float NOT NULL DEFAULT '0',
  `ACfScaleX` float NOT NULL DEFAULT '0',
  `ACfScaleY` float NOT NULL DEFAULT '0',
  `ACfScaleZ` float NOT NULL DEFAULT '0',
  `pSettings` int(11) NOT NULL DEFAULT '0',
  `gun` varchar(255) NOT NULL DEFAULT '0,0,0,0,0,0',
  `pPrison` int(11) NOT NULL DEFAULT '0',
  `pPrisonTime` int(11) NOT NULL DEFAULT '0',
  `WarnAdmin` varchar(24) NOT NULL,
  `WarnReason` varchar(64) NOT NULL,
  `WarnOffline` int(11) NOT NULL DEFAULT '0',
  `pDrug` varchar(32) NOT NULL,
  `pLics` varchar(16) NOT NULL DEFAULT '1,1,1,1',
  `cVehcom` varchar(74) NOT NULL DEFAULT '0,0,0,0,0,0,0,0,0,0,0,0,0,0',
  `cVehcom2` varchar(74) NOT NULL DEFAULT '0,0,0,0,0,0,0,0,0,0,0,0,0,0',
  `cVehcom3` varchar(74) NOT NULL DEFAULT '0,0,0,0,0,0,0,0,0,0,0,0,0,0',
  `pCarCash` int(11) NOT NULL DEFAULT '0',
  `pCarCash2` int(11) NOT NULL DEFAULT '0',
  `pCarCash3` int(11) NOT NULL DEFAULT '0',
  `spal` int(11) NOT NULL DEFAULT '0',
  `siga` int(11) NOT NULL DEFAULT '0',
  `sigar` int(11) NOT NULL DEFAULT '0',
  `sgf` int(11) NOT NULL DEFAULT '0',
  `bankcode` int(11) NOT NULL DEFAULT '0',
  `bankcard` int(11) NOT NULL DEFAULT '0',
  `cardmoney` int(11) NOT NULL DEFAULT '0',
  `carddate` int(11) NOT NULL DEFAULT '0',
  `age` int(3) NOT NULL,
  `nationaly` int(2) NOT NULL,
  `avia` int(11) NOT NULL DEFAULT '-1',
  `coloravia` int(11) NOT NULL DEFAULT '0',
  `coloravia1` int(11) NOT NULL DEFAULT '0',
  `numbercar` varchar(10) NOT NULL DEFAULT 'None',
  `numbercar1` varchar(10) NOT NULL DEFAULT 'None',
  `numbercar2` varchar(10) NOT NULL DEFAULT 'None',
  `numberReg` int(2) NOT NULL DEFAULT '0',
  `numberReg1` int(2) NOT NULL DEFAULT '0',
  `numberReg2` int(2) NOT NULL DEFAULT '0',
  `pSum` int(11) NOT NULL,
  `pResh` int(11) NOT NULL,
  `veh_first_number` int(11) NOT NULL DEFAULT '-1',
  `veh_second_number` int(11) NOT NULL DEFAULT '-1',
  `plane_model` int(11) NOT NULL,
  `plane_color_first` int(11) NOT NULL,
  `plane_color_second` int(11) NOT NULL,
  `boat_model` int(11) NOT NULL,
  `boat_color_first` int(11) NOT NULL,
  `boat_color_second` int(11) NOT NULL,
  `last_veh_number` int(11) NOT NULL,
  `pSuperKey` varchar(64) NOT NULL,
  `pKeylog` int(11) NOT NULL,
  `pText` int(11) NOT NULL,
  `pVipTime` int(11) NOT NULL DEFAULT '0',
  `pVipData` int(11) NOT NULL DEFAULT '0',
  `ArmyPlay` int(2) NOT NULL DEFAULT '0',
  `ArmyRank` varchar(32) NOT NULL DEFAULT 'None',
  `pArendaHouse` int(11) NOT NULL DEFAULT '-1',
  `pFamilyName` varchar(24) NOT NULL DEFAULT 'Нет',
  `pDonate` int(11) NOT NULL DEFAULT '99999',
  `kicks` int(11) NOT NULL DEFAULT '0',
  `bans` int(11) NOT NULL DEFAULT '0',
  `warns` int(11) NOT NULL DEFAULT '0',
  `pms` int(11) NOT NULL DEFAULT '0',
  `jails` int(11) NOT NULL DEFAULT '0',
  `pRazrewenie` int(11) NOT NULL,
  `aPrefix` varchar(32) NOT NULL
) ENGINE=MyISAM AUTO_INCREMENT=104 DEFAULT CHARSET=cp1251;

 

Share this post


Link to post
  • 0

Для начало у тебя varchar(32) 32 хотя у тебя макс как я понял 255..  Скинь Mysql.log

Share this post


Link to post
  • 0

@Покемон 

Спойлер

[21:15:48] [ERROR] CMySQLQuery::Execute[] - (error #1054) Unknown column 'pRMuteTime' in 'field list'
[21:18:42] [WARNING] CMySQLResult::GetRowDataByName - field not found ("pPm")
[21:18:42] [ERROR] cache_get_field_content_int - invalid datatype
[21:18:42] [WARNING] CMySQLResult::GetRowDataByName - field not found ("neon")
[21:18:42] [ERROR] cache_get_field_content_int - invalid datatype
[21:18:42] [WARNING] CMySQLResult::GetRowDataByName - field not found ("pRMuteTime")
[21:18:42] [ERROR] cache_get_field_content_int - invalid datatype
[21:18:42] [WARNING] CMySQLResult::GetRowDataByName - field not found ("pFine")
[21:18:42] [ERROR] cache_get_field_content_int - invalid datatype
[21:18:42] [WARNING] CMySQLResult::GetRowDataByName - field not found ("pFineCount")
[21:18:42] [ERROR] cache_get_field_content_int - invalid datatype
[21:23:43] [ERROR] CMySQLQuery::Execute[] - (error #1054) Unknown column 'pRMuteTime' in 'field list'
[21:24:33] [WARNING] CMySQLResult::GetRowDataByName - field not found ("pPm")
[21:24:33] [ERROR] cache_get_field_content_int - invalid datatype
[21:24:33] [WARNING] CMySQLResult::GetRowDataByName - field not found ("neon")
[21:24:33] [ERROR] cache_get_field_content_int - invalid datatype
[21:24:33] [WARNING] CMySQLResult::GetRowDataByName - field not found ("pRMuteTime")
[21:24:33] [ERROR] cache_get_field_content_int - invalid datatype
[21:24:33] [WARNING] CMySQLResult::GetRowDataByName - field not found ("pFine")
[21:24:33] [ERROR] cache_get_field_content_int - invalid datatype
[21:24:33] [WARNING] CMySQLResult::GetRowDataByName - field not found ("pFineCount")
[21:24:33] [ERROR] cache_get_field_content_int - invalid datatype
[21:24:48] [WARNING] CMySQLResult::GetRowDataByName - field not found ("pPm")
[21:24:48] [ERROR] cache_get_field_content_int - invalid datatype
[21:24:48] [WARNING] CMySQLResult::GetRowDataByName - field not found ("neon")
[21:24:48] [ERROR] cache_get_field_content_int - invalid datatype
[21:24:48] [WARNING] CMySQLResult::GetRowDataByName - field not found ("pRMuteTime")
[21:24:48] [ERROR] cache_get_field_content_int - invalid datatype
[21:24:48] [WARNING] CMySQLResult::GetRowDataByName - field not found ("pFine")
[21:24:48] [ERROR] cache_get_field_content_int - invalid datatype
[21:24:48] [WARNING] CMySQLResult::GetRowDataByName - field not found ("pFineCount")
[21:24:48] [ERROR] cache_get_field_content_int - invalid datatype
[21:24:53] [WARNING] CMySQLResult::GetRowDataByName - field not found ("pPm")
[21:24:53] [ERROR] cache_get_field_content_int - invalid datatype
[21:24:53] [WARNING] CMySQLResult::GetRowDataByName - field not found ("neon")
[21:24:53] [ERROR] cache_get_field_content_int - invalid datatype
[21:24:53] [WARNING] CMySQLResult::GetRowDataByName - field not found ("pRMuteTime")
[21:24:53] [ERROR] cache_get_field_content_int - invalid datatype
[21:24:53] [WARNING] CMySQLResult::GetRowDataByName - field not found ("pFine")
[21:24:53] [ERROR] cache_get_field_content_int - invalid datatype
[21:24:53] [WARNING] CMySQLResult::GetRowDataByName - field not found ("pFineCount")
[21:24:53] [ERROR] cache_get_field_content_int - invalid datatype
[21:25:32] [ERROR] CMySQLQuery::Execute[] - (error #1054) Unknown column 'pRMuteTime' in 'field list'
[21:27:05] [WARNING] CMySQLResult::GetRowDataByName - field not found ("pPm")
[21:27:05] [ERROR] cache_get_field_content_int - invalid datatype
[21:27:05] [WARNING] CMySQLResult::GetRowDataByName - field not found ("neon")
[21:27:05] [ERROR] cache_get_field_content_int - invalid datatype
[21:27:05] [WARNING] CMySQLResult::GetRowDataByName - field not found ("pRMuteTime")
[21:27:05] [ERROR] cache_get_field_content_int - invalid datatype
[21:27:05] [WARNING] CMySQLResult::GetRowDataByName - field not found ("pFine")
[21:27:05] [ERROR] cache_get_field_content_int - invalid datatype
[21:27:05] [WARNING] CMySQLResult::GetRowDataByName - field not found ("pFineCount")
[21:27:05] [ERROR] cache_get_field_content_int - invalid datatype
[21:29:30] [ERROR] CMySQLQuery::Execute[] - (error #1054) Unknown column 'pRMuteTime' in 'field list'
 

 

Share this post


Link to post
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content