- Регистрация
- 20 Окт 2020
- Сообщения
- 96
- Лучшие ответы
- 0
- Репутация
- 3
Здравствуйте, помогите пожалуйста, у меня при регистрации/авторизации не спавнит меня.
Мне дали ответ в этой теме *клик*, но он не помог. Ребят подскажите что может быть ?
MYSQL R41-4: Работает все правильно.
MYSQL LOG:
MYSQL SCREENSHOT:
Просьба помочь: @Pa4enka , @faraday.
Мне дали ответ в этой теме *клик*, но он не помог. Ребят подскажите что может быть ?
MYSQL R41-4: Работает все правильно.
MYSQL LOG:
C#:
[18:22:41] [INFO] received Windows console close event; shutting log-core down
[18:28:26] [INFO] received Windows console close event; shutting log-core down
[19:38:35] [INFO] received Windows console close event; shutting log-core down
[19:39:52] [INFO] received Windows console close event; shutting log-core down
[20:33:10] [INFO] received Windows console close event; shutting log-core down
[20:34:54] [INFO] received Windows console close event; shutting log-core down
[20:41:26] [INFO] received Windows console close event; shutting log-core down
[20:56:53] [INFO] received Windows console close event; shutting log-core down
[20:57:13] [INFO] received Windows console close event; shutting log-core down
[20:58:45] [INFO] received Windows console close event; shutting log-core down
[20:58:56] [INFO] received Windows console close event; shutting log-core down
[21:00:46] [INFO] received Windows console close event; shutting log-core down
[21:01:35] [INFO] received Windows console close event; shutting log-core down
[21:04:05] [INFO] received Windows console close event; shutting log-core down
[21:04:59] [INFO] received Windows console close event; shutting log-core down
[21:05:55] [INFO] received Windows console close event; shutting log-core down
[21:14:03] [INFO] received Windows console close event; shutting log-core down
[21:24:33] [INFO] received Windows console close event; shutting log-core down
[21:28:10] [INFO] received Windows console close event; shutting log-core down
[22:00:02] [INFO] received Windows console close event; shutting log-core down
[22:01:34] [INFO] received Windows console close event; shutting log-core down
[22:11:22] [INFO] received Windows console close event; shutting log-core down
[22:56:20] [INFO] received Windows console close event; shutting log-core down
[22:57:11] [INFO] received Windows console close event; shutting log-core down
[22:57:28] [INFO] received Windows console close event; shutting log-core down
[23:01:11] [INFO] received Windows console close event; shutting log-core down
[23:05:31] [INFO] received Windows console close event; shutting log-core down
[23:06:59] [INFO] received Windows console close event; shutting log-core down
[23:08:17] [INFO] received Windows console close event; shutting log-core down
[23:30:12] [INFO] received Windows console close event; shutting log-core down
[23:34:40] [INFO] received Windows console close event; shutting log-core down
[00:02:46] [INFO] received Windows console close event; shutting log-core down
[00:29:23] [INFO] received Windows console close event; shutting log-core down
[00:30:29] [INFO] received Windows console close event; shutting log-core down
[00:34:46] [INFO] received Windows console close event; shutting log-core down
[00:43:03] [INFO] received Windows console close event; shutting log-core down
[00:43:30] [INFO] received Windows console close event; shutting log-core down
[00:45:05] [INFO] received Windows console close event; shutting log-core down
[00:45:47] [INFO] received Windows console close event; shutting log-core down
[00:46:29] [INFO] received Windows console close event; shutting log-core down
[00:51:49] [INFO] received Windows console close event; shutting log-core down
[00:52:15] [INFO] received Windows console close event; shutting log-core down
[00:54:04] [INFO] received Windows console close event; shutting log-core down
[00:56:45] [INFO] received Windows console close event; shutting log-core down
[00:57:35] [INFO] received Windows console close event; shutting log-core down
[10:39:54] [INFO] received Windows console close event; shutting log-core down
[10:41:06] [INFO] received Windows console close event; shutting log-core down
[10:41:53] [INFO] received Windows console close event; shutting log-core down
[10:43:12] [INFO] received Windows console close event; shutting log-core down
[17:23:01] [INFO] received Windows console close event; shutting log-core down
[17:24:09] [INFO] received Windows console close event; shutting log-core down
[17:24:44] [INFO] received Windows console close event; shutting log-core down
Чтобы видеть скрытое содержание Зарегистрируйтесь на форуме!
Просьба помочь: @Pa4enka , @faraday.
C++:
//-INCLUDES-//
#include <a_samp>
#include <a_mysql> // plugin mysql
#include <sscanf2> // plugin sscanf
//---------//
//-MYSQL SETTING's-//
#define MYSQL_HOST "localhost" // Õîñòèíã
#define MYSQL_USER "root" // Ïîëüçîâàòåëü
#define MYSQL_PASS "" // Ïàðîëü
#define MYSQL_DB "diamond" // Áàçà äàííûõ
new MySQL: dbHandle;
new query[256];
//-----------------//
//-ÌÀÊÐÎÑÛ-//
// Îñòàëüíîå
#define SERVER_NAME "Delaware Role Play | Test"
// Ñîîáùåíèÿ
#define SCM SendClientMessage
#define SCMTA SendClientMessageToAll
#define SPD ShowPlayerDialog
// Ñòèëè äèàëîãîâ
#define DSM DIALOG_STYLE_MSGBOX
#define DSL DIALOG_STYLE_LIST
#define DSP DIALOG_STYLE_PASSWORD
#define DSI DIALOG_STYLE_INPUT
#define DSTIL DIALOG_STYLE_TABLIST
#define DSTH DIALOG_STYLE_TABLIST_HEADERS
//---------//
//-ÖÂÅÒÀ-//
#define COLOR_WHITE 0xFFFFFFFF
#define COLOR_VALIK 0x73B461FF
#define COLOR_SHBAR_BG 0x000000FF
#define COLOR_SHBAR_BG2 0xB8CEF6FF
#define COLOR_ORANGE 0xFAAC58FF
#define COLOR_GREEN 0x42B02CFF
#define COLOR_GOLD 0xFFD700FF
#define COLOR_RED 0xBE2D2DFF
#define COLOR_LIGHTRED 0xFF6347FF
#define COLOR_LIGHTBLUE 0x6495EDFF
#define COLOR_LIGHTGREEN 0x9ACD32FF
#define COLOR_YELLOW 0xFFFF00FF
#define COLOR_BLUENEW 0xB8CEF6FF
#define COLOR_BLUE 0x94B0C1FF
#define COLOR_PURPLE 0xC2A2DAFF
#define COLOR_LIME 0x10F441FF
#define COLOR_GREY 0xAFAFAFFF
#define COLOR_CHAT 0xCECECEFF
#define COLOR_SCHAT 0xF0E68CFF
#define COLOR_DOCHAT 0x4682B4FF
#define COLOR_RACIO 0x2DB043FF
#define COLOR_DEPAR 0x3399ffFF
#define COLOR_ACHAT 0x99CC00FF
#define COLOR_ME 0xFF99FFFF
#define COLOR_GOV 0x045FB4FF
//-------//
//-ÍÅÍÓÆÍÀß ÕÓÉÍß-//
#define pName(%0) player_info[%0][NAME]
//----------------//
enum player
{
ID,
NAME[MAX_PLAYER_NAME],
PASS[30],
SEX,
COLOR,
}
new player_info[MAX_PLAYERS][player];
enum temp
{
LOGINTRIES,
}
new temp_info[MAX_PLAYERS][temp];
enum
{
DLG_NONE,
DLG_REG_CONFIRM,
DLG_REG_PASS,
DLG_REG_GENDER,
DLG_REG_COLOR,
DLG_REG_AGE,
DLG_REG_FINISH,
DLG_LOGIN,
}
main(){}
public OnGameModeInit()
{
dbHandle = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS, MYSQL_DB);
if(mysql_errno() != 0)
{
print("[MYSQL] Íå óäàëîñü ïîäêëþ÷èòüñÿ ê áàçå äàííûõ");
return SendRconCommand("exit");
}
else
{
print("[MYSQL] Ïîäêëþ÷åíèå ê áàçå äàííûõ óñïåøíî");
}
SetGameModeText("Delaware-rp Russian");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnGameModeExit()
{
mysql_close(dbHandle);
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
return 1;
}
public OnPlayerConnect(playerid)
{
SetTimerEx("CheckAccountFromMysql", 1000, false, "i", playerid);
GetPlayerName(playerid, player_info[playerid][NAME], MAX_PLAYER_NAME);
temp_info[playerid][LOGINTRIES] = 3;
return 1;
}
forward CheckAccountFromMysql(playerid);
public CheckAccountFromMysql(playerid)
{
mysql_format(dbHandle, query, sizeof(query), "SELECT * FROM `accounts` WHERE `name` = '%e'", player_info[playerid][NAME]);
mysql_tquery(dbHandle, query, "GetPlayerAccountFromMysql", "i", playerid);
}
forward GetPlayerAccountFromMysql(playerid);
public GetPlayerAccountFromMysql(playerid)
{
new rows;
cache_get_row_count(rows);
if(rows)
{
// Åñëè åñòü ñîâïàäåíèÿ, ïîêàçûâàåì àâòîðèçàöèþ
cache_get_value_name(0, "password", player_info[playerid][PASS], 31);
new tempstring[403+(-2+MAX_PLAYER_NAME)];
format(tempstring, sizeof(tempstring), "{ffffff}Äîáðî ïîæàëîâàòü íà {E88813}Delaware Role Play{FFFFFF}\n\nÂâåäèòå ñâîé ïàðîëü\nÏîïûòîê äëÿ ââîäà ïàðîëÿ: {28910B}%i", temp_info[playerid][LOGINTRIES]);
SPD(playerid, DLG_LOGIN, DSP, "{E88813}Àâòîðèçàöèÿ", tempstring, "Ïðèíÿòü", "Âûõîä");
}
else
{
// Åñëè íåòó ñîâïàäåíèé, ïîêàçûâàåì ðåãèñòðàöèþ
SPD(playerid, DLG_REG_CONFIRM, DSM, "{E88813}ß íå ðîáîò{FFFFFF}",
"{FFFFFF}×òîáû ïðîéòè ïðîâåðêó íà {E88813}ðîáîòà{FFFFFF}, íàæìèòå 'Äàëåå'\n\nÇíàéòå, ÷òî åñëè âû áóäåòå çàïóñêàòü áîòîâ. Âû áóäåòå çàáåíåíû ïî àéïè.",
"Äàëåå", "Âûõîä");
}
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
SetPlayerPos(playerid, 1255.4739,-1692.7408,19.7344);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return false;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case DLG_REG_CONFIRM:
{
if(response)
{
PlayerPlaySound(playerid, 1185, 0.0, 0.0, 0.0); // BIKE_AWARD_TRACK_START
new tempstring[403+(-2+MAX_PLAYER_NAME)];
format(tempstring, sizeof(tempstring), "{ffffff}Äîáðî ïîæàëîâàòü, {205CA2} %s{ffffff}\nÝòîò àêêàóíò {FF6347}íå çàðåãèñòðèðîâàí{ffffff} íà íàøåì ñåðâåðå.\nÄëÿ ðåãèñòðàöèè ââåäèòå ïàðîëü.\nÎí áóäåò èñïîëüçîâàòüñÿ äëÿ àâòîðèçàöèè íà íàø¸ì ñåðâåðå.", player_info[playerid][NAME]);
SPD(playerid, DLG_REG_PASS, DSI, "{E88813}(1/4) Ïàðîëü", tempstring, "Ïðèíÿòü", "Âûõîä");
}
else
{
Kick(playerid);
}
}
case DLG_REG_PASS:
{
if(response)
{
if(strlen(inputtext) < 6 || strlen(inputtext) > 30)
{
new tempstring[403+(-2+MAX_PLAYER_NAME)];
format(tempstring, sizeof(tempstring), "{ffffff}Äîáðî ïîæàëîâàòü, {205CA2} %s\nÝòîò àêêàóíò {FF6347}íå çàðåãèñòðèðîâàí{ffffff} íà íàøåì ñåðâåðå.\nÄëÿ ðåãèñòðàöèè ââåäèòå ïàðîëü.\nÎí áóäåò èñïîëüçîâàòüñÿ äëÿ àâòîðèçàöèè íà íàø¸ì ñåðâåðå.", player_info[playerid][NAME]);
SPD(playerid, DLG_REG_PASS, DSI, "{E88813}(1/4) Ïàðîëü", tempstring, "Ïðèíÿòü", "Âûõîä");
}
else if(strlen(inputtext) < 6)
{
new tempstring[403+(-2+MAX_PLAYER_NAME)];
format(tempstring, sizeof(tempstring), "{ffffff}Äîáðî ïîæàëîâàòü, íà{205CA2} %s{ffffff}\nÝòîò àêêàóíò {FF6347}íå çàðåãèñòðèðîâàí{ffffff} íà íàøåì ñåðâåðå.\nÄëÿ ðåãèñòðàöèè ââåäèòå ïàðîëü.\nÎí áóäåò èñïîëüçîâàòüñÿ äëÿ àâòîðèçàöèè íà íàø¸ì ñåðâåðå.", player_info[playerid][NAME]);
SPD(playerid, DLG_REG_PASS, DSI, "{E88813}(1/4) Ïàðîëü", tempstring, "Ïðèíÿòü", "Âûõîä");
}
else
{
format(player_info[playerid][PASS], 31, inputtext);
SPD(playerid, DLG_REG_GENDER, DSL, "{E88813}[2/4] Âûáåðèòå âàø ïîë", "Ìóæñêîé\nÆåíñêèé", "Äàëåå", " íà÷àëî");
}
return 1;
}
else
{
Kick(playerid);
}
}
case DLG_REG_GENDER:
{
if(response)
{
if(listitem == 0)
{
player_info[playerid][SEX] = 1;
return SPD(playerid, DLG_REG_COLOR, DSL, "{E88813}[3/4] Âûáåðèòå öâåò êîæè", "Ñâåòëûé\nÒ¸ìíûé", "Äàëåå", " íà÷àëî");
}
if(listitem == 1)
{
player_info[playerid][SEX] = 2;
return SPD(playerid, DLG_REG_COLOR, DSL, "{E88813}[3/4] Âûáåðèòå öâåò êîæè", "Ñâåòëûé\nÒ¸ìíûé", "Äàëåå", " íà÷àëî");
}
}
else
{
player_info[playerid][PASS][0] = EOS;
player_info[playerid][SEX] = 0;
player_info[playerid][COLOR] = 0;
}
}
case DLG_REG_COLOR:
{
if(response)
{
if(listitem == 0)
{
player_info[playerid][COLOR] = 1;
RegFinish(playerid);
return 1;
}
if(listitem == 1)
{
player_info[playerid][COLOR] = 2;
RegFinish(playerid);
return 1;
}
}
else
{
player_info[playerid][PASS][0] = EOS;
player_info[playerid][SEX] = 0;
player_info[playerid][COLOR] = 0;
}
}
case DLG_LOGIN:
{
if(response)
{
if(strcmp(player_info[playerid][PASS], inputtext) != 0)
{
temp_info[playerid][LOGINTRIES] --;
if(temp_info[playerid][LOGINTRIES] <= 0) return Kick(playerid);
cache_get_value_name(0, "password", player_info[playerid][PASS], 31);
new tempstring[403+(-2+MAX_PLAYER_NAME)];
format(tempstring, sizeof(tempstring), "{ffffff}Äîáðî ïîæàëîâàòü íà {E88813}Delaware Role Play{FFFFFF}\n\nÂâåäèòå ñâîé ïàðîëü\nÏîïûòîê äëÿ ââîäà ïàðîëÿ: {28910B}%i", temp_info[playerid][LOGINTRIES]);
SPD(playerid, DLG_LOGIN, DSP, "{E88813}Àâòîðèçàöèÿ", tempstring, "Ïðèíÿòü", "Âûõîä");
}
return 1;
}
else
{
Kick(playerid);
}
}
}
return 1;
}
forward RegFinish(playerid);
public RegFinish(playerid)
{
mysql_format(dbHandle, query, sizeof(query),
"INSERT INTO `accounts` (`name`, `password`, `sex`, `color`) VALUES ('%e', '%e', '%d', '%d')",
player_info[playerid][NAME], player_info[playerid][PASS], player_info[playerid][SEX], player_info[playerid][COLOR]);
mysql_tquery(dbHandle, query);
SCM(playerid, COLOR_VALIK, "[Ïîäñêàçêà] {FFFFFF}Ñïàñèáî âàì çà ðåãèñòðàöèþ íà íàøåì ñåðâåðå");
SpawnPlayer(playerid);
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}