Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

RSSSAVE MONEY + SCORE + weapons and items purchased before disconnect


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
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:KILLSDEATHMONEY };

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(pPlayervar_frags);
        
g_szTempData[pPlayer][DEATH] = get_member(pPlayerm_iDeaths);
        
g_szTempData[pPlayer][MONEY] = get_member(pPlayerm_iAccount);

        
TrieSetArray(g_tPlayerScoreg_szAuthID[pPlayer], g_szTempData[pPlayer], DATA);
    }
}

public 
client_putinserver(pPlayer) {
    if(
is_user_hltv(pPlayer) || is_user_bot(pPlayer)) {
        return;
    }

    
get_user_authid(pPlayerg_szAuthID[pPlayer], charsmax(g_szAuthID[]));

    if(
TrieGetArray(g_tPlayerScoreg_szAuthID[pPlayer], g_szTempData[pPlayer], DATA)) {
        
set_entvar(pPlayervar_fragsg_szTempData[pPlayer][KILLS]);
        
set_member(pPlayerm_iDeathsg_szTempData[pPlayer][DEATH]);
        
rg_add_account(pPlayerg_szTempData[pPlayer][MONEY], AS_SETfalse);
    }
    else {
        
arrayset(_:g_szTempData[pPlayer], _:0.0sizeof(g_szTempData[]));
    }
}

public 
refwd_RestartRound_Pre() {
    
DisableHookChain(hRestartRoundPre);

    
TrieClear(g_tPlayerScore);
}

public 
refwd_RoundEnd_Post(WinStatus:statusScenarioEventEndRound:eventFloat: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

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
 Udostępnij

  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...