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

[HELP] - a better code !


Post New Thread Reply   
 
Thread Tools Display Modes
Yusochan
Member
Join Date: Sep 2021
Location: Algeria
Old 10-20-2021 , 16:03   Re: [HELP] - a better code !
Reply With Quote #11

Quote:
Originally Posted by Napoleon_be View Post
Okay, now i see. Just a simple question, are you learning to code or do u just want the code to be remade?

EDIT: Here's something i made in a rush, it's not tested.

PHP Code:
#include <amxmodx>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#include <cromchat>

#pragma semicolon 1

#define ADMIN_VIP             ADMIN_LEVEL_B
#define CS_TEAM_FURIEN        CS_TEAM_CT

new const g_szVersion[] = "0.1";

enum g_eWeaponInfo 
{
    
g_szWeaponName[16],
    
g_szModelPathV[128],
    
g_iWeaponId,
    
g_iWeaponAmmo
};

new 
g_lWeaponInfo[][g_eWeaponInfo] =
{
    { 
"weapon_m4a1""models/vipmenu/v_gold_m4a1.mdl"CSW_M4A1254 },
    { 
"weapon_ak47""models/vipmenu/v_gold_ak47.mdl"CSW_AK47254 },
    { 
"weapon_xm1014""models/vipmenu/v_gold_xm1014.mdl"CSW_XM1014254 },
    { 
"weapon_deagle""models/vipmenu/v_gold_deagle.mdl"CSW_DEAGLE254 }
};

new 
bool:g_bGotWeapon[MAX_PLAYERS 1];

new 
g_szPrefix[MAX_PLAYERS 1];

new 
g_pPrefix;

public 
plugin_init() 
{
    
register_plugin("Vip Menu For Anti-Furiens"g_szVersion"NapoleoN#");

    
register_clcmd("say /vmenu""ShowMenu");
    
register_clcmd("say_team /vmenu""ShowMenu");

    
RegisterHam(Ham_TakeDamage"player""PreTakeDamage");

    
register_event("CurWeapon""CurrentWeapon""be""1=1");

    
g_pPrefix register_cvar("vm_prefix""[^4ANTI-FURIEN^1]");
    
get_pcvar_string(g_pPrefixg_szPrefixcharsmax(g_szPrefix)); // Change map to complete the changes.

}

public 
plugin_precache()
{
    for(new 
iModeliModel sizeof(g_lWeaponInfo[]); iModel++)
    {
        
precache_model(g_lWeaponInfo[iModel][g_szModelPathV]);
    }
}

public 
PreTakeDamage(iVictimiInflictoriAttackerFloat:fDamageiDmgBits)
{
    if(!
is_user_connected(iAttacker) || iAttacker != iInflictor || !g_bGotWeapon[iAttacker])
    {
        return 
HAM_IGNORED;
    }

    new 
iWeapon cs_get_user_weapon(iAttacker);


    if(
iWeapon == g_lWeaponInfo[3][g_iWeaponId])
    {
        
SetHamParamFloat(4fDamage 1.5);
    }

    else 
    {
        
SetHamParamFloat(4fDamage 1.4);
    }
    return 
HAM_HANDLED;
}

public 
CurrentWeapon(id)
{
    if(!
is_user_alive(id))
    {
        return 
PLUGIN_CONTINUE;
    }

    new 
iWeapon cs_get_user_weapon(id);

    for(new 
isizeof(g_lWeaponInfo[]); i++)
    {
        if(
iWeapon == g_lWeaponInfo[i][g_iWeaponId])
        {
            
set_pev(idpev_viewmodel2g_lWeaponInfo[i][g_szModelPathV]);
            break;
        }
    }
    return 
PLUGIN_CONTINUE;
}

public 
ShowMenu(id)
{
    if(
is_user_alive(id))
    {
        if(
get_user_flags(id) & ADMIN_VIP)
        {
            if(
cs_get_user_team(id) == CS_TEAM_FURIEN
            {
                new 
vMenu menu_create("\w[\yFURIEN.NPOWERED.RO\w] \rVIP Menu \yANTI-FURIEN""MenuHandler");
            
                
menu_additem(vMenu"\rM4A1 \w+ \rDeagle \y[GOLD]");
                
menu_additem(vMenu"\rAK47 \w+ \rDeagle \y[GOLD]");
                
menu_additem(vMenu"\rXM1014 \w+ \rDeagle \y[GOLD]");

                
menu_display(idvMenu);
            }

            else
            {
                
ColorChat(idNORMAL"%s^3 Only^1 Furien players"g_szPrefix);
                return 
PLUGIN_HANDLED;
            }
        }

        else 
        {
            
ColorChat(idNORMAL"%s^3 Only^1 V.I.P. Members"g_szPrefix);
            return 
PLUGIN_HANDLED;
        }
    }

    else
    {
        
ColorChat(idNORMAL"%s^3 Only^1 alive players."g_szPrefix);
        return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_HANDLED;
}

public 
MenuHandler(idvMenuiItem)
{
    if(
is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_FURIEN && iItem != MENU_EXIT)
    {
        
strip_user_weapons(id);
        
give_item(idg_lWeaponInfo[iItem][g_szWeaponName]);
        
give_item(id"weapon_knife");
        
cs_set_user_bpammo(idg_lWeaponInfo[iItem][g_iWeaponId], g_lWeaponInfo[iItem][g_iWeaponAmmo]);
        
g_bGotWeapon[id] = true;
    }

    
menu_destroy(vMenu);
    return 
PLUGIN_HANDLED;

thx boy and yes i'm learning code and i maked this one by my self and thanks again ! but the deagle does not display.. :'(
__________________
<b>IP : <font color=Red>93.115.53.168:27017</font></b>
<b>Founder : <font color=Cyan>YusoChan-</font></b>

Last edited by Yusochan; 10-20-2021 at 16:40.
Yusochan is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 10-20-2021 , 16:52   Re: [HELP] - a better code !
Reply With Quote #12

What do you mean with "The deagle does not display"?
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Yusochan
Member
Join Date: Sep 2021
Location: Algeria
Old 10-20-2021 , 17:26   Re: [HELP] - a better code !
Reply With Quote #13

Quote:
Originally Posted by Napoleon_be View Post
What do you mean with "The deagle does not display"?
like when i choose the M4A1 + DEAGLE. the deagle doesnt appear..
__________________
<b>IP : <font color=Red>93.115.53.168:27017</font></b>
<b>Founder : <font color=Cyan>YusoChan-</font></b>
Yusochan is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 10-20-2021 , 17:29   Re: [HELP] - a better code !
Reply With Quote #14

Quote:
Originally Posted by Yusochan View Post
like when i choose the M4A1 + DEAGLE. the deagle doesnt appear..
EDIT: My bad, i see what the problem is, give me a second.

EDIT2: I'll fix this tomorrow, can't think straight anymore today.
__________________

Last edited by Napoleon_be; 10-20-2021 at 17:39.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Yusochan
Member
Join Date: Sep 2021
Location: Algeria
Old 10-20-2021 , 18:00   Re: [HELP] - a better code !
Reply With Quote #15

Quote:
Originally Posted by Napoleon_be View Post
EDIT: My bad, i see what the problem is, give me a second.

EDIT2: I'll fix this tomorrow, can't think straight anymore today.
Take your time homie and i edited the code a bit as u see
__________________
<b>IP : <font color=Red>93.115.53.168:27017</font></b>
<b>Founder : <font color=Cyan>YusoChan-</font></b>

Last edited by Yusochan; 10-20-2021 at 18:00.
Yusochan is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 10-24-2021 , 08:48   Re: [HELP] - a better code !
Reply With Quote #16

If anyone else is interested in helping this guy further, please do, as i'm still not feeling very well after my last PM towards him.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 10-25-2021 , 09:22   Re: [HELP] - a better code !
Reply With Quote #17

To clear out misunderstandings, there's nothing that Yusochan has been doing wrong, it's just me that's been suffering from cluster headaches the last couple of weeks, which make me unable to think straight. If someone finds some time to help this guy further, it would be highly appreciated.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Yusochan
Member
Join Date: Sep 2021
Location: Algeria
Old 10-25-2021 , 14:40   Re: [HELP] - a better code !
Reply With Quote #18

Quote:
Originally Posted by Napoleon_be View Post
To clear out misunderstandings, there's nothing that Yusochan has been doing wrong, it's just me that's been suffering from cluster headaches the last couple of weeks, which make me unable to think straight. If someone finds some time to help this guy further, it would be highly appreciated.
firstly, Thank you, u showed me a new way to code
and the plugin runs good, ya know ? i just wanted to recode it with a new script lmao
but anyway i appreciate ur help cause no one wanted to help me

so, T/C
__________________
<b>IP : <font color=Red>93.115.53.168:27017</font></b>
<b>Founder : <font color=Cyan>YusoChan-</font></b>

Last edited by Yusochan; 10-25-2021 at 14:41.
Yusochan 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 05:18.


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