shape1
shape2
shape3
shape4
shape7
shape8

Аккаунты


Статус
Закрыто для дальнейших ответов.

Alexanders

Новичок
Пользователь
01.05.2014
19
0
0
Здравствуйте,появился такой

вопрос.Как исправить баг со слетом

аккаунтов в моде Need For Role Play |

okkupay servers ?

Описание:например у человека просто

слетает аккаунт,тоесть лвл и прочее все

по 0.Играл он нормально,зашел на

следующий день,аккаунт по 0.

Как решить данную проблему?

 

ElHudson

Освоившийся
Пользователь
14.05.2014
73
50
0
21
Поставить сервер на хостинг

 

Moks

Учитель русского языка
Пользователь
28.02.2014
539
1
81
0
При дисконнекте сохранение аккаунта прописано?

 
C

compan

Гость
Гость
Гадание на кофейной гуще.

 

Alexanders

Новичок
Пользователь
01.05.2014
19
0
0
OnPlayerDisconnect(playerid,reason)
 

if(gPlayerLogged[playerid] == 1)
{
SaveAccount(playerid);
}
Паблик сохранения
 

Код:
stock SaveAccount(playerid)
{
CheckMySQLConnection();//Проверка на коннект
format(Query, 300, "UPDATE `users` SET `Level` = '%d', `Admin` = '%d', `Sex` = '%d', `Age` = '%d', `MuteTime` = '%d', `Exp` = '%d', `Money` = '%d', `Bank` = '%d', `Deaths` = '%d' WHERE `Name` = '%s'", PlayerInfo[playerid][pLevel],
PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pSex], PlayerInfo[playerid][pAge], PlayerInfo[playerid][pMuteTime], PlayerInfo[playerid][pExp], PlayerInfo[playerid][pMoney], PlayerInfo[playerid][pBankMoney], PlayerInfo[playerid][pDeaths], PlayerInfo[playerid][pName]), mysql_query(Query);
format(Query, 300, "UPDATE `users` SET `Job` = '%d', `JailedTime` = '%d', `Drugs` = '%d', `Leader` = '%d', `Member` = '%d', `Rang` = '%d', `Skin` = '%d', `Health` = '%f', `HouseKey` = '%d', `Pbiskey` = '%d' WHERE `Name` = '%s'", PlayerInfo[playerid][pJob],
PlayerInfo[playerid][pJailTime], PlayerInfo[playerid][pDrugs], PlayerInfo[playerid][pLeader], PlayerInfo[playerid][pMember], PlayerInfo[playerid][pRang], PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pHealth], PlayerInfo[playerid][pPbiskey], PlayerInfo[playerid][pPbiskey], PlayerInfo[playerid][pName]), mysql_query(Query);
format(Query, 400, "UPDATE `users` SET `Pos_x` = '%f', `Pos_y` = '%f', `Pos_z` = '%f', `CarLic` = '%d', `FlyLic` = '%d', `BoatLic` = '%d', `GunLic` = '%d', `MotoLic` = '%d', `CarD` = '%d', `CarC` = '%d' WHERE `Name` = '%s'", PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y],
PlayerInfo[playerid][pPos_z], PlayerInfo[playerid][pCarB], PlayerInfo[playerid][pFlyLic], PlayerInfo[playerid][pBoatLic], PlayerInfo[playerid][pGunLic], PlayerInfo[playerid][pCarA], PlayerInfo[playerid][pCarD], PlayerInfo[playerid][pCarC], PlayerInfo[playerid][pName]), mysql_query(Query);
format(Query, 800, "UPDATE `users` SET `Warn` = '%d', `Wanted` = '%d', `FWarns` = '%d', `FlayKey` = '%d', `Passnum` = '%d', `Pass` = '%d', `Karta` = '%d', `Pinkod` = '%d', `Phone` = '%d', `Fskin` = '%d', `Metall` = '%d', `Patr` = '%d', `Hospital` = '%d', `Team` = '%d', `Spawn` = '%d', `Org` = '%d', `WarnTime` = '%d', `Donate` = '%d', `voen` = '%d', `vnk` = '%d' WHERE `Name` = '%s'",
PlayerInfo[playerid][pWarn], PlayerInfo[playerid][pWanted], PlayerInfo[playerid][pFWarns], PlayerInfo[playerid][pPbiskey], PlayerInfo[playerid][pPassnum], PlayerInfo[playerid][pPass], PlayerInfo[playerid][pKarta], PlayerInfo[playerid][pPinkod], PlayerInfo[playerid][pPhone], PlayerInfo[playerid][pFSkin],
PlayerInfo[playerid][pMetall], PlayerInfo[playerid][pPatr], PlayerInfo[playerid][pHospital], PlayerInfo[playerid][pTeam], PlayerInfo[playerid][pSpawn], PlayerInfo[playerid][pOrg], PlayerInfo[playerid][pWarnTime],PlayerInfo[playerid][pClyzba],PlayerInfo[playerid][pVoennik],PlayerInfo[playerid][pDonateMoney],PlayerInfo[playerid][pName]), mysql_query(Query);
mysql_store_result();
return true;
}
 
Последнее редактирование модератором:
C

compan

Гость
Гость
в файле server.cfg есть строки filterscripts and plugins - бросьте эти строки сюда.

 

Moks

Учитель русского языка
Пользователь
28.02.2014
539
1
81
0
В загрузке аккаунта есть что-то подобное этому: gPlayerLogged[playerid] = 1;

 
C

compan

Гость
Гость
 Используйте printf. Проверяйте, какой запрос отсылается в БД, возможно, не хватает массива

 
C

compan

Гость
Гость
мы не можем вас тут учить скриптингу,можем подсказать только что делать,если вы не знаете элементарных вещей... как вам помочь. Вот пример: printf("%s",string)

 
A

Amfy

Гость
Гость
Скинь содержимое CheckMySQLConnection

 

Alexanders

Новичок
Пользователь
01.05.2014
19
0
0
Скинь содержимое CheckMySQLConnection
Код:
ConnectMySQL()
{
mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
switch(mysql_ping()) {
case 1: print(" БД MySQL успешно подключена.");
case -1: print(" БД MySQL не подключена. ");
}
return true;
}
 
Код:
DisconnectMySQL() return mysql_close(), print("БД MySQL отключена.");


CheckMySQLConnection()
{
if(mysql_ping() == -1) return mysql_reconnect();
return true;
}
 
A

Amfy

Гость
Гость
Попробуй так:

stock SaveAccount(playerid)
{
CheckMySQLConnection();
new s[300],list[870];
format(s,190,"UPDATE `users` SET Level='%d',Admin='%d',Sex='%d',Age='%d',MuteTime='%d',Exp='%d',Money='%d',Bank='%d',Deaths='%d',",PlayerInfo[playerid][pLevel],
PlayerInfo[playerid][pAdmin],PlayerInfo[playerid][pSex],PlayerInfo[playerid][pAge],PlayerInfo[playerid][pMuteTime],PlayerInfo[playerid][pExp],PlayerInfo[playerid][pMoney],
PlayerInfo[playerid][pBankMoney],PlayerInfo[playerid][pDeaths]);
strcat(list,s);
format(s,190,"Job='%d',JailedTime='%d',Drugs='%d',Leader='%d',Member='%d',Rang='%d',Skin='%d',Health='%f',HouseKey='%d',Pbiskey='%d',",PlayerInfo[playerid][pJob],
PlayerInfo[playerid][pJailTime],PlayerInfo[playerid][pDrugs],PlayerInfo[playerid][pLeader],PlayerInfo[playerid][pMember],PlayerInfo[playerid][pRang],PlayerInfo[playerid][pSkin],PlayerInfo[playerid][pHealth],
PlayerInfo[playerid][pPbiskey],PlayerInfo[playerid][pPbiskey]);
strcat(list,s);
format(s,190,"Pos_x='%f',Pos_y='%f',Pos_z='%f',CarLic='%d',FlyLic='%d',BoatLic='%d',GunLic='%d',MotoLic='%d',CarD='%d',CarC='%d',",PlayerInfo[playerid][pPos_x],
PlayerInfo[playerid][pPos_y],PlayerInfo[playerid][pPos_z],PlayerInfo[playerid][pCarB],PlayerInfo[playerid][pFlyLic],PlayerInfo[playerid][pBoatLic],PlayerInfo[playerid][pGunLic],
PlayerInfo[playerid][pCarA],PlayerInfo[playerid][pCarD],PlayerInfo[playerid][pCarC]);
strcat(list,s);
format(s,300,"Warn='%d',Wanted='%d',FWarns='%d',FlayKey='%d',Passnum='%d',Pass='%d',Karta='%d',Pinkod='%d',Phone='%d',Fskin='%d',Metall='%d',Patr='%d',\
Hospital='%d',Team='%d',Spawn='%d',Org='%d',WarnTime='%d',Donate='%d',voen='%d',vnk='%d' WHERE Name='%s'",
PlayerInfo[playerid][pWarn],PlayerInfo[playerid][pWanted],PlayerInfo[playerid][pFWarns],PlayerInfo[playerid][pPbiskey],PlayerInfo[playerid][pPassnum],PlayerInfo[playerid][pPass],
PlayerInfo[playerid][pKarta],PlayerInfo[playerid][pPinkod],PlayerInfo[playerid][pPhone],PlayerInfo[playerid][pFSkin],PlayerInfo[playerid][pMetall],PlayerInfo[playerid][pPatr],
PlayerInfo[playerid][pHospital],PlayerInfo[playerid][pTeam],PlayerInfo[playerid][pSpawn],PlayerInfo[playerid][pOrg],PlayerInfo[playerid][pWarnTime],PlayerInfo[playerid][pClyzba],
PlayerInfo[playerid][pVoennik],PlayerInfo[playerid][pDonateMoney],PlayerInfo[playerid][pName]);
strcat(list,s);
mysql_query(list);
printf("%s",list);
mysql_store_result();
return 1;
}

Если не работает - скинь содержимое server_log

 

Moks

Учитель русского языка
Пользователь
28.02.2014
539
1
81
0
OnPlayerDisconnect(playerid,reason)


if(gPlayerLogged[playerid] == 1)
{
SaveAccount(playerid);
}
Паблик сохранения

stock SaveAccount(playerid)
{
CheckMySQLConnection();//Проверка на коннект
format(Query, 300, "UPDATE `users` SET `Level` = '%d', `Admin` = '%d', `Sex` = '%d', `Age` = '%d', `MuteTime` = '%d', `Exp` = '%d', `Money` = '%d', `Bank` = '%d', `Deaths` = '%d' WHERE `Name` = '%s'", PlayerInfo[playerid][pLevel],
PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pSex], PlayerInfo[playerid][pAge], PlayerInfo[playerid][pMuteTime], PlayerInfo[playerid][pExp], PlayerInfo[playerid][pMoney], PlayerInfo[playerid][pBankMoney], PlayerInfo[playerid][pDeaths], PlayerInfo[playerid][pName]), mysql_query(Query);
format(Query, 300, "UPDATE `users` SET `Job` = '%d', `JailedTime` = '%d', `Drugs` = '%d', `Leader` = '%d', `Member` = '%d', `Rang` = '%d', `Skin` = '%d', `Health` = '%f', `HouseKey` = '%d', `Pbiskey` = '%d' WHERE `Name` = '%s'", PlayerInfo[playerid][pJob],
PlayerInfo[playerid][pJailTime], PlayerInfo[playerid][pDrugs], PlayerInfo[playerid][pLeader], PlayerInfo[playerid][pMember], PlayerInfo[playerid][pRang], PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pHealth], PlayerInfo[playerid][pPbiskey], PlayerInfo[playerid][pPbiskey], PlayerInfo[playerid][pName]), mysql_query(Query);
format(Query, 400, "UPDATE `users` SET `Pos_x` = '%f', `Pos_y` = '%f', `Pos_z` = '%f', `CarLic` = '%d', `FlyLic` = '%d', `BoatLic` = '%d', `GunLic` = '%d', `MotoLic` = '%d', `CarD` = '%d', `CarC` = '%d' WHERE `Name` = '%s'", PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y],
PlayerInfo[playerid][pPos_z], PlayerInfo[playerid][pCarB], PlayerInfo[playerid][pFlyLic], PlayerInfo[playerid][pBoatLic], PlayerInfo[playerid][pGunLic], PlayerInfo[playerid][pCarA], PlayerInfo[playerid][pCarD], PlayerInfo[playerid][pCarC], PlayerInfo[playerid][pName]), mysql_query(Query);
format(Query, 800, "UPDATE `users` SET `Warn` = '%d', `Wanted` = '%d', `FWarns` = '%d', `FlayKey` = '%d', `Passnum` = '%d', `Pass` = '%d', `Karta` = '%d', `Pinkod` = '%d', `Phone` = '%d', `Fskin` = '%d', `Metall` = '%d', `Patr` = '%d', `Hospital` = '%d', `Team` = '%d', `Spawn` = '%d', `Org` = '%d', `WarnTime` = '%d', `Donate` = '%d', `voen` = '%d', `vnk` = '%d' WHERE `Name` = '%s'",
PlayerInfo[playerid][pWarn], PlayerInfo[playerid][pWanted], PlayerInfo[playerid][pFWarns], PlayerInfo[playerid][pPbiskey], PlayerInfo[playerid][pPassnum], PlayerInfo[playerid][pPass], PlayerInfo[playerid][pKarta], PlayerInfo[playerid][pPinkod], PlayerInfo[playerid][pPhone], PlayerInfo[playerid][pFSkin],
PlayerInfo[playerid][pMetall], PlayerInfo[playerid][pPatr], PlayerInfo[playerid][pHospital], PlayerInfo[playerid][pTeam], PlayerInfo[playerid][pSpawn], PlayerInfo[playerid][pOrg], PlayerInfo[playerid][pWarnTime],PlayerInfo[playerid][pClyzba],PlayerInfo[playerid][pVoennik],PlayerInfo[playerid][pDonateMoney],PlayerInfo[playerid][pName]), mysql_query(Query);
mysql_store_result();
return true;
}
Попробуйте в самое начало стока добавить:

Код:
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, -1, "Ошибка сохранения аккаунта!");
 

Alexanders

Новичок
Пользователь
01.05.2014
19
0
0
Попробуй так:

stock SaveAccount(playerid)
{
CheckMySQLConnection();
new s[300],list[870];
format(s,190,"UPDATE `users` SET Level='%d',Admin='%d',Sex='%d',Age='%d',MuteTime='%d',Exp='%d',Money='%d',Bank='%d',Deaths='%d',",PlayerInfo[playerid][pLevel],
PlayerInfo[playerid][pAdmin],PlayerInfo[playerid][pSex],PlayerInfo[playerid][pAge],PlayerInfo[playerid][pMuteTime],PlayerInfo[playerid][pExp],PlayerInfo[playerid][pMoney],
PlayerInfo[playerid][pBankMoney],PlayerInfo[playerid][pDeaths]);
strcat(list,s);
format(s,190,"Job='%d',JailedTime='%d',Drugs='%d',Leader='%d',Member='%d',Rang='%d',Skin='%d',Health='%f',HouseKey='%d',Pbiskey='%d',",PlayerInfo[playerid][pJob],
PlayerInfo[playerid][pJailTime],PlayerInfo[playerid][pDrugs],PlayerInfo[playerid][pLeader],PlayerInfo[playerid][pMember],PlayerInfo[playerid][pRang],PlayerInfo[playerid][pSkin],PlayerInfo[playerid][pHealth],
PlayerInfo[playerid][pPbiskey],PlayerInfo[playerid][pPbiskey]);
strcat(list,s);
format(s,190,"Pos_x='%f',Pos_y='%f',Pos_z='%f',CarLic='%d',FlyLic='%d',BoatLic='%d',GunLic='%d',MotoLic='%d',CarD='%d',CarC='%d',",PlayerInfo[playerid][pPos_x],
PlayerInfo[playerid][pPos_y],PlayerInfo[playerid][pPos_z],PlayerInfo[playerid][pCarB],PlayerInfo[playerid][pFlyLic],PlayerInfo[playerid][pBoatLic],PlayerInfo[playerid][pGunLic],
PlayerInfo[playerid][pCarA],PlayerInfo[playerid][pCarD],PlayerInfo[playerid][pCarC]);
strcat(list,s);
format(s,300,"Warn='%d',Wanted='%d',FWarns='%d',FlayKey='%d',Passnum='%d',Pass='%d',Karta='%d',Pinkod='%d',Phone='%d',Fskin='%d',Metall='%d',Patr='%d',\
Hospital='%d',Team='%d',Spawn='%d',Org='%d',WarnTime='%d',Donate='%d',voen='%d',vnk='%d' WHERE Name='%s'",
PlayerInfo[playerid][pWarn],PlayerInfo[playerid][pWanted],PlayerInfo[playerid][pFWarns],PlayerInfo[playerid][pPbiskey],PlayerInfo[playerid][pPassnum],PlayerInfo[playerid][pPass],
PlayerInfo[playerid][pKarta],PlayerInfo[playerid][pPinkod],PlayerInfo[playerid][pPhone],PlayerInfo[playerid][pFSkin],PlayerInfo[playerid][pMetall],PlayerInfo[playerid][pPatr],
PlayerInfo[playerid][pHospital],PlayerInfo[playerid][pTeam],PlayerInfo[playerid][pSpawn],PlayerInfo[playerid][pOrg],PlayerInfo[playerid][pWarnTime],PlayerInfo[playerid][pClyzba],
PlayerInfo[playerid][pVoennik],PlayerInfo[playerid][pDonateMoney],PlayerInfo[playerid][pName]);
strcat(list,s);
mysql_query(list);
printf("%s",list);
mysql_store_result();
return 1;
}

Если не работает - скинь содержимое server_log
Спасибо,пока все хорошо!

 
Статус
Закрыто для дальнейших ответов.