sanya25331
Новичок
Здравствуйте форумчани Pawno-Info.
Столкнулся с такой проблемой.
Значить запускаю мод на mysql(базу подключил)
Захожу на сервер регистрируюсь,захожу опять на сервер и снова регистрация.
Зашёл в Phpmyadmin в users,аккаунт там есть. Опять захожу на сервер под тем же ником.
И снова регистрируется аккаунт,и уже с таким ником два аккаунта в users.
Помогите решить проблему.
Вот структура таблицы users
Вот в моде запись.
И SavePlayer
Столкнулся с такой проблемой.
Значить запускаю мод на mysql(базу подключил)
Захожу на сервер регистрируюсь,захожу опять на сервер и снова регистрация.
Зашёл в Phpmyadmin в users,аккаунт там есть. Опять захожу на сервер под тем же ником.
И снова регистрируется аккаунт,и уже с таким ником два аккаунта в users.
Помогите решить проблему.
Вот структура таблицы users
PHP:
--
-- Структура таблицы `users`
--
CREATE TABLE IF NOT EXISTS `users` (
`nick` varchar(50) NOT NULL,
`pass` varchar(50) NOT NULL,
`Mail` varchar(50) NOT NULL,
`tuts` int(11) NOT NULL,
`Level` int(11) NOT NULL,
`skin` int(11) NOT NULL,
`Char` int(11) NOT NULL,
`House` int(11) NOT NULL,
`Car` int(11) NOT NULL,
`Fuel` int(11) NOT NULL,
`Exp` int(11) NOT NULL,
`Cash` int(11) NOT NULL,
`member` int(11) NOT NULL,
`Leader` int(11) NOT NULL,
`rang` int(11) NOT NULL,
`admin` int(11) NOT NULL,
`Reg` int(11) NOT NULL,
`Proverka` int(11) NOT NULL,
`phone` int(11) NOT NULL,
`Code` int(11) NOT NULL,
`Warns` int(11) NOT NULL,
`Telefon` int(11) NOT NULL,
`Jailed` int(11) NOT NULL,
`JailTime` int(11) NOT NULL,
`Muted` int(11) NOT NULL,
`MuteTime` int(11) NOT NULL,
`Koika` int(11) NOT NULL,
`Lechenie` int(11) NOT NULL,
`Donat` int(11) NOT NULL,
`Mats` int(11) NOT NULL,
`Patrons` int(11) NOT NULL,
`Zakon` int(11) NOT NULL,
`Bizer` int(11) NOT NULL,
`Bank` int(11) NOT NULL,
`Job` int(11) NOT NULL,
`Wanted` int(11) NOT NULL,
`LicCar` int(11) NOT NULL,
`VidAuto` int(3) NOT NULL,
`ProfLic` int(11) NOT NULL,
`Sex` int(11) NOT NULL,
`Doors` int(11) NOT NULL,
`Drugs` int(11) NOT NULL,
`Activ` int(11) NOT NULL,
`DostupLock` int(11) NOT NULL,
`DostupUnLock` int(11) NOT NULL,
`Upgrades` int(11) NOT NULL,
`pPhousekeyfriend` int(11) NOT NULL,
`RegStep` int(11) NOT NULL,
`Text` int(11) NOT NULL,
`AZSOwner` int(11) NOT NULL,
`BedArm` int(11) NOT NULL,
`Armour` int(11) NOT NULL,
`Health` float NOT NULL,
`LastEnter` int(11) NOT NULL,
`LastIP` varchar(50) NOT NULL,
`pAmmo` float NOT NULL,
`pGun` float NOT NULL,
`Resh` int(3) NOT NULL,
`Sum` int(3) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
PHP:
forward LoadPlayerData(playerid);
public LoadPlayerData(playerid)
{
new rows, fields;
cache_get_data(rows, fields);
if(rows)
{
cache_get_field_content(0, "pass", temp); strmid(PlayerInfo[playerid][pPass], temp, 0, 128, 128);
cache_get_field_content(0, "Mail", temp); strmid(PlayerInfo[playerid][pEmail], temp, 0, 128, 128);
cache_get_field_content(0, "tuts", temp); PlayerInfo[playerid][pTuts] = strval(temp);
cache_get_field_content(0, "Level", temp); PlayerInfo[playerid][pLevel] = strval(temp);
cache_get_field_content(0, "skin", temp); PlayerInfo[playerid][pSkin] = strval(temp);
cache_get_field_content(0, "Char", temp); PlayerInfo[playerid][pChar] = strval(temp);
cache_get_field_content(0, "House", temp); PlayerInfo[playerid][pPhousekey] = strval(temp);
cache_get_field_content(0, "Car", temp); PlayerInfo[playerid][pCar] = strval(temp);
cache_get_field_content(0, "Fuel", temp); PlayerInfo[playerid][pFuel] = strval(temp);
cache_get_field_content(0, "Exp", temp); PlayerInfo[playerid][pExp] = strval(temp);
cache_get_field_content(0, "Cash", temp); PlayerInfo[playerid][pCash] = strval(temp);
cache_get_field_content(0, "member", temp); PlayerInfo[playerid][pMember] = strval(temp);
cache_get_field_content(0, "Leader", temp); PlayerInfo[playerid][pLeader] = strval(temp);
cache_get_field_content(0, "rang", temp); PlayerInfo[playerid][pRang] = strval(temp);
cache_get_field_content(0, "admin", temp); PlayerInfo[playerid][pAdmin] = strval(temp);
cache_get_field_content(0, "Reg", temp); PlayerInfo[playerid][pReg] = strval(temp);
cache_get_field_content(0, "Proverka", temp); PlayerInfo[playerid][pProverka] = strval(temp);
cache_get_field_content(0, "phone", temp); PlayerInfo[playerid][pNumber] = strval(temp);
cache_get_field_content(0, "Code", temp); PlayerInfo[playerid][pCode] = strval(temp);
cache_get_field_content(0, "Warns", temp); PlayerInfo[playerid][pWarn] = strval(temp);
cache_get_field_content(0, "Telefon", temp); PlayerInfo[playerid][pTelefon] = strval(temp);
cache_get_field_content(0, "Jailed", temp); PlayerInfo[playerid][pJailed] = strval(temp);
cache_get_field_content(0, "JailTime", temp); PlayerInfo[playerid][pJailTime] = strval(temp);
cache_get_field_content(0, "Muted", temp); PlayerInfo[playerid][pMuted] = strval(temp);
cache_get_field_content(0, "MuteTime", temp); PlayerInfo[playerid][pMuteTime] = strval(temp);
cache_get_field_content(0, "Koika", temp); PlayerInfo[playerid][pKoika] = strval(temp);
cache_get_field_content(0, "Lechenie", temp); PlayerInfo[playerid][pLechenie] = strval(temp);
cache_get_field_content(0, "Donat", temp); PlayerInfo[playerid][pDonat] = strval(temp);
cache_get_field_content(0, "Mats", temp); PlayerInfo[playerid][pMats] = strval(temp);
cache_get_field_content(0, "Patrons", temp); PlayerInfo[playerid][pPatron] = strval(temp);
cache_get_field_content(0, "Zakon", temp); PlayerInfo[playerid][pZakon] = strval(temp);
cache_get_field_content(0, "Bizer", temp); PlayerInfo[playerid][pVladelec] = strval(temp);
cache_get_field_content(0, "Bank", temp); PlayerInfo[playerid][pBank] = strval(temp);
cache_get_field_content(0, "Job", temp); PlayerInfo[playerid][pJob] = strval(temp);
cache_get_field_content(0, "Wanted", temp); PlayerInfo[playerid][pZvezd] = strval(temp);
cache_get_field_content(0, "LicCar", temp); PlayerInfo[playerid][pLicCar] = strval(temp);
cache_get_field_content(0, "ProfLic", temp); PlayerInfo[playerid][pProfLic] = strval(temp);
cache_get_field_content(0, "Sex", temp); PlayerInfo[playerid][pSex] = strval(temp);
cache_get_field_content(0, "Doors", temp); PlayerInfo[playerid][pAvtomV] = strval(temp);
cache_get_field_content(0, "Drugs", temp); PlayerInfo[playerid][pDrugs] = strval(temp);
cache_get_field_content(0, "Activ", temp); PlayerInfo[playerid][pActiv] = strval(temp);
cache_get_field_content(0, "DostupLock", temp); PlayerInfo[playerid][pDostupLock] = strval(temp);
cache_get_field_content(0, "DostupUnLock", temp); PlayerInfo[playerid][pDostupUnLock] = strval(temp);
cache_get_field_content(0, "Resh", temp); PlayerInfo[playerid][pResh] = strval(temp);
cache_get_field_content(0, "Sum", temp); PlayerInfo[playerid][pSum] = strval(temp);
cache_get_field_content(0, "Upgrades", temp); PlayerInfo[playerid][pUluch] = strval(temp);
cache_get_field_content(0, "pPhousekeyfriend", temp); PlayerInfo[playerid][pPhousekeyfriend] = strval(temp);
cache_get_field_content(0, "RegStep", temp); PlayerInfo[playerid][pRegStep] = strval(temp);
cache_get_field_content(0, "Text", temp); PlayerInfo[playerid][pText] = strval(temp);
cache_get_field_content(0, "AZSOwner", temp); PlayerInfo[playerid][pAZSOwner] = strval(temp);
cache_get_field_content(0, "BedArm", temp); PlayerInfo[playerid][pBedArm] = strval(temp);
cache_get_field_content(0, "Armour", temp); PlayerInfo[playerid][pArmour] = strval(temp);
cache_get_field_content(0, "Health", temp); PlayerInfo[playerid][pHealth] = floatstr(temp);
cache_get_field_content(0, "LastEnter", temp); PlayerInfo[playerid][pLastEnter] = strval(temp);
cache_get_field_content(0, "LastIP", temp); strmid(PlayerInfo[playerid][pLastIP], temp, 0, 32, 32);
}
for(new i = 0; i < 11; i++) { PlayerInfo[playerid][pGun][i] = 0; PlayerInfo[playerid][pAmmo][i] = 0; }
gPlayerLoaded[playerid] = 1;
TogglePlayerControllable(playerid, false);
SpawnPlayer(playerid);
SetPlayerPos(playerid, 1678.2035, -1481.4669, 110.1527);
SetPlayerCameraPos(playerid, 1678.2035, -1481.4669, 110.1527);
SetPlayerCameraLookAt(playerid, 1614.6501, -1576.7792, 88.1527);
if(PlayerInfo[playerid][pRegStep] < 3)
{
new text[64];
PlayerInfo[playerid][pTuts] = 0;
ShowStepRegister(playerid, PlayerInfo[playerid][pRegStep]);
if(PlayerInfo[playerid][pRegStep] == 3)
{
format(text, sizeof(text), "DELETE FROM `users` WHERE `nick`='%s'", PlayerInfo[playerid][pNick]);
mysql_function_query(1, text, false, "", "");
}
}
else if(PlayerInfo[playerid][pRegStep] == 3) return ShowStepAuth(playerid, 0);
return true;
}
PHP:
stock SavePlayerData(playerid)
{
if(gPlayerLoaded[playerid] == 0) return true;
mysql_format(1, querysave, 1024, "UPDATE `users` SET `Level`='%d',`House`='%d',`Car`='%d',`admin`='%d',`Leader`='%d',`member`='%d',`phone`='%d',`rang`='%d',`tuts`='%d',`skin`='%d',`Char`='%d',`Cash`='%d',`Exp`='%d',`Reg`='%d',`Proverka`='%d',`Code` ='%d' ,`Jailed`='%d',`JailTime`='%d',`Muted`='%d',`MuteTime`='%d' WHERE `nick` = '%s'",
PlayerInfo[playerid][pLevel],
PlayerInfo[playerid][pPhousekey],
PlayerInfo[playerid][pCar],
PlayerInfo[playerid][pAdmin],
PlayerInfo[playerid][pLeader],
PlayerInfo[playerid][pMember],
PlayerInfo[playerid][pNumber],
PlayerInfo[playerid][pRang],
PlayerInfo[playerid][pTuts],
PlayerInfo[playerid][pSkin],
PlayerInfo[playerid][pChar],
PlayerInfo[playerid][pCash],
PlayerInfo[playerid][pExp],
PlayerInfo[playerid][pReg],
PlayerInfo[playerid][pProverka],
PlayerInfo[playerid][pCode],
PlayerInfo[playerid][pJailed],
PlayerInfo[playerid][pJailTime],
PlayerInfo[playerid][pMuted],
PlayerInfo[playerid][pMuteTime],
PlayerInfo[playerid][pNick]);
mysql_tquery(1, querysave, "", "");
mysql_format(1, querysave, 1024, "UPDATE `users` SET `Sex`='%d',`VidAuto`='%d',`Job`='%d',`LicCar`='%d',`ProfLic`='%d',`Warns`='%d',`Zakon`='%d',`Lechenie`='%d',`Koika`='%d',`Bank`='%d',`Telefon`='%d',`Wanted`='%d',`Bizer`='%d',`Donat`='%d',`Mats`='%d',`Patrons`='%d',`Drugs`='%d',`Doors`='%d',`DostupLock`='%d',`DostupUnLock`='%d',`RegStep`='%d',`AZSOwner`='%d',`BedArm`='%d', `Sum`='%d', `Resh`='%d', `Health`='%f',`LastEnter`='%d' WHERE `nick` = '%s'",
PlayerInfo[playerid][pSex],
PlayerInfo[playerid][pVidAuto],
PlayerInfo[playerid][pJob],
PlayerInfo[playerid][pLicCar],
PlayerInfo[playerid][pProfLic],
PlayerInfo[playerid][pWarn],
PlayerInfo[playerid][pZakon],
PlayerInfo[playerid][pLechenie],
PlayerInfo[playerid][pKoika],
PlayerInfo[playerid][pBank],
PlayerInfo[playerid][pTelefon],
PlayerInfo[playerid][pZvezd],
PlayerInfo[playerid][pVladelec],
PlayerInfo[playerid][pDonat],
PlayerInfo[playerid][pMats],
PlayerInfo[playerid][pPatron],
PlayerInfo[playerid][pDrugs],
PlayerInfo[playerid][pAvtomV],
PlayerInfo[playerid][pDostupLock],
PlayerInfo[playerid][pDostupUnLock],
PlayerInfo[playerid][pRegStep],
PlayerInfo[playerid][pAZSOwner],
PlayerInfo[playerid][pBedArm],
PlayerInfo[playerid][pSum],
PlayerInfo[playerid][pResh],
PlayerInfo[playerid][pHealth],
gettime(),
PlayerInfo[playerid][pNick]);
mysql_tquery(1, querysave, "", "");
if(GetPVarInt(playerid, "Kicker") == 0) { SavePlayerWeapon(playerid); }
if(GetPVarInt(playerid, "Kicker") == 1) { ClearWeaponList(playerid); }
return true;
}
