Raised This Month: $51 Target: $400
 12% 

My First Attempt to make a menu! part2


Post New Thread Reply   
 
Thread Tools Display Modes
Fr33m@n
Veteran Member
Join Date: May 2008
Location: France Marne
Old 06-08-2011 , 11:42   Re: My First Attempt to make a menu! part2
Reply With Quote #21

Quote:
Originally Posted by RollerBlades View Post
G-dog = Mentor and Teacher
poor G-Dog...
Fr33m@n is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 06-08-2011 , 12:03   Re: My First Attempt to make a menu! part2
Reply With Quote #22

Quote:
Originally Posted by G-Dog View Post
set_user_rendering is restricted to player entities, to set the render on other objects(in this case a grenade) you can either use the engine stock set_rendering or the superhero stock sh_set_rendering or manually
Oh thanks. Always a good thing to know.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
RollerBlades
Senior Member
Join Date: Feb 2011
Location: Sweden
Old 06-08-2011 , 12:46   Re: My First Attempt to make a menu! part2
Reply With Quote #23

i dunno wtf ive done here but here's a preview off this shit.

PHP Code:
// Menu - Basics

#define M3+BOW_MULT 3.0   // damage multiplier for Ultimate M3 and Enchanted Bow # admin only.
#define HEMULT 4.0        // damage multiplier for Super HE # admin only.

#include <superheromod>

#define AMMOX_HEGRENADE 12

new bool:grenadetrail[SH_MAXSLOTS+1];
new 
bool:bowtrail[SH_MAXSLOTS+1];
new 
bool:extradmg[SH_MAXSLOTS+1]; 
new 
bool:extrafragdmg[SH_MAXSLOTS+1];
new 
gTrailgBowTrail;

new const 
itemcost[8] = { 30003000400060005000160000};
new const 
HEGrenade[] = "models/w_hegrenade.mdl";

public 
plugin_init()
{    
    
register_plugin("WeaponMenu""1.1""RB");
    
    
register_clcmd("say /buy""cmd_menu");
    
register_clcmd("say_team /buy""cmd_menu");
    
    
register_event("AmmoX""super_grenade""b");
    
    
register_event("CurWeapon""enchanted_tracer""be""1=1""3>0");
}

public 
plugin_precache()
{
    
gTrail precache_model("sprites/zbeam5.spr");
    
gBowTrail precache_model("sprites/laserbeam.spr");
}

public 
client_damage(attackeriddamageweaponbodypart)    //switching extra damamge methods cause ham module seems a little too complex for you, besides this method is easier to deal with grenade extra damage
{
    if ( !
sh_is_active() || !is_user_alive(id) || !is_user_connected(attacker) ) return;
    
    new 
headshot bodypart == 0;
    
    if ( 
extradmg[attacker] && weapon CSW_M3 CSW_SCOUT )
    {
        
// do extra damage
        
new extraDamage floatround(damage M3+BOW_MULT damage);
        if (
extraDamage 0sh_extra_damage(idattackerextraDamage"Ultimate M3 & Enchanted Bow"headshot);
    }
    if ( 
extrafragdmg[attacker] && weapon == CSW_HEGRENADE )
    {
        
// do extra damage
        
new extraDamage floatround(damage HEMULT damage);
        if (
extraDamage 0sh_extra_damage(idattackerextraDamage"Super HE"headshot);
        
extrafragdmg[attacker] = false;        //we only want the extra dmg to work on our one nade
    
}
}

/*======================================================================
DAMAGE MULT OPTIONS
======================================================================*/
public client_disconnect(id)
{
    
extradmg[id] = false;
    
extrafragdmg[id] = false;
}

// if the damage mult should dissapear upon the player's death then uncomment this function

public sh_client_death(victimattackerheadshot, const wpnDescription[])
{
    
extradmg[victim] = false;
    
extrafragdmg[victim] = false;
}

/* if the damage mult should only last 1 round then uncomment this function

public sh_round_new()
    arrayset(extradmg, false, SH_MAXSLOTS+1);
*/
/*======================================================================
DAMAGE MULT OPTIONS 
======================================================================*/

public cmd_menu(id)
{
    
    if ( 
is_user_alive(id) )
    {
        new 
menu menu_create("Choose Your Weapon Set""menu_handler");
        
menu_additem(menu"/yBuy M4A1 + HE""0"0);
        
menu_additem(menu"/yBuy AK47 + HE""1"0);
        
menu_additem(menu"/yBuy AWP + Kevlar""2"0);
        
menu_additem(menu"/yBuy M249 + Deagle/Flash""3"0);
        
menu_additem(menu"/yBuy CSW_G3SG1""4"0);
        
menu_additem(menu"/yBuy Enchanted Bow""5"0);
        
        new 
buffer[18];    //allows us to format the color based on admin or not
        
formatex(buffercharsmax(buffer), "%sBuy Ultimate M3", (get_user_flags(id) & ADMIN_ADMIN) ? "/y" "/w");
        
menu_additem(menubuffer"6");
        
        
formatex(buffercharsmax(buffer), "%sBuy Super HE", (get_user_flags(id) & ADMIN_ADMIN) ? "/y" "/w");
        
menu_additem(menubuffer"7");
        
        
        
menu_setprop(menuMPROP_EXITMEXIT_ALL);
        
        
menu_display(idmenu0); 
    } else 
client_print(idprint_chat"[AMXX] You Have To Be Alive To Use The Menu."); //this insult brought to you by 1 random guy :P
}

public 
menu_handler(idmenuitem)
{
    
    if ( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    if ( !
is_user_alive(id) )    //in case a player waits till they die and then chooses an option
    
{
        
menu_destroy(menu);
        
client_print(idprint_chat"[AMXX] You Have To Be Alive To Use The Menu.");
        return 
PLUGIN_HANDLED;
    } 
    
    new 
data[2], accescallbackkey;
    
menu_item_getinfo(menuitemaccesdata1__callback);
    
    
key str_to_num(data);
    
    if ( 
<= key )
    {
        new 
usermoney cs_get_user_money(id);
        new 
cost itemcost[key];
        if ( 
usermoney >= cost )
        {
            
cs_set_user_money(idusermoney cost1);
            if ( 
key == client_print(idprint_chat"[AMXX] Bought Enchanted Bow"); //this insult brought to you by 1 random guy :P
            
if ( key == client_print(idprint_chat"[AMXX] Bought Ultimate M3"); //this insult brought to you by 1 random guy :P
            
if ( key == client_print(idprint_chat"[AMXX] Bought Super HE"); //this insult brought to you by 1 random guy :P
            
else client_print(idprint_chat"[AMXX] Bought Weapon Set %i"key+1);
            
            switch(
key)
            {
                case 
0// M4A1 + HE
                
{
                    
sh_give_weapon(idCSW_M4A1true);
                    
sh_give_weapon(idCSW_HEGRENADE);
                }
                case 
1// AK47 + HE
                
{
                    
sh_give_weapon(idCSW_AK47true);
                    
sh_give_weapon(idCSW_HEGRENADE);
                }
                
                case 
2// AWP + Kevlar
                
{
                    
sh_give_weapon(idCSW_AWPtrue);
                    
set_user_armor(id100);
                }
                
                case 
3// M249 + Deagle/Flash
                
{
                    
sh_give_weapon(idCSW_M249true);
                    
sh_give_weapon(idCSW_DEAGLE);
                    
sh_give_weapon(idCSW_FLASHBANG);
                }
                
                case 
4sh_give_weapon(idCSW_G3SG1true); // G3SG1
                    
                
case 5// Enchanted Bow
                
{
                    
sh_give_weapon(idCSW_SCOUTtrue);
                    
extradmg[id] = true;
                    
bowtrail[id] = true;
                }
                
                case 
67// Ulimate M3 and Super HE
                
{
                    if ( !(
get_user_flags(id) & ADMIN_ADMIN) )
                    {
                        
client_print(idprint_chat"[AMXX] Only the admins get to use this option."); //this insult brought to you by 1 random guy :P
                        
menu_destroy(menu);
                        
cmd_menu(id);
                        return 
PLUGIN_HANDLED;
                    }
                    if ( 
key == )
                    {
                        if ( 
cs_get_user_bpammo(idCSW_HEGRENADE) >= )    //get_user_weapon only checks current weapon so instead we check if the user has a nade with this code
                        
{
                            
client_print(idprint_chat"[AMXX] You Already Have A Greande."); 
                            
menu_destroy(menu);
                            
cmd_menu(id);
                            return 
PLUGIN_HANDLED;                    
                        }
                        
sh_give_weapon(idCSW_HEGRENADE);
                        
grenadetrail[id] = true;
                        
extrafragdmg[id] = true;    
                        } else {
                        
sh_give_weapon(idCSW_M3true);
                        
extradmg[id] = true;
                    }
                }
            }        
        } else 
client_print(idprint_chat"[AMXX] You Don't Have Enough Money(You Cheap Bastard).");    //this insult brought to you by 1 random guy :P
    
}
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}   

public 
client_putinserver(id)
{
    
set_hudmessage(000, -0.00.000.00.00.00.00);
    
show_hudmessage(id"Type /Buy <Weapon Menu>");
}

public 
super_grenade(id)
{
    if ( !
sh_is_active() || !is_user_alive(id) ) return;
    
    if ( 
read_data(1) == AMMOX_HEGRENADE 
    {                
        if ( 
grenadetrail[id] ) 
        {
            new 
iCurrent = -1
            
while ( ( iCurrent engfunc(EngFunc_FindEntityByStringiCurrent"classname""grenade") ) > 
            {
                new 
string[32];
                
pev(iCurrentpev_classnamestring31);
                
                if ( 
id == pev(iCurrentpev_owner) && equali(HEGrenadestring)) //sorry, i'm in the habit of using fakemeta over engine.  Engine gave me alot of trouble when I started out and I have a grudge cause of that
                
{
                    
// Make the nade glow
                    
sh_set_rendering(iCurrent225020100kRenderFxGlowShellkRenderTransAlpha);    //vittu didn't waste time adding natives for no reason
                    
                    // Make a trail
                    
message_begin(MSG_BROADCAST ,SVC_TEMPENTITY)
                    
write_byte(22);            //TE_BEAMFOLLOW
                    
write_short(iCurrent);    // entity:attachment to follow
                    
write_short(gTrail);    // sprite index
                    
write_byte(10);        // life in 0.1's
                    
write_byte(10);        // line width in 0.1's
                    
write_byte(225);    // colour
                    
write_byte(90);
                    
write_byte(102);
                    
write_byte(255);    // brightness
                    
message_end();    
                    
                    
grenadetrail[id] = false;    //trail is already attached to our current nade so it's safe to remove our status here before user gets another        
                    
break;    //found our nade so no reason to continue looping through others                    
                
}    
            }
        }
    }
}   

public 
enchanted_tracer(id
{
    if ( !
sh_is_active() || !is_user_alive(id) ) return;
    
    if ( 
read_data(2) == CSW_SCOUT 
    {
        if ( 
bowtrail[id] )
        {    
            new 
origin[3], aimvec[3];
            
get_user_origin(idaimvec1); 
            
get_user_origin(idorigin3); 
            
            
// tracer beam
            
message_begin(MSG_PASSVC_TEMPENTITYorigin)
            
write_byte(0);        // TE_BEAMPOINTS
            
write_coord(origin[0]);
            
write_coord(origin[1]);
            
write_coord(origin[2]);
            
write_coord(aimvec[0]);
            
write_coord(aimvec[1]);
            
write_coord(aimvec[2]);
            
write_short(gBowTrail);    // sprite index
            
write_byte(0);        // starting frame
            
write_byte(10);        // frame rate
            
write_byte(2);        // life in 0.1's
            
write_byte(4);        // line width in 0.1's
            
write_byte(1);        // noise in 0.1's
            
write_byte(0);          // colour
            
write_byte(153);        
            
write_byte(80);        // brightness
            
write_byte(100);        // scroll speed
            
message_end();
        }    
    }
}

public 
sh_client_spawn(id)
{
    
grenadetrail[id] = false;         
    
bowtrail[id] = false;

RollerBlades is offline
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 06-08-2011 , 13:06   Re: My First Attempt to make a menu! part2
Reply With Quote #24

Quote:
Originally Posted by Fr33m@n View Post
poor G-Dog...
Indeed. Anyways, he's actually helping people instead of flaming them as I sometimes do.. And then he is 260 times better than me.

I always used set_user_rendering for various "advantages" I cant exactly remember right now.
__________________

Last edited by The Art of War; 06-08-2011 at 14:39. Reason: Lol typo
The Art of War is offline
G-Dog
Senior Member
Join Date: Dec 2005
Location: Thunderstorm Central
Old 06-08-2011 , 14:31   Re: My First Attempt to make a menu! part2
Reply With Quote #25

Quote:
Originally Posted by RollerBlades View Post
i dunno wtf ive done here but here's a preview off this shit.
alright well first of all
PHP Code:
if ( extradmg[attacker] && weapon CSW_M3 CSW_SCOUT 
you obviously misunderstood condition operations so I suggest taking a look at this tut in this case you should either have
PHP Code:
if ( extradmg[attacker] && (weapon == CSW_M3 || weapon == CSW_SCOUT) )

or 
you could do

if ( 
extradmg[attacker] && (1<<weapon) & (1<<CSW_M3)|(1<<CSW_SCOUT) ) 


next issue is
PHP Code:
            if ( key == client_print(idprint_chat"[AMXX] Bought Enchanted Bow"); 
            if ( 
key == client_print(idprint_chat"[AMXX] Bought Ultimate M3"); 
            if ( 
key == client_print(idprint_chat"[AMXX] Bought Super HE");
            else 
client_print(idprint_chat"[AMXX] Bought Weapon Set %i"key+1); 
the way it is, it'll display 2 messages when a player buys enchanted bow and ultimate m3 because the else statement is triggered as long as key isn't 7 to fix use "else if"
PHP Code:
            if ( key == client_print(idprint_chat"[AMXX] Bought Enchanted Bow");
            else if ( 
key == client_print(idprint_chat"[AMXX] Bought Ultimate M3");
            else if ( 
key == client_print(idprint_chat"[AMXX] Bought Super HE");
            else 
client_print(idprint_chat"[AMXX] Bought Weapon Set %i"key+1); 
another alternative is to move the 3 unique options into the switch and just have 1 check i.e.
PHP Code:
        if ( usermoney >= cost )
        {
            
cs_set_user_money(idusermoney cost1);
            if ( 
<= key <= 4client_print(idprint_chat"[AMXX] Bought Weapon Set %i"key+1);
            
            switch(
key)
            {
                case 
0// M4A1 + HE
                
{
                    
sh_give_weapon(idCSW_M4A1true);
                    
sh_give_weapon(idCSW_HEGRENADE);
                }
                case 
1// AK47 + HE
                
{
                    
sh_give_weapon(idCSW_AK47true);
                    
sh_give_weapon(idCSW_HEGRENADE);
                }
                
                case 
2// AWP + Kevlar
                
{
                    
sh_give_weapon(idCSW_AWPtrue);
                    
set_user_armor(id100);
                }
                
                case 
3// M249 + Deagle/Flash
                
{
                    
sh_give_weapon(idCSW_M249true);
                    
sh_give_weapon(idCSW_DEAGLE);
                    
sh_give_weapon(idCSW_FLASHBANG);
                }
                
                case 
4sh_give_weapon(idCSW_G3SG1true); // G3SG1
                    
                
case 5// Enchanted Bow
                
{
                    
client_print(idprint_chat"[AMXX] Bought Enchanted Bow");
                    
sh_give_weapon(idCSW_SCOUTtrue);
                    
extradmg[id] = true;
                    
bowtrail[id] = true;
                }
                
                case 
67// Ulimate M3 and Super HE
                
{
                    if ( !(
get_user_flags(id) & ADMIN_ADMIN) )
                    {
                        
client_print(idprint_chat"[AMXX] Only the admins get to use this option.");
                        
menu_destroy(menu);
                        
cmd_menu(id);
                        return 
PLUGIN_HANDLED;
                    }
                    if ( 
key == )
                    {
                        if ( 
cs_get_user_bpammo(idCSW_HEGRENADE) >= )    //get_user_weapon only checks current weapon so instead we check if the user has a nade with this code
                        
{
                            
client_print(idprint_chat"[AMXX] You Already Have A Greande."); 
                            
menu_destroy(menu);
                            
cmd_menu(id);
                            return 
PLUGIN_HANDLED;                    
                        }
                        
client_print(idprint_chat"[AMXX] Bought Super HE");
                        
sh_give_weapon(idCSW_HEGRENADE);
                        
grenadetrail[id] = true;
                        
extrafragdmg[id] = true;    
                    } else {
                        
client_print(idprint_chat"[AMXX] Bought Ultimate M3");
                        
sh_give_weapon(idCSW_M3true);
                        
extradmg[id] = true;
                    }
                }
            }        
        } 
didn't like my chat messages huh?




Quote:
Originally Posted by The Art of War View Post
I always used set_user_rendering for various "advantages" I cant exactly remember what remember.
again set_user_rendering only works on players, not other entities. It is faster though because of the fact that your only making one module call as opposed to the 4 set_rendering does.
__________________
If at first you don't succeed, then skydiving isn't for you.

Last edited by G-Dog; 06-10-2011 at 18:22.
G-Dog is offline
Send a message via AIM to G-Dog
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 06-08-2011 , 14:41   Re: My First Attempt to make a menu! part2
Reply With Quote #26

@G-Dog: Oh yes, indeed, but I meant I used it prior to using sh_set_rendering, I think why is because sh_set_rendering have less choices for rendering types or something... It's been quite some time since I coded in PAWN :/ LUA is consuming me.
__________________
The Art of War is offline
RollerBlades
Senior Member
Join Date: Feb 2011
Location: Sweden
Old 06-08-2011 , 15:33   Re: My First Attempt to make a menu! part2
Reply With Quote #27

ohh, its not that i dont like em.. its just that it dont wanna get pwned by my own server


Last edited by RollerBlades; 06-08-2011 at 16:32.
RollerBlades is offline
RollerBlades
Senior Member
Join Date: Feb 2011
Location: Sweden
Old 06-11-2011 , 10:20   Re: My First Attempt to make a menu! part2
Reply With Quote #28

plz i dunno what effects my hudmsg should have in client_putinserver(id) should have.... any ideas guys?

PHP Code:
// Menu - Basics
 
#define M3+BOW_MULT 3.0   // damage multiplier for Ultimate M3 # admin only and Enchanted Bow.
#define HEMULT 4.0        // damage multiplier for Super HE # admin only.
#define PURCHASE_SIZE 8   // size of how many items to choose between and how much they cost in(itemcost).
 
#include <superheromod>
 
#define AMMOX_HEGRENADE 12
 
new bool:grenadetrail[SH_MAXSLOTS+1];
new 
bool:bowtrail[SH_MAXSLOTS+1];
new 
bool:extradmg[SH_MAXSLOTS+1]; 
new 
bool:extrafragdmg[SH_MAXSLOTS+1]; 
new 
gTrailgBowTrail;
 
new const 
itemcost[PURCHASE_SIZE] = { 30003000400060005000160000};
new const 
HEGrenade[] = "models/w_hegrenade.mdl";
 
public 
plugin_init()
{    
    
register_plugin("WeaponMenu""1.1""RB");
 
    
register_clcmd("say /buy""cmd_menu");
    
register_clcmd("say_team /buy""cmd_menu");
 
    
register_event("AmmoX""super_grenade""b");
 
    
register_event("CurWeapon""enchanted_tracer""be""1=1""3>0");
}
 
public 
plugin_precache()
{
    
gTrail precache_model("sprites/zbeam5.spr");
    
gBowTrail precache_model("sprites/laserbeam.spr");
}
 
public 
client_damage(attackeriddamageweaponbodypart)    //switching extra damamge methods cause ham module seems a little too complex for you, besides this method is easier to deal with grenade extra damage
{
    if ( !
sh_is_active() || !is_user_alive(id) || !is_user_connected(attacker) ) return;
 
    new 
headshot bodypart == 0;
 
    if ( 
extradmg[attacker] && (1<<weapon) & (1<<CSW_M3)|(1<<CSW_SCOUT) )
    {
        
// do extra damage
        
new extraDamage floatround(damage M3+BOW_MULT damage);
        if (
extraDamage 0sh_extra_damage(idattackerextraDamage"Ultimate M3 & Enchanted Bow"headshot);
    }
 
    if ( 
extrafragdmg[attacker] && weapon == CSW_HEGRENADE )
    {
        
// do extra damage
        
new extraDamage floatround(damage HEMULT damage);
        if (
extraDamage 0sh_extra_damage(idattackerextraDamage"Super HE"headshot);
        
extrafragdmg[attacker] = false;        //we only want the extra dmg to work on our one nade
    
}
}
 
/*======================================================================
DAMAGE MULT OPTIONS
======================================================================*/
public client_disconnect(id)
{
    
extradmg[id] = false;
    
extrafragdmg[id] = false;
}
 
// if the damage mult should dissapear upon the player's death then uncomment this function
 
public sh_client_death(victimattackerheadshot, const wpnDescription[])
{
    
extradmg[victim] = false;
    
extrafragdmg[victim] = false;
}
 
/* if the damage mult should only last 1 round then uncomment this function
 
public sh_round_end()
    arrayset(extradmg, false, SH_MAXSLOTS+1);
*/
/*======================================================================
DAMAGE MULT OPTIONS 
======================================================================*/
 
public cmd_menu(id)
{
 
    if ( 
is_user_alive(id) )
    {
        new 
menu menu_create("Choose Your Weapon Set""menu_handler");
        
menu_additem(menu"/yBuy M4A1 + HE""0"0);
        
menu_additem(menu"/yBuy AK47 + HE""1"0);
        
menu_additem(menu"/yBuy AWP + Kevlar""2"0);
        
menu_additem(menu"/yBuy M249 + Deagle/Flash""3"0);
        
menu_additem(menu"/yBuy CSW_G3SG1""4"0);
        
menu_additem(menu"/yBuy Enchanted Bow""5"0);
 
        new 
buffer[18];    //allows us to format the color based on admin or not
        
formatex(buffercharsmax(buffer), "%sBuy Ultimate M3", (get_user_flags(id) & ADMIN_ADMIN) ? "/y" "/w");
        
menu_additem(menubuffer"6");
 
        
formatex(buffercharsmax(buffer), "%sBuy Super HE", (get_user_flags(id) & ADMIN_ADMIN) ? "/y" "/w");
        
menu_additem(menubuffer"7");
 
        
menu_setprop(menuMPROP_EXITMEXIT_ALL);
 
        
menu_display(idmenu0); 
    } else 
client_print(idprint_chat"[AMXX] You Have To Be Alive To Use The Menu."); //this insult brought to you by 1 random guy :P
}
 
public 
menu_handler(idmenuitem)
{
 
    if ( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
 
    if ( !
is_user_alive(id) )    //in case a player waits till they die and then chooses an option
    
{
        
menu_destroy(menu);
        
client_print(idprint_chat"[AMXX] You Have To Be Alive To Use The Menu.");
        return 
PLUGIN_HANDLED;
    } 
 
    new 
data[2], accescallbackkey;
    
menu_item_getinfo(menuitemaccesdata1__callback);
 
    
key str_to_num(data);
 
    if ( 
<= key )
    {
        new 
usermoney cs_get_user_money(id);
        new 
cost itemcost[key];
        if ( 
usermoney >= cost )
        {
            if ( 
key == client_print(idprint_chat"[AMXX] Bought Enchanted Bow");
            else if ( 
key == client_print(idprint_chat"[AMXX] Bought Ultimate M3");
                else if ( 
key == client_print(idprint_chat"[AMXX] Bought Super HE");
                else 
client_print(idprint_chat"[AMXX] Bought Weapon Set %i"key+1);  
 
            switch(
key)
            {
                case 
0// M4A1 + HE
                
{
                    
sh_give_weapon(idCSW_M4A1true);
                    
sh_give_weapon(idCSW_HEGRENADE);
                }
                case 
1// AK47 + HE
                
{
                    
sh_give_weapon(idCSW_AK47true);
                    
sh_give_weapon(idCSW_HEGRENADE);
                }
 
                case 
2// AWP + Kevlar
                
{
                    
sh_give_weapon(idCSW_AWPtrue);
                    
set_user_armor(id100);
                }
 
                case 
3// M249 + Deagle/Flash
                
{
                    
sh_give_weapon(idCSW_M249true);
                    
sh_give_weapon(idCSW_DEAGLE);
                    
sh_give_weapon(idCSW_FLASHBANG);
                }
 
                case 
4sh_give_weapon(idCSW_G3SG1true); // G3SG1
 
                
case 5// Enchanted Bow
                
{
                    
sh_give_weapon(idCSW_SCOUTtrue);
                    
extradmg[id] = true;
                    
bowtrail[id] = true;
                }
 
                case 
67// Ulimate M3 and Super HE
                
{
                    if ( !(
get_user_flags(id) & ADMIN_ADMIN) )
                    {
                        
client_print(idprint_chat"[AMXX] Only the admins get to use this option."); //this insult brought to you by 1 random guy :P
                        
menu_destroy(menu);
                        
cmd_menu(id);
                        return 
PLUGIN_HANDLED;
                    }
                    if ( 
key == )
                    {
                        if ( 
cs_get_user_bpammo(idCSW_HEGRENADE) >= )    //get_user_weapon only checks current weapon so instead we check if the user has a nade with this code
                        
{
                            
client_print(idprint_chat"[AMXX] You Already Have A Greande."); 
                            
menu_destroy(menu);
                            
cmd_menu(id);
                            return 
PLUGIN_HANDLED;                    
                        }

                        
sh_give_weapon(idCSW_HEGRENADE);
                        
grenadetrail[id] = true;
                        
extrafragdmg[id] = true;    
                        } else {
                        
sh_give_weapon(idCSW_M3true);
                        
extradmg[id] = true;
                    }
                }
            }        
        } else 
client_print(idprint_chat"[AMXX] You Don't Have Enough Money(You Cheap Bastard).");    //this insult brought to you by 1 random guy :P
    
}
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}   
 
public 
client_putinserver(id)
{
    new 
name[32];
    
get_user_name(idnamesizeof(name));
    
set_hudmessage(227968, -0.00.000.00.00.00.00);
    
show_hudmessage(id"[AMXX] Hello %s! Type /Buy <Weapon Menu>"name); 
}
 
public 
super_grenade(id)
{
    if ( !
sh_is_active() || !is_user_alive(id) ) return;
 
    if ( 
read_data(1) == AMMOX_HEGRENADE 
    {                
        if ( 
grenadetrail[id] ) 
        {
            new 
iCurrent = -1
            
while ( ( iCurrent engfunc(EngFunc_FindEntityByStringiCurrent"classname""grenade") ) > 
            {
                new 
string[32];
                
pev(iCurrentpev_classnamestring31);
 
                if ( 
id == pev(iCurrentpev_owner) && equali(HEGrenadestring)) //sorry, i'm in the habit of using fakemeta over engine.  Engine gave me alot of trouble when I started out and I have a grudge cause of that
                
{
                    
// Make the nade glow
                    
sh_set_rendering(iCurrent225020100kRenderFxGlowShellkRenderTransAlpha);    //vittu didn't waste time adding natives for no reason
 
                    // Make a trail
                    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
                    
write_byte(22);            //TE_BEAMFOLLOW
                    
write_short(iCurrent);    // entity:attachment to follow
                    
write_short(gTrail);    // sprite index
                    
write_byte(10);        // life in 0.1's
                    
write_byte(10);        // line width in 0.1's
                    
write_byte(225);    // colour
                    
write_byte(90);
                    
write_byte(102);
                    
write_byte(255);    // brightness
                    
message_end();    
 
                    
grenadetrail[id] = false;    //trail is already attached to our current nade so it's safe to remove our status here before user gets another        
                    
break;    //found our nade so no reason to continue looping through others                    
                
}    
            }
        }
    }
}   
 
public 
enchanted_tracer(id
{
    if ( !
sh_is_active() || !is_user_alive(id) ) return;
 
    if ( 
read_data(2) == CSW_SCOUT 
    {
        if ( 
bowtrail[id] )
        {    
            new 
origin[3], aimvec[3];
            
get_user_origin(idaimvec1); 
            
get_user_origin(idorigin3); 
 
            
// tracer beam
            
message_begin(MSG_PASSVC_TEMPENTITYorigin)
            
write_byte(0);        // TE_BEAMPOINTS
            
write_coord(origin[0]);
            
write_coord(origin[1]);
            
write_coord(origin[2]);
            
write_coord(aimvec[0]);
            
write_coord(aimvec[1]);
            
write_coord(aimvec[2]);
            
write_short(gBowTrail);    // sprite index
            
write_byte(0);        // starting frame
            
write_byte(10);        // frame rate
            
write_byte(2);        // life in 0.1's
            
write_byte(4);        // line width in 0.1's
            
write_byte(1);        // noise in 0.1's
            
write_byte(0);          // colour
            
write_byte(153);        
            
write_byte(80);        // brightness
            
write_byte(100);        // scroll speed
            
message_end();
        }    
    }
}
 
public 
sh_client_spawn(id)
{
    
grenadetrail[id] = false;         
    
bowtrail[id] = false;
}
 
public 
sh_round_new()
    
client_print(0print_chat"[AMXX] <WpnMenu v1.0 MadeBy RollerBlades>"); 

Last edited by RollerBlades; 06-11-2011 at 15:49.
RollerBlades is offline
RollerBlades
Senior Member
Join Date: Feb 2011
Location: Sweden
Old 06-11-2011 , 15:45   Re: My First Attempt to make a menu! part2
Reply With Quote #29

BUMP
RollerBlades is offline
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 06-11-2011 , 16:26   Re: My First Attempt to make a menu! part2
Reply With Quote #30

Do that again and I'm sure you'll get banned as you got banned for bumping before..

You mean this:

Code:
 set_hudmessage(227, 96, 8, -0.0, 0.0, 0, 0.0, 0.0, 0.0, 0.0, 0);
    show_hudmessage(id, "[AMXX] Hello %s! Type /Buy <Weapon Menu>", name)
It doesnt matter.. Just set some colours using this
http://www.tayloredmktg.com/rgb/

Check Goku or something for positions..
__________________
The Art of War 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 02:38.


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