Raised This Month: $ Target: $400
 0% 

change code


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Toastt
BANNED
Join Date: Nov 2009
Old 12-29-2009 , 02:26   change code
Reply With Quote #1

can some one make/change this code below into a shot for shot event?
Shot for shot: people get to shoot at each other 1 shot at a time, after each shot they have to reload to shoot again.

PHP Code:
public menu6(id)
{
    new 
menu menu_create("\yChoose player to fight:""submenu6");
    
     new 
players[32], pnumtempid;
    new 
szName[32], szTempid[10];

    
get_players(playerspnum"a");

    for( new 
ii<pnumi++ )
    {
        
tempid players[i];
        
        if (
cs_get_user_team(tempid) != CS_TEAM_CT)
        {
            continue;
        }
        
        
get_user_name(tempidszName31);
        
num_to_str(tempidszTempid9);
        
menu_additem(menuszNameszTempid0);
    }
    
    
menu_display(idmenu);
    return 
PLUGIN_HANDLED;
}

public 
submenu6(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }

    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);

    new 
tempid str_to_num(data);
    
strip_user_weapons(tempid);
    
give_item(id"weapon_knife");
    
give_item(tempid"weapon_deagle");
    
cs_set_user_bpammo(tempid,CSW_DEAGLE,35)
    
fm_set_rendering(tempidkRenderFxGlowShell02500kRenderNormal20)
    
    
strip_user_weapons(id)
    
set_user_health(id100)
    
give_item(id"weapon_knife");
    
give_item(id"weapon_deagle")
    
cs_set_user_bpammo(id,CSW_DEAGLE,35)
    
fm_set_rendering(idkRenderFxGlowShell02500kRenderNormal20)
            
    new 
szName[32], szName2[32]
    
get_user_name(idszName31);
    
get_user_name(tempidszName231);
    
set_hudmessage02550, -1.00.4025.08.00.00.010)
    
show_hudmessage(0"%s vs %s^n Shot for Shot",szNameszName2)   

    if( 
is_user_alive(tempid) )
        
set_user_health(tempid100);
    
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;

Toastt is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 12-29-2009 , 02:33   Re: change code
Reply With Quote #2

Sounds like a request. I'm not sure what your menu has to do with it, either.

Thinking about this, you might want to catch the attack event, check if it's a gun with ammo, and then set the clip ammo to 0. You might also want to adjust the backpack ammo.

Maybe there's a "golden gun" plugin (golden gun from Golden Eye 007 has one bullet per clip), but I haven't searched for it.

Look for VEN's tutorial on catching shots in CS in the Code Snippets/Tutorials section.
__________________
stupok is offline
Toastt
BANNED
Join Date: Nov 2009
Old 12-29-2009 , 02:49   Re: change code
Reply With Quote #3

i looked at that tut but didnt get it.
Toastt is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 12-29-2009 , 12:42   Re: change code
Reply With Quote #4

In that case, this should be in suggestions/requests, since you're not interested in learning.

Surely, you understand some parts of VEN's tutorial. So, if you want to learn, then ask about the parts that you don't understand.
__________________
stupok is offline
Toastt
BANNED
Join Date: Nov 2009
Old 12-29-2009 , 13:07   Re: change code
Reply With Quote #5

okay stupok
Toastt is offline
Reply



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 04:10.


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