Raised This Month: $ Target: $400
 0% 

Grenade_Gamev1.2 [AMXX] [BETA]


  
 
 
Thread Tools Display Modes
DJHD!
Veteran Member
Join Date: Dec 2009
Location: Santiago, Chile
Old 08-28-2012 , 23:58   Re: Grenade_Gamev1.2 [AMXX] [BETA]
#21

Claro se evita la compra pero no bloquea para qué no salga el menu de compra ;)
__________________
Quote:
Originally Posted by XINLEI View Post
Porque rocccos trata de ser el metalicross que nunca va a poder ser.
DJHD! is offline
Send a message via MSN to DJHD!
lRodri.
Member
Join Date: Apr 2012
Location: Argentina
Old 08-29-2012 , 11:01   Re: Grenade_Gamev1.2 [AMXX] [BETA]
#22

Quote:
Originally Posted by gladius View Post
Para bloquear que compren puedes usar este código.

PHP Code:
public plugin_precache() 

    new 
ent create_entity("info_map_parameters"
    
DispatchKeyValue(ent"buying""3"
    
DispatchSpawn(ent

Para los niveles simplemente has esto.
PHP Code:
#define PLAYER_LEVELS(%0)    100 * power(2, %0)

new g_pcvar_perkill;

public 
plugin_init()
{
    
g_pcvar_perkill register_cvar("XP_per_kill""x"// x es la cantidad
}

public 
Event_Death() // DeathMsg
{
    
g_PlayerXP[attacker] += get_pcvar_num(g_pcvar_perkill);
    if(
g_PlayerXP[attacker] >= LEVELS[g_PlayerLevel[attacker]]) 
    { 
        
g_PlayerLevel[attacker]++; 
        
        
client_print(attackerprint_chat"[Grenade_Game] Felicidades!, haz avanzado al nivel %i!"g_PlayerLevel[attacker]) 
    }

Para la vida y Velocidad
PHP Code:
#define PLAYER_HEALTH(%0)    (100 + 5 * %0)
#define PLAYER_VELOCITY(%0)    (250.0 + 2 * %0)

new Float:g_PlayerVelocity[33];

public 
Set_Health(user)
{
    
set_user_health(user,  LEVELS(g_PlayerLevel[id])); 
}

public 
Set_Velocity(user)
{
    
g_PlayerVelocity[user] = PLAYER_VELOCITY(g_PlayerLevel[id]));

La velocidad luego la usas en el code del cual Neeeeeeel te habla en su post #5

Hay más cosas que se pueden mejorar.
Lo puse tal cual me lo pusistes vos, no entendi lo que quisistes decir. Así me quedo:

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_Gamev1.2" 
#define AUTHOR    "VodKa" 
#define VERSION    "1.2" 
#define PLAYER_HEALTH(%0)    (100 + 5 * %0)
#define PLAYER_VELOCITY(%0)    (250.0 + 2 * %0)
 
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()
}

new 
Float:g_PlayerVelocity[33];

public 
Set_Health(user)
{
    
set_user_health(user,  LEVELS(g_PlayerLevel[id])); 
}

public 
Set_Velocity(user)
{
    
g_PlayerVelocity[user] = PLAYER_VELOCITY(g_PlayerLevel[id]));
}

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

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-29-2012 at 19:38.
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:41.


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