Raised This Month: $32 Target: $400
 8% 

Bullet damage menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 12-30-2019 , 08:28   Bullet damage menu
Reply With Quote #1

Hello,
I created a bullet damage menu, it compiles fine, but in menu it don't set that option to client.
Plugin:
PHP Code:
#include <amxmodx>
#include <amxmisc>
 
#define DAMAGE_RECIEVED
 
new bulletdamage;
new 
g_MsgSync;

new const 
Floatg_flCoords[][] = 
{
    { 
0.500.40 },
    { 
0.560.44 },
    { 
0.600.50 },
    { 
0.560.56 },
    { 
0.500.60 },
    { 
0.440.56 },
    { 
0.400.50 },
    { 
0.440.44 }
};
new 
g_iPosition[33];
new 
g_iSize;
 
#if defined DAMAGE_RECIEVED
 
new g_MsgSync2
#endif
 
public plugin_init() {
    
register_clcmd("say /bullet""bullet_menu"ADMIN_ALL);
    
g_iSize sizeof(g_flCoords);
}

public 
bullet_menu(id)
{
    new 
Menu menu_create("\y[\rRS\y] \yBullet Damage Menu""BD_Menu");
    
menu_additem(Menu"\y[\rOFF\y]""1"0);
    
menu_additem(Menu"\y[\rCircle\y]""2"0);
    
menu_additem(Menu"\y[\rNormal\y]""3"0)
    
menu_display(idMenu0);
    return 
0;
}

public 
BD_Menu(idmenuitem)
{
    switch (
item) {
        case 
1: {
            return 
PLUGIN_HANDLED;
        }
        case 
2: {
            
bullet_two(id);
        }
        case 
3: {
            
on_damage(id);
        }
    }
    return 
1;
}


public 
on_damage(id)
{
 new 
attacker get_user_attacker(id)
#if defined DAMAGE_RECIEVED
 
if ( is_user_connected(id) && is_user_connected(attacker) )
 {
  new 
damage read_data(2)
  
set_hudmessage(255000.450.5020.14.00.10.1, -1)
  
ShowSyncHudMsg(idg_MsgSync2"%i^n"damage)
#else
 
if ( is_user_connected(attacker) )
 {
  new 
damage read_data(2)
#endif
  
set_hudmessage(0100200, -1.00.5520.14.00.020.02, -1)
  
ShowSyncHudMsg(attackerg_MsgSync"%i^n"damage)
 }
 return 
PLUGIN_CONTINUE
}

public 
bullet_two(id)
{
    static 
iAttackeriAttacker get_user_attacker(id)
    static 
iDamageiDamage read_data(2)
        
        if(++
g_iPosition[iAttacker] == g_iSize)
            
g_iPosition[iAttacker] = 0;
    
        
set_dhudmessage(random_num(0255), random_num(0255), random_num(0255), Floatg_flCoords[g_iPosition[iAttacker]][0], Floatg_flCoords[g_iPosition[iAttacker]][1], 00.12.50.020.02);
        
show_dhudmessage(iAttacker"%i"iDamage);
    
    return 
PLUGIN_HANDLED;

__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi is offline
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 12-30-2019 , 11:43   Re: Bullet damage menu
Reply With Quote #2

first must to register events
Code:
register_event("Damage", "on_damage", "b", "2!0", "3=0", "4!0")
register_event("Damage", "bullet_two", "b", "2!0", "3=0", "4!0")
Code:
new his_bullet_damage[33]

public bullet_menu( id )
{
    new flags = get_user_flags(id)
    if(!(flags & ADMIN_KICK))
    {
        client_print(id,print_chat,"You have no access to this command")
        return PLUGIN_HANDLED
    }
    new gMenu = menu_create("\y[\rRS\y] \yBullet Damage Menu", "BD_Menu")
    
    menu_additem(gMenu, "\y[\rOFF\y]", "0") 
    menu_additem(gMenu, "\y[\rNormal\y]", "1")   
    menu_additem(gMenu, "\y[\rCirclel\y]", "2")

    menu_display(id, gMenu, 0)

    return PLUGIN_HANDLED;  
}

public BD_Menu(id, menu, item)       
{
    if ( item == MENU_EXIT )    
    {
        menu_destroy(menu)       
        return PLUGIN_HANDLED;   
    }
    switch(item)   
    {
        case 0: his_bullet_damage[id] = 0;
        case 1: his_bullet_damage[id] = 1;
        case 2: his_bullet_damage[id] = 2;
    }
    return PLUGIN_HANDLED;  
}
Code:
if(his_bullet_damage[id] == 1)
{
    // something here
}

if(his_bullet_damage[id] == 2)
{
   // something here 
}
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
Reply


Thread Tools
Display Modes

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 22:11.


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