Рекомендованные сообщения



Не найдено.

9 posts in this topic

Здравствуйте уважаемые форумчане!

 

Сама база сохраняет данные string и int. а float нет!

При вводе команды в консоль gmx или в игре /rcon gmx все данные сохраняются кроме float!

 

Подскажите в чем дело! 

Share this post


Link to post
Share on other sites

@Andrei_Morozov, показать код стоит, наверное, для начала.

Share this post


Link to post
Share on other sites
В 25.08.2019 в 02:14, odosenok сказал:

@Andrei_Morozov, показать код стоит, наверное, для начала.

 

Спойлер

// Сохранение игровых данных
stock acc_int_strcat(query[], len, name[], number) // Для Save
{
	new string[128];
    f("`%s` = '%d',",name, number);
    strcat(query, string, len);
    return true;
}

stock acc_str_strcat(query[], len, name[], str[])  // Для Save
{
	new string[128];
    f("`%s` = '%s',",name, str);
    strcat(query, string, len);
    return true;
}

stock acc_float_strcat(query[], len, name[], Float:number)  // Для Save
{
	new string[128];
    f("`%s` = '%f',", name, number);
    strcat(query, string, len);
    return true;
}

stock SavePlayer(playerid) // Сохранение акаунта
{
	new query[2048], p = playerid;
	// if(PlayerLogin[p] == false) return false;
	GetPlayerPos(p, PI[p][pPos][0], PI[p][pPos][1], PI[p][pPos][2]);
	GetPlayerFacingAngle(p, PI[p][pPos][3]);
	GetPlayerHealth(p, PI[p][pHealth]);
	GetPlayerArmour(p, PI[p][pArmour]);
	new Interior = GetPlayerInterior(p);
	new World = GetPlayerVirtualWorld(p);
	format(PI[p][pLics],30,"%i,%i,%i,%i,%i,%i,%i,%i",PI[p][pLic][0],PI[p][pLic][1],PI[p][pLic][2],PI[p][pLic][3],PI[p][pLic][4],PI[p][pLic][5],PI[p][pLic][6],PI[p][pLic][7]);
	query = "UPDATE "T_PLAYERS" SET ";
	acc_str_strcat(query, sizeof(query), "Name", GetName(p));
	acc_str_strcat(query, sizeof(query), "Password", PI[p][pPassword]);
	// Пароль ==================================================================
	acc_str_strcat(query, sizeof(query), "Referal", PI[p][pReferal]);
	acc_int_strcat(query, sizeof(query), "Age", PI[p][pAge]);
	acc_int_strcat(query, sizeof(query), "Sex", PI[p][pSex]);
	acc_int_strcat(query, sizeof(query), "Skin", PI[p][pSkin]);
	acc_int_strcat(query, sizeof(query), "Exp", PI[p][pExp]);
	acc_int_strcat(query, sizeof(query), "Level", PI[p][pLevel]);
 	// Дата регистрации ========================================================
 	// IP Адрес регистрации ====================================================
	acc_str_strcat(query, sizeof(query), "DataVhod", PI[p][pDataVhod]);
	acc_str_strcat(query, sizeof(query), "VhodIP", PI[p][pVhodIP]);
	acc_int_strcat(query, sizeof(query), "Online", PI[p][pOnline]);
	acc_int_strcat(query, sizeof(query), "Spawn", PI[p][pSpawn]);
	acc_float_strcat(query, sizeof(query), "Health", PI[p][pHealth]);
	acc_float_strcat(query, sizeof(query), "Armour", PI[p][pArmour]);
	acc_int_strcat(query, sizeof(query), "Money", PI[p][pMoney]);
	acc_int_strcat(query, sizeof(query), "Bank", PI[p][pBank]);
	acc_int_strcat(query, sizeof(query), "PayMoney", PI[p][pPayMoney]);
	acc_int_strcat(query, sizeof(query), "Donat", PI[p][pDonat]);
	acc_int_strcat(query, sizeof(query), "Job", PI[p][pJob]);
	acc_int_strcat(query, sizeof(query), "Voennik", PI[p][pVoennik]);
	acc_int_strcat(query, sizeof(query), "Zakon", PI[p][pZakon]);
	acc_int_strcat(query, sizeof(query), "Wanted", PI[p][pWanted]);
	acc_float_strcat(query, sizeof(query), "PosX", PI[p][pPos][0]);
	acc_float_strcat(query, sizeof(query), "PosY", PI[p][pPos][1]);
	acc_float_strcat(query, sizeof(query), "PosZ", PI[p][pPos][2]);
	acc_float_strcat(query, sizeof(query), "PosA", PI[p][pPos][3]);
	acc_int_strcat(query, sizeof(query), "Interior", Interior);
	acc_int_strcat(query, sizeof(query), "World", World);
	acc_int_strcat(query, sizeof(query), "TextDraw", PI[p][pTextDraw]);
	acc_str_strcat(query, sizeof(query), "Lic", PI[p][pLics]);
	acc_int_strcat(query, sizeof(query), "Shtraf", PI[p][pShtraf]);
	acc_int_strcat(query, sizeof(query), "Mute", PI[p][pMute]);
	acc_int_strcat(query, sizeof(query), "MuteTime", PI[p][pMuteTime]);
	acc_int_strcat(query, sizeof(query), "Jail", PI[p][pJail]);
	acc_int_strcat(query, sizeof(query), "JailTime", PI[p][pJailTime]);
	acc_int_strcat(query, sizeof(query), "Vip", PI[p][pVip]);
	acc_int_strcat(query, sizeof(query), "VipTime", PI[p][pVipTime]);
	acc_int_strcat(query, sizeof(query), "Phone", PI[p][pPhone]);
	acc_int_strcat(query, sizeof(query), "SimCard", PI[p][pSimCard]);
	acc_int_strcat(query, sizeof(query), "PhoneBalans", PI[p][pPhoneBalans]);
	acc_int_strcat(query, sizeof(query), "Watch", PI[p][pWatch]);
	acc_int_strcat(query, sizeof(query), "Mask", PI[p][pMask]);
	acc_int_strcat(query, sizeof(query), "Ciggare", PI[p][pCiggare]);
	acc_int_strcat(query, sizeof(query), "Sprunk", PI[p][pSprunk]);
	acc_int_strcat(query, sizeof(query), "RepairCar", PI[p][pRepairCar]);
	acc_int_strcat(query, sizeof(query), "Card", PI[p][pCard]);
	acc_int_strcat(query, sizeof(query), "PinCard", PI[p][pPinCard]);
	acc_int_strcat(query, sizeof(query), "Snaiper", PI[p][pSnaiper]);
	acc_int_strcat(query, sizeof(query), "Deagle", PI[p][pDeagle]);
	acc_int_strcat(query, sizeof(query), "ShotGun", PI[p][pShotGun]);
	acc_int_strcat(query, sizeof(query), "Pistol", PI[p][pPistol]);
	acc_int_strcat(query, sizeof(query), "AK47", PI[p][pAK47]);
	acc_int_strcat(query, sizeof(query), "MP5", PI[p][pMP5]);
	acc_int_strcat(query, sizeof(query), "M4", PI[p][pM4]);
	strdel(query, strlen(query)-1, strlen(query));
	format(query,sizeof(query),"%s WHERE `ID` = %d LIMIT 1", query, PI[p][pID]);
	mysql_query(mysql, query);
	return true;
}
//

 

 

Share this post


Link to post
Share on other sites

@Andrei_Morozov скидывайте mysql_log.txt

Share this post


Link to post
Share on other sites
4 часа назад, DEST сказал:

@Andrei_Morozov скидывайте mysql_log.txt

 в том и дело что лога нет!

Share this post


Link to post
Share on other sites

@Andrei_Morozov, скомпилируйте с ключом -l и покажите эти же функции уже из файла ваш_мод.lst.

Share this post


Link to post
Share on other sites
2 часа назад, odosenok сказал:

@Andrei_Morozov, скомпилируйте с ключом -l и покажите эти же функции уже из файла ваш_мод.lst.

Не понял Вас куда вставить ключ?

 

Share this post


Link to post
Share on other sites

@Andrei_Morozov в pawn.cfg, который в папке pawno. Если такого нет, то создайте и поместите туда "-l".

Share this post


Link to post
Share on other sites
15 часов назад, odosenok сказал:

@Andrei_Morozov, скомпилируйте с ключом -l и покажите эти же функции уже из файла ваш_мод.lst.

Спойлер

stock acc_int_strcat(query[], len, name[], number) 
{
	new string[128];
    format(string, sizeof(string),"`%s` = '%d',",name, number);
    strcat(query, string, len);
    return true;
}

stock acc_str_strcat(query[], len, name[], str[])  
{
	new string[128];
    format(string, sizeof(string),"`%s` = '%s',",name, str);
    strcat(query, string, len);
    return true;
}

stock acc_float_strcat(query[], len, name[], Float:number)  
{
	new string[128];
    format(string, sizeof(string),"`%s` = '%f',", name, number);
    strcat(query, string, len);
    return true;
}

stock SavePlayer(playerid) 
{
	new query[2048], p = playerid;

	GetPlayerPos(p, PI[p][pPos][0], PI[p][pPos][1], PI[p][pPos][2]);
	GetPlayerFacingAngle(p, PI[p][pPos][3]);
	GetPlayerHealth(p, PI[p][pHealth]);
	GetPlayerArmour(p, PI[p][pArmour]);
	new Interior = GetPlayerInterior(p);
	new World = GetPlayerVirtualWorld(p);
	format(PI[p][pLics],30,"%i,%i,%i,%i,%i,%i,%i,%i",PI[p][pLic][0],PI[p][pLic][1],PI[p][pLic][2],PI[p][pLic][3],PI[p][pLic][4],PI[p][pLic][5],PI[p][pLic][6],PI[p][pLic][7]);
	query = "UPDATE ""`players`"" SET ";
	acc_str_strcat(query, sizeof(query), "Name", PI[p][pName]);
	acc_str_strcat(query, sizeof(query), "Password", PI[p][pPassword]);

	acc_str_strcat(query, sizeof(query), "Referal", PI[p][pReferal]);
	acc_int_strcat(query, sizeof(query), "Age", PI[p][pAge]);
	acc_int_strcat(query, sizeof(query), "Sex", PI[p][pSex]);
	acc_int_strcat(query, sizeof(query), "Skin", PI[p][pSkin]);
	acc_int_strcat(query, sizeof(query), "Exp", PI[p][pExp]);
	acc_int_strcat(query, sizeof(query), "Level", PI[p][pLevel]);


	acc_str_strcat(query, sizeof(query), "DataVhod", PI[p][pDataVhod]);
	acc_str_strcat(query, sizeof(query), "VhodIP", PI[p][pVhodIP]);
	acc_int_strcat(query, sizeof(query), "Online", PI[p][pOnline]);
	acc_int_strcat(query, sizeof(query), "Spawn", PI[p][pSpawn]);
	acc_float_strcat(query, sizeof(query), "Health", PI[p][pHealth]);
	acc_float_strcat(query, sizeof(query), "Armour", PI[p][pArmour]);
	acc_int_strcat(query, sizeof(query), "Money", PI[p][pMoney]);
	acc_int_strcat(query, sizeof(query), "Bank", PI[p][pBank]);
	acc_int_strcat(query, sizeof(query), "PayMoney", PI[p][pPayMoney]);
	acc_int_strcat(query, sizeof(query), "Donat", PI[p][pDonat]);
	acc_int_strcat(query, sizeof(query), "Job", PI[p][pJob]);
	acc_int_strcat(query, sizeof(query), "Voennik", PI[p][pVoennik]);
	acc_int_strcat(query, sizeof(query), "Zakon", PI[p][pZakon]);
	acc_int_strcat(query, sizeof(query), "Wanted", PI[p][pWanted]);
	acc_float_strcat(query, sizeof(query), "PosX", PI[p][pPos][0]);
	acc_float_strcat(query, sizeof(query), "PosY", PI[p][pPos][1]);
	acc_float_strcat(query, sizeof(query), "PosZ", PI[p][pPos][2]);
	acc_float_strcat(query, sizeof(query), "PosA", PI[p][pPos][3]);
	acc_int_strcat(query, sizeof(query), "Interior", Interior);
	acc_int_strcat(query, sizeof(query), "World", World);
	acc_int_strcat(query, sizeof(query), "TextDraw", PI[p][pTextDraw]);
	acc_str_strcat(query, sizeof(query), "Lic", PI[p][pLics]);
	acc_int_strcat(query, sizeof(query), "Shtraf", PI[p][pShtraf]);
	acc_int_strcat(query, sizeof(query), "Mute", PI[p][pMute]);
	acc_int_strcat(query, sizeof(query), "MuteTime", PI[p][pMuteTime]);
	acc_int_strcat(query, sizeof(query), "Jail", PI[p][pJail]);
	acc_int_strcat(query, sizeof(query), "JailTime", PI[p][pJailTime]);
	acc_int_strcat(query, sizeof(query), "Vip", PI[p][pVip]);
	acc_int_strcat(query, sizeof(query), "VipTime", PI[p][pVipTime]);
	acc_int_strcat(query, sizeof(query), "Phone", PI[p][pPhone]);
	acc_int_strcat(query, sizeof(query), "SimCard", PI[p][pSimCard]);
	acc_int_strcat(query, sizeof(query), "PhoneBalans", PI[p][pPhoneBalans]);
	acc_int_strcat(query, sizeof(query), "Watch", PI[p][pWatch]);
	acc_int_strcat(query, sizeof(query), "Mask", PI[p][pMask]);
	acc_int_strcat(query, sizeof(query), "Ciggare", PI[p][pCiggare]);
	acc_int_strcat(query, sizeof(query), "Sprunk", PI[p][pSprunk]);
	acc_int_strcat(query, sizeof(query), "RepairCar", PI[p][pRepairCar]);
	acc_int_strcat(query, sizeof(query), "Card", PI[p][pCard]);
	acc_int_strcat(query, sizeof(query), "PinCard", PI[p][pPinCard]);
	acc_int_strcat(query, sizeof(query), "Snaiper", PI[p][pSnaiper]);
	acc_int_strcat(query, sizeof(query), "Deagle", PI[p][pDeagle]);
	acc_int_strcat(query, sizeof(query), "ShotGun", PI[p][pShotGun]);
	acc_int_strcat(query, sizeof(query), "Pistol", PI[p][pPistol]);
	acc_int_strcat(query, sizeof(query), "AK47", PI[p][pAK47]);
	acc_int_strcat(query, sizeof(query), "MP5", PI[p][pMP5]);
	acc_int_strcat(query, sizeof(query), "M4", PI[p][pM4]);
	acc_int_strcat(query, sizeof(query), "FracLeader", PI[p][pFracLeader]);
	acc_int_strcat(query, sizeof(query), "Frac", PI[p][pFrac]);
	acc_int_strcat(query, sizeof(query), "FracRang", PI[p][pFracRang]);
	acc_int_strcat(query, sizeof(query), "FracSkin", PI[p][pFracSkin]);
	acc_int_strcat(query, sizeof(query), "FracWarn", PI[p][pFracWarn]);
	acc_int_strcat(query, sizeof(query), "FracObjects", PI[p][pFracObjects]);
	acc_int_strcat(query, sizeof(query), "MenuTD", PI[p][pMenuTD]);
	strdel(query, strlen(query)-1, strlen(query));
	format(query,sizeof(query),"%s WHERE `ID` = %d LIMIT 1", query, PI[p][pID]);
	mysql_query(mysql, query);
	return true;
}

 

 

Share this post


Link to post
Share on other sites
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

    • .037
      By .037
      в чём может быть проблема? Передаю строку через PR_String, и получаю с клиента бред
      CMD:TestData(playerid, params[]){ new msg[] = "Code_Test"; new BitStream:bs = BS_New(); BS_WriteInt8(bs,30); BS_WriteFloat(bs,0.9); BS_WriteFloat(bs,23.4); BS_WriteString(bs, msg, sizeof msg); PR_SendRPC(bs, playerid, 179); BS_Delete(bs); return 1; } [05:57:27] RPC - Длина  30 | 0.900000 | 23.400000 | I*(!@dp
      И всегда текст разный 

      Хотя принимаю всё нормально:

       
      bool CALLBACK Hok_RPC_BYTE(stRakNetHookParams *params) { if (params->packetId == 179) { SF->getSAMP()->getChat()->AddChatMessage(D3DCOLOR_XRGB(0, 0xAA, 0), "Кастомный RPC работает!!!"); byte nameLen; float test; float test1; char szPlayerName[100]; params->bitStream->ResetReadPointer(); params->bitStream->Read(nameLen); params->bitStream->Read(test); params->bitStream->Read(test1); params->bitStream->Read(szPlayerName, 100); params->bitStream->ResetReadPointer(); SF->getSAMP()->getChat()->AddChatMessage(D3DCOLOR_XRGB(0, 0xAA, 0), "RPC - Длина %d | %f | %f | %s", nameLen, test , test1, szPlayerName); } return true; };