Raised This Month: $105 Target: $400
 26% 

adv_vault to Fvault


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
yRestrict
Member
Join Date: Apr 2019
Old 12-23-2019 , 16:38   adv_vault to Fvault
Reply With Quote #1

Can anyone convert this plugin from adv_vault to fvault

PHP Code:
#include <amxmodx>
#include <jctf>
#include <adv_vault>

#define PLUGIN "Rank - pega bandeiar"
#define VERSION "1.0"
#define AUTHOR "Zetsukt"

new g_flagcaptured33 ]
new 
g_flagreturned33 ]

new 
g_vault
new g_sort
new g_playername33 ][ 32 ]
new 
motd1536 ]
new 
g_maxplayers

new const g_sPrefix[] = "!t[!Fraternity!t]"

enum {
    
FLAGSCAPTURED,
    
FLAGSRETURNED,
    
MAX_FIELDS
}

new 
g_campos[MAX_FIELDS]

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
g_vault adv_vault_open("CaptureTheFlags"false)
    
g_campos[FLAGSCAPTURED]     = adv_vault_register_field(g_vault"FlagsCaptured")
    
g_campos[FLAGSRETURNED]     = adv_vault_register_field(g_vault"FlagsReturned")
    
adv_vault_init(g_vault)
    
    
g_sort adv_vault_sort_createg_vaultORDER_DESC02000g_camposFLAGSCAPTURED ], g_camposFLAGSRETURNED ] )
    
    
register_event("HLTV""round_start""a""1=0""2=0")
    
    
register_clcmd("say /pbrank""ranking")
    
register_clcmd("say /pbtop""top10_flags")
    
    
g_maxplayers get_maxplayers()
}

public 
client_putinserverid )
{
    
get_user_name(idg_playername[id], 31 );
    
    
g_flagcapturedid ] = 0
    g_flagreturned
id ] = 0
    
    set_task
15.0"publicidad"id)
    
    
LoadDataid )
}
    
public 
client_disconnectid )
{
    
SaveDataid )
}

public 
publicidadid )
{
    
chat_colorid"%s !nEscreva !g/pbrank !npara ver seu rank de !tBandeiras Capturadas!n."g_sPrefix )
    
chat_colorid"%s !nEscreva !g/pbtop !npara ver o TOP10 de !tBandeiras Capturadas!n."g_sPrefix )
}
    
public 
jctf_flag(iEventidiFlagTeambool:bAssist)
{
    switch(
iEvent)
    {
        case 
FLAG_RETURNED:
        {
            if(!
bAssist)
            {
                
g_flagreturnedid ]++
            }
        }
        case 
FLAG_CAPTURED:
        {
            if(!
bAssist)
            {
                
g_flagcapturedid ]++
            }
        }
    }
}

public 
top10_flagsid )
{
    new 
flagscflagsr,  keyindexpj32 ]
    
    static 
len
    
    len 
0

    
new toploop minadv_vault_sort_numresultg_vaultg_sort ), 10 )
    
    
len += formatex(motd[len], sizeof motd-len,
    
"<body bgcolor=#A4BED6>\
    <table width=100%% cellpadding=2 cellspacing=0 border=0>\
    <tr align=center bgcolor=#52697B>\
    <th width=20%%>Posicao\
    <th width=20%% align=left>Nome\
    <th width=20%%>Bandeiras Capturadas\
    <th width=20%%>Bandeiras Recuperadas"
);
    
    for( new 
position=1position <= toploopposition++ )
    {
        
keyindex adv_vault_sort_positiong_vaultg_sortposition )
        
        if( !
adv_vault_get_prepareg_vaultkeyindex ) ) continue
        
        
flagsc adv_vault_get_fieldg_vaultg_camposFLAGSCAPTURED ] )
        
flagsr adv_vault_get_fieldg_vaultg_camposFLAGSRETURNED ] )
        
        
adv_vault_get_keynameg_vaultkeyindexpj31 )

        
len += formatex(motd[len], sizeof motd-len"<tr align=center>");
        
len += formatex(motd[len], sizeof motd-len"<td>%d"position);
        
len += formatex(motd[len], sizeof motd-len"<td align=left>%s"pj);
        
len += formatex(motd[len], sizeof motd-len"<td>%d"flagsc);
        
len += formatex(motd[len], sizeof motd-len"<td>%d"flagsr);
    }
    
    
len += formatex(motd[len], sizeof motd-len"</table></body>");
    
    
show_motdidmotd"Rank Pega Bandeira");


public 
rankingid )
{
    new 
rank adv_vault_sort_key(g_vaultg_sort0g_playernameid ] )
    
    if( !
rank 
    {
        
        
chat_color(id"%s !nVoce nao tem rank :/"g_sPrefix)
    }
    else 
chat_color(id"%s !nSeu rank e !t%d !ncom !g%d !nbandeiras capturadas e !g%d !nrecuperadas"g_sPrefixrankg_flagcapturedid ], g_flagreturnedid ])
}

public 
round_start()
{
    for(new 
id=1id <= g_maxplayersid++)
    {
        if( 
is_user_connectedid ) )
        
SaveDataid )
    }
    
    
adv_vault_sort_update(g_vaultg_sort)
}

public 
client_infochangedid )
{
    if( !
is_user_connectedid ) ) return
    
    static 
newname32 ]
    
    
get_user_infoid"name"newnamecharsmaxnewname ) )    
    
    if( !
equal(newnameg_playernameid ] ) )
    {
        
set_task0.1"LoadData"id )
    }
}
public 
SaveDataid )
{
    if(!
is_user_connectedid ) ) return;
    
    
adv_vault_set_startg_vault )
    
adv_vault_set_fieldg_vaultg_camposFLAGSCAPTURED ], g_flagcapturedid ] )
    
adv_vault_set_fieldg_vaultg_camposFLAGSRETURNED ], g_flagreturnedid ] )
    
adv_vault_set_endg_vault0g_playernameid ] )
}
public 
LoadDataid )
{
    
    if(!
adv_vault_get_prepare(g_vault_g_playernameid ] ) )        
             return;
    
    
g_flagcapturedid ] = adv_vault_get_fieldg_vaultg_camposFLAGSCAPTURED ] )
    
g_flagreturnedid ] = adv_vault_get_fieldg_vaultg_camposFLAGSRETURNED ] )


stock chat_color( const id, const input[], any:... )
{
    new 
count 1players32 ]
    
    static 
msg191 ]
    
    
vformatmsg190input)
    
    
replace_allmsg190"!g""^4" )
    
replace_allmsg190"!n""^1" )
    
replace_allmsg190"!t""^3" 
    
replace_allmsg190"!t2""^0" )
    
    if ( 
id players] = id; else get_players(playerscount"ch" )
    {
        for (new 
0counti++)
        {
            if ( 
is_user_connectedplayers] ) )
            {
                
message_beginMSG_ONE_UNRELIABLEget_user_msgid"SayText" ), _players] )
                
write_byteplayers] )
                
write_stringmsg )
                
message_end()
            }
        }
    }

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang3082\\ f0\\ fs16 \n\\ par }
*/ 
yRestrict is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-23-2019 , 17:45   Re: adv_vault to Fvault
Reply With Quote #2

Why?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
yRestrict
Member
Join Date: Apr 2019
Old 12-23-2019 , 18:29   Re: adv_vault to Fvault
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
Why?


A friend told me that rescue and fvault is better than adv
yRestrict 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 21:55.


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