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

My First Attempt to make a menu! part2


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
RollerBlades
Senior Member
Join Date: Feb 2011
Location: Sweden
Old 06-07-2011 , 08:36   My First Attempt to make a menu! part2
Reply With Quote #1

so i need some help with diffrent stuff today so i made another thread instead of posting in the older one and i also need a nice look for my hudmessage but cant come up with a good look for it, so im wondering if i buy a super grenade and use the trail will the trail then work on a normal grenade??...


heres code:

PHP Code:
// Menu - Basics

#define M3MULT 3        // damage multiplier for Ultimate M3 # admin only.
#define HEMULT 4        // damage multiplier for Super HE # admin only.

#include <superheromod>

#define AMMOX_HEGRENADE 12

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

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

public 
plugin_init()
{
    
    
register_plugin("WeaponMenu""1.0""RB");
    
    
register_clcmd("say /buy""cmd_menu");
    
register_clcmd("say_team /buy""cmd_menu");
    
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage");
    
    
register_event("AmmoX""super_grenade""b");
}

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

public 
fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
{    
    if (
victim == attacker || !is_user_connected(attacker)) // non-player damage or self damage
        
return HAM_IGNORED;
    
    if ( 
extradmg[attacker] ) SetHamParamFloat(4damage M3MULT);    //basic dmg multiplier
    
    
if ( extrafragdmg[attacker] ) SetHamParamFloat(4damage HEMULT);    //basic dmg multiplier
    
    
return HAM_IGNORED;
}

/*======================================================================
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);
        
        new 
buffer[17];    //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"5");
        
        
formatex(buffercharsmax(buffer), "%sBuy Super HE", (get_user_flags(id) & ADMIN_ADMIN) ? "/y" "/w");
        
menu_additem(menubuffer"6");
        
        
        
menu_setprop(menuMPROP_EXITMEXIT_ALL);
        
        
menu_display(idmenu0); 
    } else 
client_print(idprint_chat"[AMXX] You Have To Be Alive To Use The Menu.");
}

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 Purchase Stuff.");
        return 
PLUGIN_HANDLED;
    } 
    
    new 
data[2], accescallbackkey;
    
menu_item_getinfo(menuitemaccesdata1__callback);
    
    
key str_to_num(data);
    
    if ( 
key )
    {
        new 
usermoneyusermoney cs_get_user_money(id);
        new 
costcost itemcost[key];
        if ( 
usermoney >= cost )
        {
            
cs_set_user_money(idusermoney cost1);
            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);
            
            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// The Ultimate Shotgun(ADMIN)
                
{
                    if ( !(
get_user_flags(id) & ADMIN_ADMIN) )
                    {
                        
menu_destroy(menu);
                        
cmd_menu(id);
                        return 
PLUGIN_HANDLED;
                    }
                    
sh_give_weapon(idCSW_M3true);
                    
extradmg[id] = true;
                }
                
                case 
6// The Super Grenade(ADMIN)
                
{
                    if ( !(
get_user_flags(id) & ADMIN_ADMIN) )
                    {
                        
menu_destroy(menu);
                        
cmd_menu(id);
                        return 
PLUGIN_HANDLED;
                    }
                    
                    if ( 
get_user_weapon(id) == CSW_HEGRENADE)
                    {
                        
menu_destroy(menu);
                        
cmd_menu(id);
                        
client_print(idprint_chat"[AMXX] You Already Have A Greande.");
                        return 
PLUGIN_HANDLED;                      
                    }
                    
sh_give_weapon(idCSW_HEGRENADE);
                    
grenadetrail[id] = true;
                    
extrafragdmg[id] = true;                 
                } 
            }          
        } else 
client_print(idprint_chat"[AMXX] You Don't Have Enough Money(You Cheap Bastard).");
    }
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}   

public 
client_putinserver(id)
{
    new 
message[22];
    
format(messagecharsmax(message), "Type /Buy <Weapon Menu>");
    
set_hudmessage(000, -0.00.000.00.00.00.00);
    
show_hudmessage(idmessage);
}

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 find_ent_by_tname(iCurrent"grenade") ) > 
            {
                new 
string[32];
                
entity_get_string(iCurrentEV_SZ_modelstring31);
                
                if ( 
id == entity_get_edict(iCurrentEV_ENT_owner) && equali(HEGrenadestring))
                {
                    
                    new 
Float:glowColor[3] = {225.00.020.0};
                    
                    
// Make the nade glow
                    
entity_set_int(iCurrentEV_INT_renderfxkRenderFxGlowShell);
                    
entity_set_vector(iCurrentEV_VEC_rendercolorglowColor);
                    
                    
// Make the nade a bit invisible to make glow look better
                    
entity_set_int(iCurrentEV_INT_rendermodekRenderTransAlpha);
                    
entity_set_float(iCurrentEV_FL_renderamt100.0 );
                    
                    
// 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();                                
                }    
            }
        }
    }
}   

public 
sh_client_spawn(id)
{
      if ( 
sh_is_active() && is_user_alive(id) && get_user_flags(id) & ADMIN_ADMIN ) {
            
grenadetrail[id] = false;
      }


Last edited by RollerBlades; 06-12-2011 at 03:57.
RollerBlades is offline
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 06-07-2011 , 10:00   Re: My First Attempt to make a menu! part2
Reply With Quote #2

If you mean this

PHP Code:
   // 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(); 
and this

Code:
new bool:grenadetrail[SH_MAXSLOTS+1];
then no... It will not, the bool check will check if it's true.

Oh wait, now I'm not sure what your question really is..

If you buy a super grenade and in the same round, after you've thrown your super grenade and pick up a new one that is "normal", well Im too lazy to actually check that.. But Im sure G-Dog have that covered.
__________________
The Art of War is offline
RollerBlades
Senior Member
Join Date: Feb 2011
Location: Sweden
Old 06-07-2011 , 10:10   Re: My First Attempt to make a menu! part2
Reply With Quote #3

im wondering after you purchased a super nade you'll get the trail for it but if a buy a normal nade after you bought a super nade will it also have the trail going on even though its a noraml grenade??


can you help me with this?

Code:
    new message[22];
    format(message, charsmax(message), "Type /Buy <Weapon Menu>");
    set_hudmessage(0, 0, 0, -0.0, 0.0, 0, 0.0, 0.0, 0.0, 0.0, 0);
    show_hudmessage(id, message);
what colours should i have and how long should fade out and fade in be? and what channel is best?

Last edited by RollerBlades; 06-07-2011 at 10:12.
RollerBlades is offline
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 06-07-2011 , 10:22   Re: My First Attempt to make a menu! part2
Reply With Quote #4

.... I cant tell you what to think and what taste to have, lol. But if you want people to really see it clearly, I would go for the same green as AMXX admin chat is using. Red tends to get blurry with the background, and yellow is too faint. Either the same green or light blue/cyan AMXX is using.

Fade I/O.. Make it what you want it to be, lol.
__________________
The Art of War is offline
G-Dog
Senior Member
Join Date: Dec 2005
Location: Thunderstorm Central
Old 06-07-2011 , 11:21   Re: My First Attempt to make a menu! part2
Reply With Quote #5

Quote:
Originally Posted by RollerBlades View Post
so im wondering if i buy a super grenade and use the trail will the trail then work on a normal grenade??...
while I could answer your question, why don't you try the plugin out and see? It's not like you can permanently break a server with a plugin like this so just try it out and learn as you go.

Quote:
Originally Posted by The Art of War View Post
But Im sure G-Dog have that covered.
... why did i have to get dragged in again?
__________________
If at first you don't succeed, then skydiving isn't for you.
G-Dog is offline
Send a message via AIM to G-Dog
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 06-07-2011 , 11:27   Re: My First Attempt to make a menu! part2
Reply With Quote #6

Quote:
Originally Posted by G-Dog View Post
... why did i have to get dragged in again?
You have to accept that you are now a very popular man who everyone wants to get help from.
__________________
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-07-2011 , 11:30   Re: My First Attempt to make a menu! part2
Reply With Quote #7

Quote:
Originally Posted by G-Dog View Post
while I could answer your question, why don't you try the plugin out and see? It's not like you can permanently break a server with a plugin like this so just try it out and learn as you go.

... why did i have to get dragged in again?
1.there's alot of people playing on my server and i dont wanna temp shutdown my server cause it would be a waste if people leave... i need someone to test it for me and when there's no one online i shutdown the server...... i hope someone will test it for me(prob not)

Now that's how its done

2. Cause you are a cute puppy i <3 u!

edit: would this be more suitable
PHP Code:
public client_putinserver(id)
{
    new 
message[22];
    
formatex(messagecharsmax(message), "Type /Buy <Weapon Menu>");
    
set_hudmessage(000, -0.00.000.00.00.00.00);
    
show_hudmessage(idmessage);

then

PHP Code:
public client_putinserver(id)
{
    new 
message[22];
    
format(messagecharsmax(message), "Type /Buy <Weapon Menu>");
    
set_hudmessage(000, -0.00.000.00.00.00.00);
    
show_hudmessage(idmessage);

i think i heard that formatex is faster then format. am i right now?

Last edited by RollerBlades; 06-07-2011 at 12:09.
RollerBlades is offline
G-Dog
Senior Member
Join Date: Dec 2005
Location: Thunderstorm Central
Old 06-07-2011 , 14:28   Re: My First Attempt to make a menu! part2
Reply With Quote #8

Quote:
Originally Posted by RollerBlades View Post
1.there's alot of people playing on my server and i dont wanna temp shutdown my server cause it would be a waste if people leave... i need someone to test it for me and when there's no one online i shutdown the server...... i hope someone will test it for me(prob not)

Now that's how its done

2. Cause you are a cute puppy i <3 u!

edit: would this be more suitable
PHP Code:
public client_putinserver(id)
{
    new 
message[22];
    
formatex(messagecharsmax(message), "Type /Buy <Weapon Menu>");
    
set_hudmessage(000, -0.00.000.00.00.00.00);
    
show_hudmessage(idmessage);

then

PHP Code:
public client_putinserver(id)
{
    new 
message[22];
    
format(messagecharsmax(message), "Type /Buy <Weapon Menu>");
    
set_hudmessage(000, -0.00.000.00.00.00.00);
    
show_hudmessage(idmessage);

i think i heard that formatex is faster then format. am i right now?
1. fine to answer your question, yes it will still have the grenade trail if the user buys a second nade. If you don't want it to do that then set your grenadetrail var to false after attaching the trail or after the nade explodes.

2. my cat must hate me then

about message: formatex is faster because it skips a specific check that format does. Regardless of that though, since your using a constant/static string then instead of using format at all you could just do
PHP Code:
public client_putinserver(id)
{
    
set_hudmessage(000, -0.00.000.00.00.00.00);
    
show_hudmessage(id"Type /Buy <Weapon Menu>");

also just for reference: your string contains 23 characters so the message array in your original code is too small and will chop off the ">" at the end of your message

and a final note: check which weapon the user has in the damage function, I was lazy earlier and assumed user only had the 1 weapon, but since your adding another option you should make sure they are using that weapon before you apply the extra damage
__________________
If at first you don't succeed, then skydiving isn't for you.
G-Dog is offline
Send a message via AIM to G-Dog
RollerBlades
Senior Member
Join Date: Feb 2011
Location: Sweden
Old 06-07-2011 , 15:48   Re: My First Attempt to make a menu! part2
Reply With Quote #9

how do i check if the nade exploded?? can't i just do so every time i buy super grenade the loop runs once? then i have to buy it again to run the loop once again?

PHP Code:
// Menu - Basics

#define M3MULT 3        // damage multiplier for Ultimate M3 # admin only.
#define HEMULT 4        // damage multiplier for Super HE # admin only.

#include <superheromod>

#define AMMOX_HEGRENADE 12

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

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

public 
plugin_init()
{
    
    
register_plugin("WeaponMenu""1.0""RB");
    
    
register_clcmd("say /buy""cmd_menu");
    
register_clcmd("say_team /buy""cmd_menu");
    
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage");
    
    
register_event("AmmoX""super_grenade""b");
}

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

public 
fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
{    
    if (
victim == attacker || !is_user_connected(attacker)) // non-player damage or self damage
        
return HAM_IGNORED;
    
    if ( 
extradmg[attacker] && read_data(1) == CSW_M3 SetHamParamFloat(4damage M3MULT);    //basic dmg multiplier
    
    
if ( extrafragdmg[attacker] && read_data(1) == CSW_HEGRENADE SetHamParamFloat(4damage HEMULT);    //basic dmg multiplier
    
    
return HAM_IGNORED;
}

/*======================================================================
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);
        
        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"5");
        
        
formatex(buffercharsmax(buffer), "%sBuy Super HE", (get_user_flags(id) & ADMIN_ADMIN) ? "/y" "/w");
        
menu_additem(menubuffer"6");
        
        
        
menu_setprop(menuMPROP_EXITMEXIT_ALL);
        
        
menu_display(idmenu0); 
    } else 
client_print(idprint_chat"[AMXX] You Have To Be Alive To Use The Menu.");
}

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 Purchase Stuff.");
        return 
PLUGIN_HANDLED;
    } 
    
    new 
data[2], accescallbackkey;
    
menu_item_getinfo(menuitemaccesdata1__callback);
    
    
key str_to_num(data);
    
    if ( 
key )
    {
        new 
usermoneyusermoney cs_get_user_money(id);
        new 
costcost itemcost[key];
        if ( 
usermoney >= cost )
        {
            
cs_set_user_money(idusermoney cost1);
            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);
            
            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// The Ultimate Shotgun(ADMIN)
                
{
                    if ( !(
get_user_flags(id) & ADMIN_ADMIN) )
                    {
                        
menu_destroy(menu);
                        
cmd_menu(id);
                        return 
PLUGIN_HANDLED;
                    }
                    
sh_give_weapon(idCSW_M3true);
                    
extradmg[id] = true;
                }
                
                case 
6// The Super Grenade(ADMIN)
                
{
                    if ( !(
get_user_flags(id) & ADMIN_ADMIN) )
                    {
                        
menu_destroy(menu);
                        
cmd_menu(id);
                        return 
PLUGIN_HANDLED;
                    }
                    
                    if ( 
get_user_weapon(id) == CSW_HEGRENADE)
                    {
                        
menu_destroy(menu);
                        
cmd_menu(id);
                        
client_print(idprint_chat"[AMXX] You Already Have A Greande.");
                        return 
PLUGIN_HANDLED;                      
                    }
                    
sh_give_weapon(idCSW_HEGRENADE);
                    
grenadetrail[id] = true;
                    
extrafragdmg[id] = true;                 
                } 
            }          
        } else 
client_print(idprint_chat"[AMXX] You Don't Have Enough Money(You Cheap Bastard).");
    }
    
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 find_ent_by_tname(iCurrent"grenade") ) > 
            {
                new 
string[32];
                
entity_get_string(iCurrentEV_SZ_modelstring31);
                
                if ( 
id == entity_get_edict(iCurrentEV_ENT_owner) && equali(HEGrenadestring))
                {
                    
                    new 
Float:glowColor[3] = {225.00.020.0};
                    
                    
// Make the nade glow
                    
entity_set_int(iCurrentEV_INT_renderfxkRenderFxGlowShell);
                    
entity_set_vector(iCurrentEV_VEC_rendercolorglowColor);
                    
                    
// Make the nade a bit invisible to make glow look better
                    
entity_set_int(iCurrentEV_INT_rendermodekRenderTransAlpha);
                    
entity_set_float(iCurrentEV_FL_renderamt100.0 );
                    
                    
// 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();                                
                }    
            }
        }
    }
}   

public 
sh_client_spawn(id)
{
      if ( 
sh_is_active() && is_user_alive(id) && get_user_flags(id) & ADMIN_ADMIN ) {
            
grenadetrail[id] = false;
      }

what level off scripting is this? i wanna see if i improved my script skills a little bit ;P

beginner or intermediate?

Edit: does the damage multiplier set the mult to i specific weapon? cause i dont see that in the code... but i guess its useless anyway since i made a check so the mult will only be active it the user has that specific weapon in hand

Last edited by RollerBlades; 06-07-2011 at 16:19.
RollerBlades is offline
G-Dog
Senior Member
Join Date: Dec 2005
Location: Thunderstorm Central
Old 06-07-2011 , 19:06   Re: My First Attempt to make a menu! part2
Reply With Quote #10

Quote:
Originally Posted by RollerBlades View Post
PHP Code:
public fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
{    
    if (
victim == attacker || !is_user_connected(attacker)) // non-player damage or self damage
        
return HAM_IGNORED;
    
    if ( 
extradmg[attacker] && read_data(1) == CSW_M3 SetHamParamFloat(4damage M3MULT);    //basic dmg multiplier
    
    
if ( extrafragdmg[attacker] && read_data(1) == CSW_HEGRENADE SetHamParamFloat(4damage HEMULT);    //basic dmg multiplier
    
    
return HAM_IGNORED;

what level off scripting is this? i wanna see if i improved my script skills a little bit ;P
__________________
If at first you don't succeed, then skydiving isn't for you.
G-Dog is offline
Send a message via AIM to G-Dog
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 00:01.


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