Raised This Month: $ Target: $400
 0% 

Logs


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sPed
Member
Join Date: May 2017
Location: Algeria
Old 10-02-2022 , 13:13   Re: Logs
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <nvault>

#define PLUGIN "Score and Round"
#define VERSION "1.1"
#define AUTHOR "Lorex"

#define SIZEOFDATA 5

enum _:DATA
{
    
T,
    
CT,
    
TotalT,
    
TotalCT
}

new 
g_iData[DATA]
new const 
g_sznVaultName[] = "scoreandround"
new g_nVault

public plugin_init()
{
        
register_plugin(PLUGINVERSIONAUTHOR)
    
        
register_event("TextMsg""OnRoundRestart""a""2&#Game_C""2&#Game_w")
        
register_event("SendAudio""OnTerroristWin""a""2&%!MRAD_terwin")
        
register_event("SendAudio""OnCTWin""a""2&%!MRAD_ctwin" )
        
set_task(1.0"ShowInfo", .flags "b")

        
g_nVault nvault_open(g_sznVaultName)

        
_GetData()
}

public 
plugin_end()
{
        
_SaveData()
        
nvault_close(g_nVault)
}

public 
_GetData()
{
        new 
szData[64], szT[4], szCT[4]

    
replace_all(szDatacharsmax(szData), "#"" ")    
    
parse(szDataszTcharsmax(szT), szCTcharsmax(szCT))
    
g_iData[TotalT] = str_to_num(szT)
    
g_iData[TotalCT] = str_to_num(szCT)
}


public 
_SaveData()
{
        new 
szData[64]

        
formatex(szDatacharsmax(szData), "%i#%i"g_iData[TotalT], g_iData[TotalCT])
}

public 
OnRoundRestart()
{
        
g_iData[T] = 0
        g_iData
[CT] = 0
}

public 
OnTerroristWin()
{
        
g_iData[T] += 1
        g_iData
[TotalT] += 1
}

public 
OnCTWin()
{
        
g_iData[CT] += 1
        g_iData
[TotalCT] += 1


Last edited by sPed; 10-02-2022 at 13:21.
sPed is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:49.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode