Raised This Month: $ Target: $400
 0% 

[ES] Quien me le agrega 2 armas a esto...


  
 
 
Thread Tools Display Modes
Author Message
MaNuCs
BANNED
Join Date: Oct 2009
Location: Venezuela
Old 12-23-2009 , 22:28   [ES] Quien me le agrega 2 armas a esto...
#1

PHP Code:
 #include <amxmodx>
 #include <fakemeta>
 #include <cstrike>
 #include <fun>

 
new cv_deagle_clipgmsgCurWeaponweapon[33], deagle_clip[33], deagle_bpammo[33];

 public 
plugin_init()
 {
    
register_plugin("AWP One Shot","0.11","Avalanche");

    
register_event("CurWeapon","event_curweapon","b");
    
register_event("AmmoX","event_ammox","b");

    
gmsgCurWeapon get_user_msgid("CurWeapon");
    
cv_deagle_clip register_cvar("deagle_clip","1");

    
register_forward(FM_CmdStart,"fw_cmdstart",1);
    
register_clcmd("say /deagle""Reglas")
    
register_clcmd("say /usp""usp")
    
register_clcmd("say /glock""glock")
 }

  public 
deagle(id)
 {
            
cs_set_weapon_ammogive_itemid"weapon_deagle" ), )
            
cs_set_user_bpammoidCSW_DEAGLE10 )
 }
 
   public 
usp(id)
 {
            
cs_set_weapon_ammogive_itemid"weapon_usp" ), )
            
cs_set_user_bpammoidCSW_USP10 )
 }
 
  public 
glock(id)
 {
            
cs_set_weapon_ammogive_itemid"weapon_glock18" ), )
            
cs_set_user_bpammoidCSW_GLOCK1810 )
 }
 
// reset values
 
public client_putinserver(id)
 {
    
weapon[id] = 0;
    
deagle_clip[id] = 0;
    
deagle_bpammo[id] = 0;
 }

 
// restrict clip ammo
 
public event_curweapon(id)
 {
    new 
status read_data(1);

    if(
statusweapon[id] = read_data(2);

    
// using AWP
    
if(read_data(2) == CSW_DEAGLE)
    {
        
// current weapon
        
if(status)
        {
            
// save clip information
            
new old_deagle_clip deagle_clip[id];
            
deagle_clip[id] = read_data(3);

            new 
max_clip get_pcvar_num(cv_deagle_clip);

            
// plugin enabled and must restrict ammo
            
if(max_clip && deagle_clip[id] > max_clip)
            {
                new 
wEnt get_weapon_ent(id,CSW_DEAGLE);
                if(
pev_valid(wEnt)) cs_set_weapon_ammo(wEnt,max_clip);

                
// update HUD
                
message_begin(MSG_ONE,gmsgCurWeapon,_,id);
                
write_byte(1);
                
write_byte(CSW_DEAGLE);
                
write_byte(max_clip);
                
message_end();

                
// don't steal ammo from the player
                
if(deagle_bpammo[id] && deagle_clip[id] > old_deagle_clip)
                    
cs_set_user_bpammo(id,CSW_DEAGLE,deagle_bpammo[id]-max_clip+old_deagle_clip);

                
deagle_clip[id] = max_clip;
            }
        }
        else 
deagle_clip[id] = 999;
    }
    else if(
statusdeagle_clip[id] = 999;
 }

 
// delayed record bpammo information
 
public event_ammox(id)
 {
    
// awp ammo type is 1
    
if(read_data(1) == 1)
    {
        static 
parms[2];
        
parms[0] = id;
        
parms[1] = read_data(2);

        
set_task(0.1,"record_ammo",id,parms,2);
    }
 }

 
// delay, because ammox is called right before curweapon
 
public record_ammo(parms[])
 {
    
deagle_bpammo[parms[0]] = parms[1];
 }

 
// block reload based on new clip size
 
public fw_cmdstart(player,uc_handle,random_seed)
 {
    new 
max_clip get_pcvar_num(cv_deagle_clip);

    if(
weapon[player] == CSW_DEAGLE && max_clip && deagle_clip[player] >= max_clip)
    {
        
set_uc(uc_handle,UC_Buttons,get_uc(uc_handle,UC_Buttons) & ~IN_RELOAD);
        return 
FMRES_HANDLED;
    }

    return 
FMRES_IGNORED;
 }

 
// find a player's weapon entity
 
stock get_weapon_ent(id,wpnid=0,wpnName[]="")
 {
    
// who knows what wpnName will be
    
static newName[32];

    
// need to find the name
    
if(wpnidget_weaponname(wpnid,newName,31);

    
// go with what we were told
    
else formatex(newName,31,"%s",wpnName);

    
// prefix it if we need to
    
if(!equal(newName,"weapon_",7))
        
format(newName,31,"weapon_%s",newName);

    new 
ent;
    while((
ent engfunc(EngFunc_FindEntityByString,ent,"classname",newName)) && pev(ent,pev_owner) != id) {}

    return 
ent;
 } 
HELP
1. quien le podria agregar la usp y la glock...
2. antes que me de el arma me active el plugin
3. y en la proxima ronda lo desactive.

PD:
2) puedo usar un bool pero no se en donde tengo k definir la bool :S
3) ok, puedo usar un ham spawm pero si no resuelvo la 2 menos la 3 XD

++ Doble Karma

Last edited by MaNuCs; 12-23-2009 at 22:42.
MaNuCs is offline
Send a message via MSN to MaNuCs
Hasler
BANNED
Join Date: Jul 2009
Location: Argentina, Rosario
Old 12-23-2009 , 22:41   Re: [ES] Quien me le agrega 2 armas a esto...
#2

seguro que no serìa al reves?cuando ya le haya dado el arma desactive el plugin..

Quote:
2. cuando me de el arma me active el plugin.
3. y en la proxima ronda lo desactive.
Hasler is offline
MaNuCs
BANNED
Join Date: Oct 2009
Location: Venezuela
Old 12-23-2009 , 22:42   Re: [ES] Quien me le agrega 2 armas a esto...
#3

Quote:
Originally Posted by Hasler View Post
seguro que no serìa al reves?cuando ya le haya dado el arma desactive el plugin..
si gracias ya correji xDD!!! se me fue no se k me paso xD
MaNuCs is offline
Send a message via MSN to MaNuCs
Hasler
BANNED
Join Date: Jul 2009
Location: Argentina, Rosario
Old 12-23-2009 , 22:47   Re: [ES] Quien me le agrega 2 armas a esto...
#4

yo lo que te puedo hacer es que cada principio de ronda aparezca el menu, osea que solo lo podes abrir una sola vez y si no elegiste nada te cagas xD
Hasler is offline
MaNuCs
BANNED
Join Date: Oct 2009
Location: Venezuela
Old 12-23-2009 , 22:53   Re: [ES] Quien me le agrega 2 armas a esto...
#5

no yo no kiero eso xD...
MaNuCs is offline
Send a message via MSN to MaNuCs
 



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


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