Raised This Month: $ Target: $400
 0% 

[ES] ¿Esto esta bien codeado?


  
 
 
Thread Tools Display Modes
Author Message
lRodri.
Member
Join Date: Apr 2012
Location: Argentina
Old 08-02-2012 , 19:57   [ES] ¿Esto esta bien codeado?
#1

Bueno, estoy mejorando mi plugin de Grenade_Game, agregándole un XP Mode y un guardado de cuentas, quería saber si esta bien hasta ahi, por que le modifique un par de cosas.

PD: Use los tutoriales de Kiske y de Zapdos1

PHP Code:
#include <amxmodx> 
#include <amxmisc> 
#include <cstrike> 
#include <fakemeta> 
#include <fun> 
#include <hamsandwich> 
#include <fvault>

new SZ_Password192 ]
new 
SZ_Password_T33 ][ 192 ]

new 
Registrado33 ]
new 
BadPassword33 ]

new const 
Vault[] = "_Datos"

new gCvarPluginToggle 
new cvar_active

new g_PlayerXP[33];
new 
g_PlayerLevel[33];

new 
gBuyCommands[][] =  

     
"usp""glock""deagle""p228""elites""fn57""m3""xm1014""mp5""tmp""p90""mac10""ump45""ak47",  
    
"galil""famas""sg552""m4a1""aug""scout""awp""g3sg1""sg550""m249""vest""vesthelm""flash""hegren"
    
"sgren""defuser""nvgs""shield""primammo""secammo""km45""9x19mm""nighthawk""228compact""12gauge"
    
"autoshotgun""smg""mp""c90""cv47""defender""clarion""krieg552""bullpup""magnum""d3au1""krieg550"
    
"buyammo1""buyammo2" 


#define NUM_OF_LEVELS 10

new const LEVELS[NUM_OF_LEVELS] = {
    
100
    
200
    
400
    
800,
    
1600,
    
3200
    6400
    12800
    25600
    51200
    
}  

new 
gmsgStatusText;

#define PLUGIN    "Grenade_Game" 
#define AUTHOR    "VodKa" 
#define VERSION    "1.2" 
 
public plugin_init() 

    
register_forwardFM_ClientUserInfoChanged"FWClientUserInfoChanged" )
    
register_event("CurWeapon" "Event_CurWeapon" "be" "1=1" ); 
    
gCvarPluginToggle register_cvar("amx_block_buy""1"
    
cvar_active register_cvar("amx_grenade",  "1"
    
register_plugin(PLUGINVERSIONAUTHOR
    
RegisterHam(Ham_Killed"player""Revivir"1
    
RegisterHamHam_Spawn"player""Ham_PlayerSpawn" 
    
register_clcmd"say /registrarse""CMDRegistrarse" )
    
register_clcmd"IntroducirContrasenia""CMDIntroducirContrasenia" )
    
register_cvar("sv_xpmode""1")
    
register_event("DeathMsg""DeathMsg""a")
    
register_cvar("XP_per_kill""20")
    
register_event("ResetHUD""ResetHud""b")
    
gmsgStatusText get_user_msgid("StatusText")
    
register_event("Niveles""Event_Niveles""be""1=1");
     
    for (new 
0sizeof (gBuyCommands); i++) 
        
register_clcmd(gBuyCommands[i], "BlockBuyCommands"


public 
DeathMsg()
{
    if (!
get_cvar_num("sv_animalmod"))
         return;
    
    new 
attacker read_data(1)
    
    if(
g_PlayerLevel[attacker] == NUM_OF_LEVELS)
         return;
    
    
g_PlayerXP[attacker] += get_cvar_num("XP_per_kill")
    
    if(
g_PlayerXP[attacker] >= LEVELS[g_PlayerLevel[attacker]])
    {
        ++
g_PlayerLevel[attacker];
         
        
client_print(attacker_:print_chat"[Grenade_Game] Felicidades!, haz avanzado al nivel %i!"g_PlayerLevel[attacker])
    }
    
ShowHUD(attacker);
}

ShowHUD(id)    
{
    new 
HUD[51]
    
format(HUD50"[Grenade_Game] Nivel: %i XP: %i"g_PlayerLevel[id], g_PlayerXP[id])

    
message_begin(MSG_ONEgmsgStatusText, {0,0,0}, id)
    
write_byte(0)
    
write_string(HUD)
    
message_end()
}

public 
client_connect(id)
{
    
g_PlayerXP[id] = 0;
    
g_PlayerLevel[id] = 0;
}

public 
Event_Nivelesid )
{
    if(
g_PlayerLevel[id] = 1;
    {
        
// Aca va que van a tener en cada nivel
        // ...

public client_disconnectIndex )
    
SaveIndex 

public 
client_putinserverIndex )
{
    
RegistradoIndex ] = 0
    BadPassword
Index ] = 0
    Load
Index )
}

public 
CMDRegistrarseIndex )
{
    if( 
RegistradoIndex ] || BadPasswordIndex ] )
        return 
PLUGIN_HANDLED;
    
    
client_cmdIndex"messagemode IntroducirContrasenia" )
    
    return 
PLUGIN_CONTINUE;
}

public 
CMDIntroducirContraseniaIndex )
{
    
read_argsSZ_Password191 
    
remove_quotesSZ_Password 
    
trimSZ_Password 

    if( 
equalSZ_Password"" ) || containSZ_Password" ") != -1
        return 
PLUGIN_HANDLED;
    else 
    {
        
client_cmdIndex"setinfo _pass ^"%s^""SZ_Password 
        
RegistradoIndex ] = 1       
        
        
static SZ_Name32 ], SZ_Data512 ]
        
get_user_nameIndexSZ_Name31 )       
        
        
formatexSZ_DatacharsmaxSZ_Data ), "%s %d"SZ_Passwordcs_get_user_moneyIndex ) )          
        
        
fvault_set_dataVaultSZ_NameSZ_Data )
        
        
SZ_Password_TIndex ] = SZ_Password
        
        
return PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
SaveIndex )
{
    if( !
RegistradoIndex ] || BadPasswordIndex ] ) 
        return 
PLUGIN_HANDLED;
    
    static 
SZ_Data512 ], SZ_Name32 ]
    
    
formatexSZ_DatacharsmaxSZ_Data ), "%s %d"SZ_Password_TIndex ], cs_get_user_moneyIndex ) )
    
get_user_nameIndexSZ_Name31 )
    
    
fvault_set_dataVaultSZ_NameSZ_Data )
    
    return 
PLUGIN_CONTINUE;
}

public 
LoadIndex )
{
    static 
SZ_Data512 ], SZ_Name32 ], SETINFO_Password191 ], VAULT_Password191 ], Dinero11 ]
    
    
get_user_nameIndexSZ_Name31 )
    
get_user_infoIndex"_pass"SETINFO_Password190 
    
    if( !
fvault_get_dataVaultSZ_NameSZ_DatacharsmaxSZ_Data ) ) ) 
        return 
0;
    
    
RegistradoIndex ] = 1
    
    parse
SZ_DataVAULT_Password190Dinero10 
    
    if( 
equalSETINFO_PasswordVAULT_Password ) ) 
    {
        
SZ_Password_TIndex ] = SETINFO_Password
       
        cs_set_user_money
Indexstr_to_numDinero ) )
   
        return 
2;
    }
    else 
    {
        
BadPasswordIndex ] = 1
        set_hudmessage
(25500, -1.00.1516.014.0)
        
show_hudmessage(id"Password incorrecta, vuelve a intentarlo"szName);
    }
    
    return 
1;
}

public 
FWClientUserInfoChangedIndexBuffer )
{
    if( !
is_user_connectedIndex ) )
        return 
FMRES_IGNORED;
    
    static 
NickName[32], NickOld[32]; get_user_nameIndexNickOld31 )
    
engfuncEngFunc_InfoKeyValueBuffer"name"NickName31 
    
    if( 
equalNickNameNickOld ) )
        return 
FMRES_IGNORED;
    
    
engfuncEngFunc_SetClientKeyValueIndexBuffer"name"NickOld 
    
    
client_cmdIndex"name ^"%s^"; setinfo name ^"%s^""NickOldNickOld )
    
    return 
FMRES_SUPERCEDE;
}  

public 
BlockBuyCommands(id

    if (!
get_pcvar_num(gCvarPluginToggle)) 
              return 
PLUGIN_CONTINUE
           
    return 
PLUGIN_HANDLED


public 
Ham_PlayerSpawn(id

    
strip_user_weapons(id


public 
Revivir(id

    
ExecuteHamB(Ham_CS_RoundRespawnid
    
give_item(id"weapon_hegrenade"
    
give_item(id"weapon_flashbang"
     







public 
Event_CurWeaponid 

    if(
get_pcvar_num(cvar_active)) 
    { 
        new 
he read_data(2
         
        if(
he == CSW_HEGRENADE && is_user_alive(id)) 
             
        return 
PLUGIN_CONTINUE 
         
        
else 
        { 
            
set_task(0.1"he"id
        } 
    } 
    else 
    { 
        return 
PLUGIN_CONTINUE
    } 
    return 
PLUGIN_HANDLED


public 
he(id

    
give_item(id,"weapon_hegrenade"


Last edited by lRodri.; 08-02-2012 at 20:12.
lRodri. is offline
Send a message via MSN to lRodri.
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 08-02-2012 , 20:00   Re: [ES] ¿Esto esta bien?
#2

http://forums.alliedmods.net/showthread.php?t=149597

por favor pon un titulo descriptivo

pd: testea
pd2: modifica el link de tu firma quitandole el proxy
__________________

www.amxmodx-es.com

Steam: Luchokoldo

Last edited by rak; 08-02-2012 at 20:01.
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 08-02-2012 , 20:02   Re: [ES] ¿Esto esta bien?
#3

Exactamente que es lo quieres saber ? si esta mal codeado , si funciona o que , pone un titulo descriptivo acorde de lo que pedis.
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
lRodri.
Member
Join Date: Apr 2012
Location: Argentina
Old 08-02-2012 , 20:12   Re: [ES] ¿Esto esta bien codeado?
#4

Ahi modifique el titulo. QUiero saber si esta bien codeado, el compiler no me funca
lRodri. is offline
Send a message via MSN to lRodri.
 



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:42.


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