Raised This Month: $ Target: $400
 0% 

Knife skins (Menu)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
bloody806
Member
Join Date: Jun 2012
Location: Czech Republic
Old 02-25-2013 , 08:12   Knife skins (Menu)
Reply With Quote #1

Hi i have Knife menu and in game doesnt work.

Shows no error (log,console) and I can normally compile.

Here is plugin pls heslp me I dont know how it fix.

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

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>

new     g_SKIN33 ],
    
g_SKIN133 ],
    
g_SKIN233 ],
    
g_SKIN333 ],
    
g_SKIN433 ],
    
g_SKIN533 ],
    
g_SKIN633 ],
    
g_SKIN733 ],
    
g_SKIN833 ],
    
g_SKIN933 ],
    
g_SKIN1033 ],
    
turnOn33 ]

new const 
default_skin_v[] = "models/v_knife.mdl" 
new const default_skin_p[] = "models/p_knife.mdl"

new const skin1_v[] = "models/anathrax/dorex/v_knife.mdl" 
static const SKIN1    [ ] = "Dorex Knife"

new const skin2_v[] = "models/anathrax/lightning/v_knife.mdl" 
static const SKIN2    [ ] = "Lightning Knife"

new const skin3_v[] = "models/anathrax/master/v_knife.mdl" 
static const SKIN3    [ ] = "Master Knife"

new const skin4_v[] = "models/anathrax/traker/v_knife.mdl" 
static const SKIN4    [ ] = "Traker Knife"

new const skin5_v[] = "models/anathrax/ultimate/v_knife.mdl" 
static const SKIN5    [ ] = "Ultimate Knife"

new const skin6_v[] = "models/anathrax/ice/v_knife.mdl" 
static const SKIN6    [ ] = "Ice Knife"

new const skin7_v[] = "models/anathrax/bloody/v_knife.mdl" 
static const SKIN7    [ ] = "Bloody Knife"

new const skin8_v[] = "models/anathrax/evolution/v_knife.mdl" 
static const SKIN8    [ ] = "Evolution Knife"

new const skin9_v[] = "models/anathrax/simple/v_knife.mdl" 
static const SKIN9    [ ] = "Simple Knife"

new const skin10_v[] = "models/anathrax/crool/v_knife.mdl" 
static const SKIN10    [ ] = "Crool Knife"

static const PORTAL    [ ] = "^4[aNathrax-team.eu]^1"
static const DIE    [ ] = "You can not open a shop, you must be alive !"
static const MONEY    [ ] = "You dont have money for this knife skin !"
static const NONVIP    [ ] = "You cant buy this skin , You are not ^3VIP ^1!"
static const BUY    [ ] = "You bought ^3"

#define PLUGIN "MultiShop - Knife server"
#define VERSION "1.0"
#define AUTHOR "SkillerkoS"

#define NAZEV_PORTALU "aNathrax-Team.eu"
#define VIP_FLAG ADMIN_LEVEL_H


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /shop""cmd_shop")
    
register_clcmd("say /aktiv""cmd_aktiv")
    
register_clcmd("say /knife""cmd_knife")

    
register_message(get_user_msgid("SayText"),"handleSayText");
}

public 
plugin_precache()
{
    
precache_model(skin1_v)
    
precache_model(skin2_v)
    
precache_model(skin3_v)
    
precache_model(skin4_v)
    
precache_model(skin5_v)
    
precache_model(skin6_v)
    
precache_model(skin7_v)
    
precache_model(skin8_v)
    
precache_model(skin9_v)
    
precache_model(skin10_v)
}
    
public 
client_putinserver(id)
{
    
turnOn[id] = 1
    
    g_SKIN
[id]  = 0
    g_SKIN1
[id] = 0
    g_SKIN2
[id] = 0
    g_SKIN3
[id] = 0
    g_SKIN4
[id] = 0
    g_SKIN5
[id] = 0
    g_SKIN6
[id] = 0
    g_SKIN7
[id] = 0
    g_SKIN8
[id] = 0
    g_SKIN9
[id] = 0
    g_SKIN10
[id] = 0
}

public 
cmd_aktiv(id)
{
    
turnOn[id] = 1
}

public 
cmd_shop(id)
{
    if(
is_user_alive(id))
    {
        new 
directory menu_create(NAZEV_PORTALU "cmd_shop_h")
        
        
menu_additem(directory"Select your knife""1")
        
menu_addblank(directory1)
        
menu_addblank(directory1)
        
menu_additem(directory"Do not show again""2")
        
menu_additem(directory"Exit""3")
    }
    else
    {
        
ChatColor(id"%s %s"PORTAL, DIE)
    }
}

public 
cmd_shop_h(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        return 
PLUGIN_CONTINUE
    
}
    
    switch(
item)
    {
        case 
0:
        {
            
cmd_knife(id)
        }
        
        case 
1:
        {
            
turnOn[id] = 0
        
}
    }
    return 
PLUGIN_HANDLED
}

public 
cmd_knife(id)
{
    if(
is_user_alive(id))
    {
        new 
knife menu_create("Select your Knife""cmd_knife_h")
        
        
menu_additem(knife"Default Knife \r[0$]")
        
menu_additem(knife"%s \r[5$]",SKIN1)
        
menu_additem(knife"%s \r[5$]",SKIN2)
        
menu_additem(knife"%s \r[5$]",SKIN3)
        
menu_additem(knife"%s \r[5$]",SKIN4)
        
menu_additem(knife"%s \r[5$]",SKIN5)
        
menu_additem(knife"%s \r[10$] \y[VIP]",SKIN6)
        
menu_additem(knife"%s \r[10$] \y[VIP]",SKIN7)
        
menu_additem(knife"%s \r[15$] \y[VIP]",SKIN8)
        
menu_additem(knife"%s \r[15$] \y[VIP]",SKIN9)
        
menu_additem(knife"%s \r[15$] \y[VIP]",SKIN10)
    }
    else
    {
        
ChatColor(id"%s %s"PORTAL, DIE)
    }
}
    
public 
cmd_knife_h(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        return 
PLUGIN_CONTINUE
    
}
    
    switch(
item)
    {
        case 
0:
        {
            if(
read_data(2) == CSW_KNIFE)
            {
                
g_SKIN[id]  = 1
                g_SKIN1
[id] = 0
                g_SKIN2
[id] = 0
                g_SKIN3
[id] = 0
                g_SKIN4
[id] = 0
                g_SKIN5
[id] = 0
                g_SKIN6
[id] = 0
                g_SKIN7
[id] = 0
                g_SKIN8
[id] = 0
                g_SKIN9
[id] = 0
                g_SKIN10
[id] = 0
                
                set_pev
(idpev_viewmodel2default_skin_v)
                
set_pev(idpev_weaponmodel2default_skin_p)
                
                
ChatColor(id"%s %s default"PORTALBUY)
            }
        }
        
        case 
1:
        {
            if(
cs_get_user_money(id) > 5)
            {
                if(
read_data(2) == CSW_KNIFE)
                {
                    
g_SKIN[id]  = 0
                    g_SKIN1
[id] = 1
                    g_SKIN2
[id] = 0
                    g_SKIN3
[id] = 0
                    g_SKIN4
[id] = 0
                    g_SKIN5
[id] = 0
                    g_SKIN6
[id] = 0
                    g_SKIN7
[id] = 0
                    g_SKIN8
[id] = 0
                    g_SKIN9
[id] = 0
                    g_SKIN10
[id] = 0
                    
                    set_pev
(idpev_viewmodel2skin1_v)
                    
cs_set_user_money(idcs_get_user_money(id) - 5)
                    
                    
ChatColor(id"%s %s %s"PORTALBUYSKIN1)
                }
            }
            else
            {
                
ChatColor(id"%s %s"PORTALMONEY)
            }
        }
        
        case 
2:
        {
            if(
cs_get_user_money(id) > 5)
            {
                if(
read_data(2) == CSW_KNIFE)
                {
                    
g_SKIN[id]  = 0
                    g_SKIN1
[id] = 0
                    g_SKIN2
[id] = 1
                    g_SKIN3
[id] = 0
                    g_SKIN4
[id] = 0
                    g_SKIN5
[id] = 0
                    g_SKIN6
[id] = 0
                    g_SKIN7
[id] = 0
                    g_SKIN8
[id] = 0
                    g_SKIN9
[id] = 0
                    g_SKIN10
[id] = 0
                    
                    set_pev
(idpev_viewmodel2skin2_v)
                    
cs_set_user_money(idcs_get_user_money(id) - 5)
                    
                    
ChatColor(id"%s %s %s"PORTALBUYSKIN2)
                }
            }
            else
            {
                
ChatColor(id"%s %s"PORTALMONEY)
            }
        }
        
        case 
3:
        {    
            if(
cs_get_user_money(id) > 5)
            {
                    if(
read_data(2) == CSW_KNIFE)
                    {
                        
g_SKIN[id]  = 0
                        g_SKIN1
[id] = 0
                        g_SKIN2
[id] = 0
                        g_SKIN3
[id] = 1
                        g_SKIN4
[id] = 0
                        g_SKIN5
[id] = 0
                        g_SKIN6
[id] = 0
                        g_SKIN7
[id] = 0
                        g_SKIN8
[id] = 0
                        g_SKIN9
[id] = 0
                        g_SKIN10
[id] = 0
                            
                        set_pev
(idpev_viewmodel2skin3_v)
                        
                        
cs_set_user_money(idcs_get_user_money(id) - 5)
                        
                        
ChatColor(id"%s %s %s"PORTALBUYSKIN3)
                    }
            }
            else
            {
                
ChatColor(id"%s %s"PORTALMONEY)
            }
        }
        
        case 
4:
        {
            if(
cs_get_user_money(id) > 5)
            {
                    if(
read_data(2) == CSW_KNIFE)
                    {
                        
                        
g_SKIN[id]  = 0
                        g_SKIN1
[id] = 0
                        g_SKIN2
[id] = 0
                        g_SKIN3
[id] = 0
                        g_SKIN4
[id] = 1
                        g_SKIN5
[id] = 0
                        g_SKIN6
[id] = 0
                        g_SKIN7
[id] = 0
                        g_SKIN8
[id] = 0
                        g_SKIN9
[id] = 0
                        g_SKIN10
[id] = 0
                        
                        set_pev
(idpev_viewmodel2skin4_v)
                        
cs_set_user_money(idcs_get_user_money(id) - 5)
                        
                        
ChatColor(id"%s %s %s"PORTALBUYSKIN4)
                    }
            }
            else
            {
                
ChatColor(id"%s %s"PORTALMONEY)
            }
        }
        
        case 
5:
        {
            if(
cs_get_user_money(id) > 5)
            {
                    if(
read_data(2) == CSW_KNIFE)
                    {
                        
                        
g_SKIN[id]  = 0
                        g_SKIN1
[id] = 0
                        g_SKIN2
[id] = 0
                        g_SKIN3
[id] = 0
                        g_SKIN4
[id] = 0
                        g_SKIN5
[id] = 1
                        g_SKIN6
[id] = 0
                        g_SKIN7
[id] = 0
                        g_SKIN8
[id] = 0
                        g_SKIN9
[id] = 0
                        g_SKIN10
[id] = 0
                        
                        set_pev
(idpev_viewmodel2skin5_v)                        
                        
cs_set_user_money(idcs_get_user_money(id) - 5)
                        
                        
ChatColor(id"%s %s %s"PORTALBUYSKIN5)
                    }
            }
            else
            {
                
ChatColor(id"%s %s"PORTALMONEY)
            }
        }
        
        case 
6:
        {
            if(
cs_get_user_money(id) > 10)
            {
                if(
get_user_flags(id) & VIP_FLAG)
                {
                    if(
read_data(2) == CSW_KNIFE)
                    {
                        
g_SKIN[id]  = 0
                        g_SKIN1
[id] = 0
                        g_SKIN2
[id] = 0
                        g_SKIN3
[id] = 0
                        g_SKIN4
[id] = 0
                        g_SKIN5
[id] = 0
                        g_SKIN6
[id] = 1
                        g_SKIN7
[id] = 0
                        g_SKIN8
[id] = 0
                        g_SKIN9
[id] = 0
                        g_SKIN10
[id] = 0
                        
                        set_pev
(idpev_viewmodel2skin6_v)
                        
cs_set_user_money(idcs_get_user_money(id) - 10)
                        
                        
ChatColor(id"%s %s %s"PORTALBUYSKIN6)
                    }
                }
                else
                {
                    
ChatColor(id"%s %s"PORTALNONVIP)
                }
            }
            else
            {
                
ChatColor(id"%s %s"PORTALMONEY)
            }
        }
        
        case 
7:
        {
            if(
cs_get_user_money(id) > 10)
            {
                if(
get_user_flags(id) & VIP_FLAG)
                {
                    if(
read_data(2) == CSW_KNIFE)
                    {
                        
                        
g_SKIN[id]  = 0
                        g_SKIN1
[id] = 0
                        g_SKIN2
[id] = 0
                        g_SKIN3
[id] = 0
                        g_SKIN4
[id] = 0
                        g_SKIN5
[id] = 0
                        g_SKIN6
[id] = 0
                        g_SKIN7
[id] = 1
                        g_SKIN8
[id] = 0
                        g_SKIN9
[id] = 0
                        g_SKIN10
[id] = 0
                        
                        set_pev
(idpev_viewmodel2skin7_v)
                        
                        
cs_set_user_money(idcs_get_user_money(id) - 10)
                        
                        
ChatColor(id"%s %s %s"PORTALBUYSKIN7)
                    }
                }
                else
                {
                    
ChatColor(id"%s %s"PORTALNONVIP)
                }
            }
            else
            {
                
ChatColor(id"%s %s"PORTALMONEY)
            }
        }
        
        case 
8:
        {
            if(
cs_get_user_money(id) > 15)
            {
                if(
get_user_flags(id) & VIP_FLAG)
                {
                    if(
read_data(2) == CSW_KNIFE)
                    {
                        
                        
g_SKIN[id]  = 0
                        g_SKIN1
[id] = 0
                        g_SKIN2
[id] = 0
                        g_SKIN3
[id] = 0
                        g_SKIN4
[id] = 0
                        g_SKIN5
[id] = 0
                        g_SKIN6
[id] = 0
                        g_SKIN7
[id] = 0
                        g_SKIN8
[id] = 1
                        g_SKIN9
[id] = 0
                        g_SKIN10
[id] = 0
                        
                        set_pev
(idpev_viewmodel2skin8_v)
                        
cs_set_user_money(idcs_get_user_money(id) - 15)
                        
                        
ChatColor(id"%s %s %s"PORTALBUYSKIN8)
                    }
                }
                else
                {
                    
ChatColor(id"%s %s"PORTALNONVIP)
                }
            }
            else
            {
                
ChatColor(id"%s %s"PORTALMONEY)
            }
        }
        
        case 
9:
        {
            if(
cs_get_user_money(id) > 15)
            {
                if(
get_user_flags(id) & VIP_FLAG)
                {
                    if(
read_data(2) == CSW_KNIFE)
                    {
                        
                        
g_SKIN[id]  = 0
                        g_SKIN1
[id] = 0
                        g_SKIN2
[id] = 0
                        g_SKIN3
[id] = 0
                        g_SKIN4
[id] = 0
                        g_SKIN5
[id] = 0
                        g_SKIN6
[id] = 0
                        g_SKIN7
[id] = 0
                        g_SKIN8
[id] = 0
                        g_SKIN9
[id] = 1
                        g_SKIN10
[id] = 0
                        
                        set_pev
(idpev_viewmodel2skin9_v)
                        
                        
cs_set_user_money(idcs_get_user_money(id) - 15)
                        
                        
ChatColor(id"%s %s %s"PORTALBUYSKIN9)
                    }
                }
                else
                {
                    
ChatColor(id"%s %s"PORTALNONVIP)
                }
            }
            else
            {
                
ChatColor(id"%s %s"PORTALMONEY)
                }
        }
        
        case 
10:
        {
            if(
cs_get_user_money(id) > 15)
            {
                if(
get_user_flags(id) & VIP_FLAG)
                {
                    if(
read_data(2) == CSW_KNIFE)
                    {
                        
                        
g_SKIN[id]  = 0
                        g_SKIN1
[id] = 0
                        g_SKIN2
[id] = 0
                        g_SKIN3
[id] = 0
                        g_SKIN4
[id] = 0
                        g_SKIN5
[id] = 0
                        g_SKIN6
[id] = 0
                        g_SKIN7
[id] = 0
                        g_SKIN8
[id] = 0
                        g_SKIN9
[id] = 0
                        g_SKIN10
[id] = 1
                        
                        set_pev
(idpev_viewmodel2skin10_v)
                        
cs_set_user_money(idcs_get_user_money(id) - 15)
                        
                        
ChatColor(id"%s %s %s"PORTALBUYSKIN10)
                    }
                }
                else
                {
                    
ChatColor(id"%s %s"PORTALNONVIP)
                }
            }
            else
            {
                
ChatColor(id"%s %s"PORTALMONEY)
            }
        }
    }
    return 
PLUGIN_HANDLED
}
    
stock ChatColor(const id, const input[], any:...) {
     new 
count 1players32 ]
    static 
msg191 ]
    
vformatmsg190input)
    
    
replace_allmsg190"!g""^4" )
    
replace_allmsg190"!y""^1" )
    
replace_allmsg190"!t""^3" )

    
    if(
idplayers] = id; else get_playersplayerscount"ch" )
    {
        for(new 
0counti++)
        {
            if( 
is_user_connectedplayers] ) )
            {
                
message_beginMSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players] )  
                
write_byteplayers] )
                
write_stringmsg )
                
message_end( )
            }
        }
    }


Last edited by bloody806; 02-25-2013 at 08:20.
bloody806 is offline
Send a message via Skype™ to bloody806
 



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 21:40.


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