Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement AutoLogin feature through userinfo. #57

Merged
merged 2 commits into from
Oct 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 22 additions & 5 deletions addons/amxmodx/scripting/csgo_remake.sma
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ enum (+=1404)
TASK_MAP_END,
TASK_FADE_BLACK,
TASK_OBS_IN_EYE,
TASK_PREVIEW
TASK_PREVIEW,
TASK_CHECK_AFTERLOAD
}

enum _:EnumChat
Expand Down Expand Up @@ -1228,7 +1229,27 @@ ResetData(id, bool:bWithoutPassword = false)

public CheckUserInfo(id)
{
if(!IsRegistered(id))
return

get_user_info(id, g_iCvars[szUserInfoField], g_szUserPassword[id], charsmax(g_szUserPassword[]))

_Load(id)

set_task(1.0, "TaskDelayLoadCheck", id + TASK_CHECK_AFTERLOAD)
}

public TaskDelayLoadCheck(iTaskID)
{
new iPlayer = iTaskID - TASK_CHECK_AFTERLOAD

if (equal(g_szUserPassword[iPlayer], g_szUser_SavedPass[iPlayer], strlen(g_szUser_SavedPass[iPlayer])))
{
g_bLogged[iPlayer] = true
_LoadSkins(iPlayer)
CC_SendMessage(iPlayer, "^1%L", LANG_SERVER, "CSGOR_LOGIN_SUCCESS")
ExecuteForward(g_iForwards[ user_log_in ], g_iForwardResult, iPlayer)
}
}

public task_Info(id)
Expand Down Expand Up @@ -2321,10 +2342,6 @@ public reg_menu_handler(id, menu, item)
}
case 3:
{
_Load(id)

_LoadSkins(id)

new spLen = strlen(g_szUserPassword[id])

if (strlen(g_szUserPassword[id]) <= 0)
Expand Down
Loading