21.05.2017, 18:23
Users aren't being registered on mysql
Код:
if (dialogid == REGISTER) { if (!response) return Kick(playerid); if (response) { if (!strlen(inputtext)) { ShowPlayerDialog(playerid, REGISTER, DIALOG_STYLE_PASSWORD, ""RED">> "PREMIUM"Account Register", ""WHITE"Welcome to "RED"Unleashed Stunt Freeroam"WHITE"!\n"WHITE"This account is "RED"not "WHITE"registered.\n\n"YELLOW"» Please enter a password below to register.", "Register", "Quit"); return 1; } new hashpass[129], date[20], year, month, day, str[200]; switch(random(11)) { case 0: SetPlayerColor(playerid, COLOR_PURPLE), PlayerInfo[playerid][Color] = 1; case 1: SetPlayerColor(playerid, COLOR_PINK), PlayerInfo[playerid][Color] = 2; case 2: SetPlayerColor(playerid, COLOR_LIGHTBLUE), PlayerInfo[playerid][Color] = 3; case 3: SetPlayerColor(playerid, COLOR_LIGHTGREEN), PlayerInfo[playerid][Color] = 4; case 4: SetPlayerColor(playerid, COLOR_GREY), PlayerInfo[playerid][Color] = 5; case 5: SetPlayerColor(playerid, COLOR_WHITE), PlayerInfo[playerid][Color] = 6; case 6: SetPlayerColor(playerid, COLOR_ORANGE), PlayerInfo[playerid][Color] = 7; case 7: SetPlayerColor(playerid, COLOR_YELLOW), PlayerInfo[playerid][Color] = 8; case 8: SetPlayerColor(playerid, COLOR_RED), PlayerInfo[playerid][Color] = 9; case 9, 10, 11: SetPlayerColor(playerid, COLOR_GREEN), PlayerInfo[playerid][Color] = 10; } WP_Hash(hashpass, sizeof(hashpass), inputtext); getdate(year, month, day); format(PlayerInfo[playerid][AltName], 26, "None"); format(date, sizeof(date), "%d/%d/%d", day, month, year); PlayerInfo[playerid][WeaponSet] = 0; PlayerInfo[playerid][CustomSlot1] = 0, PlayerInfo[playerid][CustomSlot2] = 0, PlayerInfo[playerid][CustomSlot3] = 0, PlayerInfo[playerid][CustomSlot4] = 0, PlayerInfo[playerid][CustomSlot5] = 0, PlayerInfo[playerid][CustomSlot6] = 0, PlayerInfo[playerid][CustomSlot7] = 0; GivePlayerMoney(playerid, 5000); PlayerInfo[playerid][Hours] = 0; PlayerInfo[playerid][Minutes] = 0; PlayerInfo[playerid][POS_X] = -2355.9038; PlayerInfo[playerid][POS_Y] = -1635.4912; PlayerInfo[playerid][POS_Z] = 483.7031; PlayerInfo[playerid][Helmet] = 1; PlayerInfo[playerid][RegOn] = date; new Query[700]; strcat(Query, "INSERT INTO `"Users_Table"` (Username, Password, IP, Score, Cash, Admin, VIP, AltName, LastActive, RegisteredOn, Kills, Deaths, Hours, Minutes, Helmet, SpawnPosX, SpawnPosY, SpawnPosZ, CustomSlot1, CustomSlot2, CustomSlot3, CustomSlot4, CustomSlot5, CustomSlot6, CustomSlot7, WeaponSet, Skin, Bounce, SpeedBoost, LMSWins, ReactionsWon, MBsFound) VALUES"); strcat(Query, "('%s', '%s', '%s', '0', '0', '0', '0', '%s', '%s', '%s', '0', '0', '0', '0', '0', '%f', '%f', '%f', '0', '0', '0', '0', '0', '0', '0', '0', '%i', '1', '1.5', '0', '0', '0')"); format(gQuery, 750, Query, GetName(playerid), hashpass, GetIP(playerid), PlayerInfo[playerid][AltName], lastactive[playerid], PlayerInfo[playerid][RegOn], PlayerInfo[playerid][POS_X], PlayerInfo[playerid][POS_Y], PlayerInfo[playerid][POS_Z], GetPlayerSkin(playerid)); mysql_tquery(MySQL, gQuery, "", ""); SendClientMessage(playerid, COLOR_PINK, ""PREMIUM"*** "LIGHTBLUE"Thank you for registering your account!"); SpawnPlayer(playerid); new istr[256]; format(istr, sizeof istr, "4[SFS] 13%s(%i) 12has registered, making the server have total 10%i 12players registered.", GetName(playerid), playerid, gTotalRegisters+1); IRC_GroupSay(gGroupID, IRC_Channel, istr); format(str, sizeof(str), ""RED"[SFS] {%06x}%s(%d) {2BD9F8}has registered, making the server have total {008FFB}%d {2BD9F8}players registered.", (GetPlayerColor(playerid) >>> 8), GetName(playerid), playerid, gTotalRegisters+1); // SetPlayerColor(playerid, random_color); SendClientMessageToAll(0x2BD9F8FF, str); IncreaseTotalRegisters(); PlayerInfo[playerid][Spawned] = 1; PlayerInfo[playerid][LoggedIn] = 1; TD_MSG(playerid, 3000, "~b~~h~You have successfully registered!~w~~b~~h~~n~~b~~h~$5000 bonus for registering!"); new regInfo[300]; format(regInfo, sizeof(regInfo), ""YELLOW"Hello!\n\n"GREEN"» Your nick: "YELLOW"%s\n"GREEN"\n"GREEN"» Your password: "YELLOW"%s\n\n"LIGHTGREEN"Never share your password with anyone!\nYou'll need it for logging next time.", GetName(playerid), inputtext); ShowPlayerDialog(playerid, DIALOG_CONFIRM_REGISTER, DIALOG_STYLE_MSGBOX, ""RED"Register Info", regInfo, "OK", ""); return 1; } }