Raised This Month: $ Target: $400
 0% 

skin select


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
InteX01
Senior Member
Join Date: Jan 2017
Old 08-11-2017 , 12:49   skin select
Reply With Quote #1

PHP Code:
public awp_menu(id)
{
    new 
menu menu_create("\yAWP \r| \wAWP Menu""awp_menu_sel");
    
menu_additem(menu"Obican AWP");
    
menu_additem(menu"\yWooden \r| \d[ \r10 Level \d]");
    
menu_additem(menu"\yBlue Tiger \r| \d[ \r20 Level \d]");
    
menu_display(idmenu);
}

public 
awp_menu_sel(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_CONTINUE;
    }
    
    switch(
item)
    {
        case 
0:
        {
            new 
levelsi;
            
levelsi iLevels[id];
            
            if (
levelsi >= 0
            {
                
ColorChat(idGREEN"^4[AWP] ^1You're using skin - ^4Default AWP");
            }
            
            return 
PLUGIN_CONTINUE;
        }
        case 
1:
        {
            new 
levelsi;
            
levelsi iLevels[id];
            
            if (
levelsi >= 10
            {
                
ColorChat(idGREEN"^4[AWP] ^1You're using skin - ^4Wooden");
            }
            else
            {
                
ColorChat(idGREEN"^4[AWP] ^1You need to be^4 10 Level^1 or higher to use this skin.");
            }
            
            return 
PLUGIN_CONTINUE;
        }
        case 
2:
        {
            new 
levelsi;
            
levelsi iLevels[id];
            
            if (
levelsi >= 20)
            {
                
ColorChat(idGREEN"^4[AWP] ^1You're using skin - ^4Blue Tiger");
            }
            else
            {
                
ColorChat(idGREEN"^4[AWP] ^1You need to be^4 20 Level^1 or higher to use this skin.");
            }

            return 
PLUGIN_CONTINUE;
        }

I tried with set_pev, viewmodel and skin is changed but when i switch on knife and back to awp skin is gone... Same thing with newround. or respawn.

Could someone do this for me

Last edited by InteX01; 08-11-2017 at 18:50.
InteX01 is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 08-11-2017 , 14:09   Re: skin select
Reply With Quote #2

you have to hook weapon change and change it again
__________________
retired chump
DjSoftero is offline
InteX01
Senior Member
Join Date: Jan 2017
Old 08-11-2017 , 18:49   Re: skin select
Reply With Quote #3

That is the problem :/ I dont know how to.. Could someone explain it :/ ? I searched already for that but didnt find anything.
InteX01 is offline
InteX01
Senior Member
Join Date: Jan 2017
Old 08-12-2017 , 07:20   Re: skin select
Reply With Quote #4

anyone ?
InteX01 is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 08-12-2017 , 10:34   Re: skin select
Reply With Quote #5

you can bump only when a week has passed.
the amount of code you gave, is almost useless. I would have to write complete plugin around that little piece.
__________________
retired chump
DjSoftero is offline
.Ahlach_.
Junior Member
Join Date: Dec 2015
Old 08-15-2017 , 10:31   Re: skin select
Reply With Quote #6

Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <ColorChat>
#include <engine>
#include <fakemeta>



#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "-abl"

new iLevels[33]

new g_AWP
new g_AWP2
new g_AWP3

new const _AWP[][] = { "models/p_awp.mdl", "models/v_awp.mdl" }
new const _AWP2[][] = { "models/p_awp.mdl", "models/v_awp2.mdl" }
new const _AWP3[][] = { "models/p_awp.mdl", "models/v_awp3.mdl" }

#define get_bit(%1,%2)          ( %1 &   1 << ( %2 & 31 ) )
#define set_bit(%1,%2)          %1 |=  ( 1 << ( %2 & 31 ) )
#define clear_bit(%1,%2)        %1 &= ~( 1 << ( %2 & 31 ) )

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_event("CurWeapon", "current_weapon", "be", "1=1", "2=29")
}
public client_putinserver(id)
{
	set_bit(g_AWP, id)
	clear_bit(g_AWP2,id)
	clear_bit(g_AWP3,id)
}
public current_weapon(id)
{
        if(is_user_alive(id)){
            
        if(get_bit(g_AWP, id))
        {
                set_pev(id, pev_viewmodel2, _AWP[1])
                set_pev(id, pev_weaponmodel2, _AWP[0])
        }
	if(get_bit(g_AWP2, id))
        {
                set_pev(id, pev_viewmodel2, _AWP2[1])
                set_pev(id, pev_weaponmodel2, _AWP2[0])
        }
	if(get_bit(g_AWP3, id))
        {
                set_pev(id, pev_viewmodel2, _AWP3[1])
                set_pev(id, pev_weaponmodel2, _AWP3[0])
        }
}
}
public awp_menu(id)
{
    new menu = menu_create("\yAWP \r| \wAWP Menu", "awp_menu_sel");
    menu_additem(menu, "Obican AWP");
    menu_additem(menu, "\yWooden \r| \d[ \r10 Level \d]");
    menu_additem(menu, "\yBlue Tiger \r| \d[ \r20 Level \d]");
    menu_display(id, menu);
}

public awp_menu_sel(id, menu, item)
{
    if(item == MENU_EXIT)
    {
        menu_destroy(menu);
        return PLUGIN_CONTINUE;
    }
    
    switch(item)
    {
        case 0:
        {
            new levelsi;
            levelsi = iLevels[id];
            
            if (levelsi >= 0) 
            {
                ColorChat(id, GREEN, "^4[AWP] ^1You're using skin - ^4Default AWP");
		set_bit(g_AWP, id)
		clear_bit(g_AWP2,id)
		clear_bit(g_AWP3,id)
            }
            
            return PLUGIN_CONTINUE;
        }
        case 1:
        {
            new levelsi;
            levelsi = iLevels[id];
            
            if (levelsi >= 10) 
            {
                ColorChat(id, GREEN, "^4[AWP] ^1You're using skin - ^4Wooden");
		set_bit(g_AWP2, id)
		clear_bit(g_AWP,id)
		clear_bit(g_AWP3,id)
            }
            else
            {
                ColorChat(id, GREEN, "^4[AWP] ^1You need to be^4 10 Level^1 or higher to use this skin.");
		set_bit(g_AWP, id)
            }
            
            return PLUGIN_CONTINUE;
        }
        case 2:
        {
            new levelsi;
            levelsi = iLevels[id];
            
            if (levelsi >= 20)
            {
                ColorChat(id, GREEN, "^4[AWP] ^1You're using skin - ^4Blue Tiger");
		set_bit(g_AWP3, id)
		clear_bit(g_AWP2,id)
		clear_bit(g_AWP,id)
            }
            else
            {
                ColorChat(id, GREEN, "^4[AWP] ^1You need to be^4 20 Level^1 or higher to use this skin.");
		set_bit(g_AWP, id)
            }

            return PLUGIN_CONTINUE;
        }
}  }
good?
.Ahlach_. is offline
.Ahlach_.
Junior Member
Join Date: Dec 2015
Old 08-15-2017 , 10:37   Re: skin select
Reply With Quote #7

and you can use this
.Ahlach_. 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 10:18.


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