Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public QueryHandle(FailState, Handle:Query, Error[], Errcode, Data[], DataSize, Float:time)
- {
- static id; id = Data[0]
- // Connected?
- if (!is_user_connected(id)) return PLUGIN_HANDLED;
- switch (FailState)
- {
- case TQUERY_CONNECT_FAILED: log_to_file("SQL_LOG_TQ.txt", "Failed to connect to database [%i]: %s", Errcode, Error)
- case TQUERY_QUERY_FAILED: log_to_file("SQL_LOG_TQ.txt", "Error in MySQL query [%i]: %s", Errcode, Error)
- }
- switch (Data[1])
- {
- case REG_CHARACTER:
- {
- static loading; loading++
- switch (loading)
- {
- case 8:
- {
- loading = 0
- g_createdaccounts++
- g_createdcharacters++
- save_account_count()
- Load(id, 0)
- client_print(id, print_center, "[ZA] Personaje creado con éxito")
- }
- }
- }
- case LOAD_BASIC_DATA:
- {
- if (SQL_NumResults(Query))
- {
- static szUserInfo[32]
- SQL_ReadResult(Query, 0, user_password[id], charsmax(user_password[]))
- get_user_info(id, "_pw", szUserInfo, charsmax(szUserInfo))
- // Check all players ID's
- for (new i = 1; i <= g_maxplayers; i++)
- {
- // Same user ID
- if (equal(g_playername[i], g_playername[id]) && g_status[i] >= ONLINE && i != id)
- {
- server_cmd("kick #%d ^"Esta cuenta esta conectada.^"", get_user_userid(id));
- break;
- }
- if (equal(g[i], g_playername[id]) && g_status[i] >= ONLINE && i != id)
- {
- server_cmd("kick #%d ^"El nombre se encuentra en uso^"", get_user_userid(id));
- break;
- }
- }
- if(!(equal(szUserInfo, user_password[id])) && strlen(user_password[id]) > 1) {
- switch(get_pcvar_num(cvar_account_typecheck)) {
- case 0: server_cmd("kick #%d ^"Account Password Protected^nUse SETINFO _PW YOURPW^"", get_user_userid(id))
- case 1: {
- /*client_cmd(id, "messagemode ^"you_password^"")
- set_hudmessage(0, 255, 255, 0.03, 0.05, 0, 0.1, 4.0, 0.01, 0.01, -1)
- ShowSyncHudMsg(id, g_MsgSync5, "Ingresa Contraseña de Cuenta^nPulse ESC para salir")*/
- show_first_enter_menu(id)
- }
- }
- return PLUGIN_HANDLED
- }
- else {
- if(equal(szUserInfo, user_password[id]) && strlen(user_password[id]) > 1) {
- Load(id, 0)
- }
- else {
- if(strlen(user_password[id]) < 1) {
- show_first_enter_menu(id)
- }
- }
- }
- }
- else
- {
- g_TypeLogging[id] = 1
- g_status[id] = OFFLINE
- show_first_enter_menu(id)
- }
- }
- case LOAD_FULL_DATA:
- {
- if (SQL_NumResults(Query))
- {
- Load(id, 0)
- }
- else {
- g_TypeLogging[id] = 0
- g_status[id] = OFFLINE
- show_first_enter_menu(id)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement