RSSy MYGO.pl Opublikowano Lipiec 24, 2023 o 20:30 RSSy Udostępnij Opublikowano Lipiec 24, 2023 o 20:30 Good day :), I would like you to help me. I have this plugin which allows you to save the score and the money in case the player disconnects from the game and when he re-enters, he can obtain the same amount of money when he left the server and the score too. I have no problem with that but I have realized that for example if I have bought a rifle and I keep $3800, for example, having my weapon with vest and ammunition when the player hangs up or disconnects, he re-enters as I mentioned before with $3800 and his score, but loses the rifle, vest and ammunition. Is there a way to edit the .sma in which you reconnect with everything you had before disconnecting, your rifle or weapon that you have had, if you have bought a vest or ammunition ???? . Sorry for the translation, thank you very much. example PHP Code: https://youtu.be/9-xvlGGkVIw PHP Code: #include <amxmodx>#include <reapi>enum _:DATA { Float:KILLS, DEATH, MONEY };new g_szTempData[MAX_CLIENTS + 1][DATA];new g_szAuthID[MAX_CLIENTS + 1][32];new Trie:g_tPlayerScore;new HookChain:hRestartRoundPre;public plugin_end() { TrieDestroy(g_tPlayerScore);}public plugin_init() { register_plugin("Save score & money", "1.3.7", "Minni Mouse"); RegisterHookChain(RG_RoundEnd, "refwd_RoundEnd_Post", .post = true); DisableHookChain((hRestartRoundPre = RegisterHookChain(RG_CSGameRules_RestartRound, "refwd_RestartRound_Pre", .post = false)) ); g_tPlayerScore = TrieCreate();}public client_disconnected(pPlayer) { if(is_user_hltv(pPlayer) || is_user_bot(pPlayer)) { return; } if(g_szAuthID[pPlayer][0]) { g_szTempData[pPlayer][KILLS] = Float:get_entvar(pPlayer, var_frags); g_szTempData[pPlayer][DEATH] = get_member(pPlayer, m_iDeaths); g_szTempData[pPlayer][MONEY] = get_member(pPlayer, m_iAccount); TrieSetArray(g_tPlayerScore, g_szAuthID[pPlayer], g_szTempData[pPlayer], DATA); }}public client_putinserver(pPlayer) { if(is_user_hltv(pPlayer) || is_user_bot(pPlayer)) { return; } get_user_authid(pPlayer, g_szAuthID[pPlayer], charsmax(g_szAuthID[])); if(TrieGetArray(g_tPlayerScore, g_szAuthID[pPlayer], g_szTempData[pPlayer], DATA)) { set_entvar(pPlayer, var_frags, g_szTempData[pPlayer][KILLS]); set_member(pPlayer, m_iDeaths, g_szTempData[pPlayer][DEATH]); rg_add_account(pPlayer, g_szTempData[pPlayer][MONEY], AS_SET, false); } else { arrayset(_:g_szTempData[pPlayer], _:0.0, sizeof(g_szTempData[])); }}public refwd_RestartRound_Pre() { DisableHookChain(hRestartRoundPre); TrieClear(g_tPlayerScore);}public refwd_RoundEnd_Post(WinStatus:status, ScenarioEventEndRound:event, Float:tmDelay) { if(event == ROUND_GAME_COMMENCE || event == ROUND_GAME_RESTART) { EnableHookChain(hRestartRoundPre); }} Przeczytaj cały wpis Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
Rekomendowane odpowiedzi