Raised This Month: $ Target: $400
 0% 

Adaptar guardado de frags


  
 
 
Thread Tools Display Modes
xGreat
Senior Member
Join Date: Jul 2012
Location: Chilean
Old 01-07-2013 , 12:20   Re: Adaptar guardado de frags
#11

Ayúdenme a adaptar ese guardado al niveles porfa
__________________
Mi 255
WwW.HnsBJz.Tk = MI FORO

xGreat is offline
Send a message via MSN to xGreat
Geoslide
Senior Member
Join Date: Jun 2011
Location: Chilean player
Old 01-07-2013 , 14:43   Re: Adaptar guardado de frags
#12

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

#define siguiente(%1)    (%1 * 15) 

new g_level[33], g_frags[33], g_conectado[33

new 
g_Vaultg_VaultKey[33][35]

public 
plugin_init()    
{   
    
register_plugin("NIVELES""1.""cLAANS"
    
    
RegisterHamHam_Killed"player""Ham_PlayerKilled"
    
    
set_task(2.0,"hudpersonal",0,_,_,"b"
}   

public 
plugin_cfg() {
    
    
g_Vault nvault_open("VaultFrags")
    
    if(
g_Vault == INVALID_HANDLE)
        
set_fail_state("[R]ak Acme Inc.- Error al abrir el vault")
    
}

public 
client_putinserver(id
{   
    
g_level[id] = 
    g_frags
[id] = 
    g_conectado
[id] = 
    
    set_task
(2.0,"hudpersonal",0,_,_,"b"
    
    
get_user_authid(idg_VaultKey[id], charsmax(g_VaultKey[]))
    
    
LoadData(id)
}   

public 
client_disconnect(id
{   
    
g_conectado[id] = 
    SaveData
(id)
}   

public 
Ham_PlayerKilledvictimattacker 
{   
    if(!
g_conectado[victim] || !g_conectado[attacker] || victim == attacker || get_user_team(victim) == get_user_team(attacker)) 
        return  
    
    
g_frags[attacker] += 1  
    checklevel
(attacker
}   

public 
checklevelid )  
{      
    while( 
g_frags[id] >= siguiente(g_level[id]) )  
    {   
        
g_levelid ]++ 
        
g_fragsid ] = 
    
}   
}   

public 
hudpersonal() { 
    
    new 
players[32],num,
    get_players
(players,num
    for(
0<= numi++) 
    {   
        new 
id players[i
        
        if(
is_user_connected(id)) { 
            new 
name[33
            
get_user_name(id,name,32)  
            
            if ( 
is_user_alive id ) ) 
            { 
                
set_hudmessage(852552120.800.1206.012.0)   
                
show_hudmessage(id" [ Nombre: %s ]^n [ Frags : %d / %d]^n [ Level : %d ]"nameg_frags[id], siguiente(g_level[id]), g_level[id] )   
                
            }    
        }   
    }   
    return 
PLUGIN_CONTINUE    


LoadData(idg_frags[id] = nvault_get(g_Vault g_VaultKey[id])

SaveData(id) {
    
    static 
VaultData[20]
    
    
num_to_str(g_frags[id], VaultDatacharsmax(VaultData))
    
    
nvault_set(g_Vaultg_VaultKey[id], VaultData)
    

__________________
Basebuilder V6 - plugin for sale
Jailbreak V6 - plugin for sale
more plugins in progress ...

Geoslide ?
Geoslide is offline
xGreat
Senior Member
Join Date: Jul 2012
Location: Chilean
Old 01-07-2013 , 14:51   Re: Adaptar guardado de frags
#13

Lo probé y me tiro error al iniciar el server , ayuda pls

Me dice "Server Steam ha detectado un problema y debe cerrarse.

Enviar informes de error
No enviar

eso sale

Saludos xGreat
__________________
Mi 255
WwW.HnsBJz.Tk = MI FORO


Last edited by xGreat; 01-07-2013 at 14:52.
xGreat is offline
Send a message via MSN to xGreat
 



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 06:36.


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