AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved/Old Plugins (https://forums.alliedmods.net/forumdisplay.php?f=27)
-   -   Golden weapons for vip (https://forums.alliedmods.net/showthread.php?t=318628)

Abdelrhmanreda170 09-10-2019 19:57

Golden weapons for vip
 
2 Attachment(s)
HELLO ,
I HEAR THAT ALOT OF PEAPLE WANT A PLUGIN LIKE THAT SO I DECIDED TO DO IT :twisted:,,
HERE YOU ARE
Some Info
1-Only player with flag ADMIN_LEVEL_H CAN USE IT !
2- HOW TO USE { MAKE A FOLDER IN MODELS NAME knife_vip ADD ALL THE MODELS IN IT ..
ADD VIP_WEAPON,AMXX IN PLUGIN FOLDER,, ADD vip_weapons in plugin.ini }

iceeedr 09-10-2019 21:58

Re: Golden weapons for vip
 
So you decided to register the curweapon event 19 times ... very good ...

Abdelrhmanreda170 09-10-2019 22:04

Re: Golden weapons for vip
 
i think it's work no problem in it :) !!

OciXCrom 09-11-2019 07:28

Re: Golden weapons for vip
 
What did my eyes just witness there...

If you don't know how to make plugins - don't make plugins. It's that simple.

Hardcoded, poorly coded, against the rules.

Quote:

Originally Posted by Abdelrhmanreda170 (Post 2666610)
i think it's work no problem in it :) !!

Yes, no problem. Only that ALL 19 of those functions are called EACH TIME you shoot a bullet and every single check is executed 19 times + you're checking 19 times if the player has the *hardcoded* admin flag.

Don't post garbage like that here. When you grow up and get some experience in what you're doing, then you can think about sharing an actual plugin with the world.

Foxa 09-11-2019 11:44

Re: Golden weapons for vip
 
Nicely coded, easy approve, 10/10

Smilex_Gamer 09-11-2019 12:40

Re: Golden weapons for vip
 
Quote:

Originally Posted by OciXCrom (Post 2666639)
Only that ALL 19 of those functions are called EACH TIME you shoot a bullet and every single check is executed 19 times + you're checking 19 times if the player has the *hardcoded* admin flag.

I guess he tried to do the same as this:

Code:

new const WEAPONENTNAMES[][] = { "", "weapon_p228", "", "weapon_scout", "weapon_hegrenade", "weapon_xm1014", "weapon_c4", "weapon_mac10",
                        "weapon_aug", "weapon_smokegrenade", "weapon_elite", "weapon_fiveseven", "weapon_ump45", "weapon_sg550",
                        "weapon_galil", "weapon_famas", "weapon_usp", "weapon_glock18", "weapon_awp", "weapon_mp5navy", "weapon_m249",
                        "weapon_m3", "weapon_m4a1", "weapon_tmp", "weapon_g3sg1", "weapon_flashbang", "weapon_deagle", "weapon_sg552",
                        "weapon_ak47", "weapon_knife", "weapon_p90" }

public plugin_init()
{
        for (new i = 1; i < sizeof WEAPONENTNAMES; i++)
                if (WEAPONENTNAMES[i][0]) RegisterHam(Ham_Item_Deploy, WEAPONENTNAMES[i], "fw_Item_Deploy_Post", 1)
}

But instead of using Ham_Item_Deploy, he thought that it would be a good idea to use CurWeapon event.

P.S: There's more code in this obviously, but the point is just registering the event.

thEsp 09-11-2019 15:10

Re: Golden weapons for vip
 
Quote:

Originally Posted by Foxa (Post 2666663)
Nicely coded, easy approve, 10/10

20/10 :)

Abdelrhmanreda170 09-11-2019 17:38

Re: Golden weapons for vip
 
Quote:

Originally Posted by ocixcrom (Post 2666639)
what did my eyes just witness there...

If you don't know how to make plugins - don't make plugins. It's that simple.

Hardcoded, poorly coded, against the rules.



Yes, no problem. Only that all 19 of those functions are called each time you shoot a bullet and every single check is executed 19 times + you're checking 19 times if the player has the *hardcoded* admin flag.

Don't post garbage like that here. When you grow up and get some experience in what you're doing, then you can think about sharing an actual plugin with the world.

i'am new in that , so if you can make this plugin with anthor code make it !

LearninG 09-11-2019 18:31

Re: Golden weapons for vip
 
Quote:

Originally Posted by Abdelrhmanreda170 (Post 2666710)
i'am new in that , so if you can make this plugin with anthor code make it !

example :
Code:
#include <amxmodx> #include <engine> //No models available new NOT_GOLDEN[][] = {         "weapon_knife",         "weapon_c4",            "weapon_p228",         "weapon_mp5navy",         "weapon_ump45",         "weapon_scout",                    "weapon_hegrenad",         "weapon_flashban",         "weapon_smokegre" } new MODELS[][] = {         "models/Knife_vip/v_m4a1.mdl",         "models/Knife_vip/p_m4a1.mdl",         "models/Knife_vip/v_ak47.mdl",         "models/Knife_vip/p_ak47.mdl",         "models/Knife_vip/v_deagle.mdl",         "models/Knife_vip/p_deagle.mdl",         "models/Knife_vip/v_aug.mdl",         "models/Knife_vip/p_aug.mdl",         "models/Knife_vip/v_awp.mdl",         "models/Knife_vip/p_awp.mdl",         "models/Knife_vip/v_famas.mdl",         "models/Knife_vip/p_famas.mdl",         "models/Knife_vip/v_g3sg1.mdl",         "models/Knife_vip/p_g3sg1.mdl" ,         "models/Knife_vip/v_galil.mdl" ,         "models/Knife_vip/p_galil.mdl" ,         "models/Knife_vip/v_elite.mdl" ,         "models/Knife_vip/p_elite.mdl" ,         "models/Knife_vip/v_glock18.mdl" ,         "models/Knife_vip/p_glock18.mdl" ,         "models/Knife_vip/v_m249.mdl" ,         "models/Knife_vip/p_m249.mdl" ,         "models/Knife_vip/v_mac10.mdl" ,         "models/Knife_vip/p_mac10.mdl" ,         "models/Knife_vip/v_mp5.mdl" ,         "models/Knife_vip/p_mp5.mdl" ,         "models/Knife_vip/v_p90.mdl",         "models/Knife_vip/p_p90.mdl" ,         "models/Knife_vip/v_sg550.mdl",         "models/Knife_vip/p_sg550.mdl" ,         "models/Knife_vip/v_sg552.mdl",         "models/Knife_vip/p_sg552.mdl" ,         "models/Knife_vip/v_usp.mdl" ,         "models/Knife_vip/p_usp.mdl" ,         "models/Knife_vip/v_xm1014.mdl" ,         "models/Knife_vip/p_xm1014.mdl" ,         "models/Knife_vip/v_m3.mdl" ,         "models/Knife_vip/p_m3.mdl" } public plugin_precache() {         for (new i; i<sizeof MODELS; i++)         {                 precache_model(MODELS[i])         } } public plugin_init() {         register_plugin("Golden Weapon Skins" , "1.0" , "LearninG")         register_event("CurWeapon", "checkWeapon", "be","1=1") }        public checkWeapon(id) {         static wpnName[16] , vmodel[32] , pmodel[32]         get_weaponname(get_user_weapon(id) , wpnName , charsmax(wpnName))         for (new i; i<sizeof NOT_GOLDEN; i++)         {                 if (equali(wpnName , NOT_GOLDEN[i]))                 return PLUGIN_HANDLED         }         copy(vmodel , charsmax(vmodel) , wpnName)         replace_all(vmodel, charsmax(vmodel), "weapon_", "")         copy(pmodel , charsmax(pmodel) , vmodel)         format(vmodel , charsmax(vmodel) , "models/Knife_vip/v_%s.mdl" , vmodel)         format(pmodel , charsmax(pmodel) , "models/Knife_vip/p_%s.mdl" , pmodel)         entity_set_string(id, EV_SZ_viewmodel , vmodel)         entity_set_string(id, EV_SZ_weaponmodel, pmodel)         return PLUGIN_CONTINUE }

DON KHAN 1 09-16-2019 12:27

Re: Golden weapons for vip
 
Use Ham_Item_Deploy
Quote:

Originally Posted by iceeedr (Post 2666761)
Didn't tested...

PHP Code:

#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#include <engine>

#define    SLOT_PRIMARY        1
#define    SLOT_SECONDARY        2

new WeaponSlots[] =
{
    
0,
    
2,    //CSW_P228
    
0,
    
1,    //CSW_SCOUT
    
4,    //CSW_HEGRENADE
    
1,    //CSW_XM1014
    
5,    //CSW_C4
    
1,    //CSW_MAC10
    
1,    //CSW_AUG
    
4,    //CSW_SMOKEGRENADE
    
2,    //CSW_ELITE
    
2,    //CSW_FIVESEVEN
    
1,    //CSW_UMP45
    
1,    //CSW_SG550
    
1,    //CSW_GALIL
    
1,    //CSW_FAMAS
    
2,    //CSW_USP
    
2,    //CSW_GLOCK18
    
1,    //CSW_AWP
    
1,    //CSW_MP5NAVY
    
1,    //CSW_M249
    
1,    //CSW_M3
    
1,    //CSW_M4A1
    
1,    //CSW_TMP
    
1,    //CSW_G3SG1
    
4,    //CSW_FLASHBANG
    
2,    //CSW_DEAGLE
    
1,    //CSW_SG552
    
1,    //CSW_AK47
    
3,    //CSW_KNIFE
    
1    //CSW_P90
}

new const 
WEAPONENTNAMES[][] = 
{     
"""weapon_p228""""weapon_scout""weapon_hegrenade""weapon_xm1014""weapon_c4""weapon_mac10",
        
"weapon_aug""weapon_smokegrenade""weapon_elite""weapon_fiveseven""weapon_ump45""weapon_sg550",
        
"weapon_galil""weapon_famas""weapon_usp""weapon_glock18""weapon_awp""weapon_mp5navy""weapon_m249",
        
"weapon_m3""weapon_m4a1""weapon_tmp""weapon_g3sg1""weapon_flashbang""weapon_deagle""weapon_sg552",
        
"weapon_ak47""weapon_knife""weapon_p90" 
}

public 
plugin_init()
{
    for (new 
1sizeof WEAPONENTNAMESi++)
        {
            if (
WEAPONENTNAMES[i][0]) RegisterHam(Ham_Item_DeployWEAPONENTNAMES[i], "OnItemDeployPost"1)
        }
}

public 
OnItemDeployPost(ent)
{
    new 
id get_pdata_cbase(ent414)

    if (!
pev_valid(id)) return

    static 
wpnName[16] , vmodel[32] , pmodel[32]
        
get_weaponname(get_user_weapon(id) , wpnName charsmax(wpnName))
        new 
iWeapon get_user_weapon(id)

        if(
WeaponSlots[iWeapon] == SLOT_PRIMARY || WeaponSlots[iWeapon] == SLOT_SECONDARY)
    {
        
copy(vmodel charsmax(vmodel) , wpnName)
            
replace_all(vmodelcharsmax(vmodel), "weapon_""")
            
copy(pmodel charsmax(pmodel) , vmodel)
            
format(vmodel charsmax(vmodel) , "models/Knife_vip/v_%s.mdl" vmodel)
            
format(pmodel charsmax(pmodel) , "models/Knife_vip/p_%s.mdl" pmodel)


            
entity_set_string(idEV_SZ_viewmodel vmodel)
            
entity_set_string(idEV_SZ_weaponmodelpmodel)
    }



Remove the amxx file also from attachments


All times are GMT -4. The time now is 11:14.

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