"Back" option in the menu

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
272
Реакции
14
Hi. How do I add "Back" to this menu?

Код:
public menuWyboru(id)
{
	new menuBody[512]
	formatex(menuBody, charsmax(menuBody), "Choose weapon:")
	new menu = menu_create(menuBody, "skinsmenu")

	menu_additem(menu, "\wmodel \yM4A1 \d(6)")
	menu_additem(menu, "\wmodel \yAK-47 \d(6)")
	menu_additem(menu, "\wmodel \yAWP \d(6)")
        menu_additem(menu, "\wmodel \yKnife \d(6)")
        menu_additem(menu, "\wmodel \yDeagle \d(6)")
	
	
        menu_setprop(menu, MPROP_BACKNAME, "Back");
	menu_setprop(menu, MPROP_NEXTNAME, "Next");
	menu_setprop(menu, MPROP_EXITNAME, "Exit");

	menu_display(id, menu);
}

public skinsmenu(id, menu, item) {

	if(item == MENU_EXIT)
	{
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}
	
	switch(item) 
	{
		case 0: menu_m4(id)
		case 1: menu_ak(id)
		case 2: menu_awp(id)
                case 3: menu_knife(id)
                case 4: menu_deagle(id)
                default: return PLUGIN_HANDLED
	}
	return PLUGIN_HANDLED
} 

public menu_m4(id) {
	new menuBody[512]
	formatex(menuBody, charsmax(menuBody), "Choose skin")
	new menu = menu_create(menuBody, "m4menu")
	
	menu_additem(menu, "\yStandard model")
	
	menu_additem(menu, "\wM4A1 \d- \yInvisible")
	
	menu_additem(menu, "\wM4A1 \d- \yLimitedBlack")
	
	menu_additem(menu, "\wM4A1 \d- \yLimitedGold")
	
	menu_additem(menu, "\wM4A1 \d- \yMolerdo")
	
	menu_additem(menu, "\wM4A1 \d- \yTeradino")

	menu_additem(menu, "\wM4A1 \d- \yDevillSkull")

        
        menu_setprop(menu, MPROP_BACKNAME, "Back");
	menu_setprop(menu, MPROP_NEXTNAME, "Next");
	menu_setprop(menu, MPROP_EXITNAME, "Exit");

	menu_display(id, menu);

        return PLUGIN_HANDLED;
}
There is an undo option, etc., but this option is not displayed:

menu_setprop(menu, MPROP_BACKNAME, "Back");
menu_setprop(menu, MPROP_NEXTNAME, "Next");
menu_setprop(menu, MPROP_EXITNAME, "Exit");

My point is, if I go to the next page, I want to be able to go back to the main menu page later. Right now I have to go out and reopen the menu which is very annoying ..: /
 
Сообщения
101
Реакции
-11
Помог
2 раз(а)
If that's what you meant
Код:
#include <amxmodx>
                                  
public plugin_init()
{
    register_plugin("TEST", "1.0", "TEST")     
                                                
    register_clcmd("say /menu", "menuWyboru")
}

public menuWyboru(id)         
{
    new menu = menu_create("Choose weapon", "skinsmenu")
                                              
    menu_additem(menu, "Menu_1")
    menu_additem(menu, "test")
    
    menu_setprop(menu, MPROP_EXITNAME, "Exit")
    menu_display(id, menu)
}

public skinsmenu(id, menu, item) {
                                            
    if(item == MENU_EXIT)
    {
        menu_destroy(menu)
        return PLUGIN_HANDLED;
    }
    
    switch(item)
    {
        case 0: menu_m4(id)
        case 1: client_cmd(id, "say /test")
    }                       
    
    menu_destroy(menu)
    return PLUGIN_HANDLED
}                                         
                                      
public menu_m4(id)                             
{                                               
    new menu = menu_create("Choose skin", "m4menu")
    
    menu_additem(menu, "test_1")
    menu_additem(menu, "test_2")
    menu_additem(menu, "test_3")

    menu_additem(menu, "Back")                                             
    menu_setprop(menu, MPROP_EXITNAME, "Exit")
    menu_display(id, menu)

    return PLUGIN_HANDLED     
}

public m4menu(id, menu, item)
{
    if(item == MENU_EXIT)                                     
    {
        menu_destroy(menu)
        return PLUGIN_HANDLED
    }
                                        
    switch(item)
    {                           
        case 0: menu_m4(id)
        case 1: client_cmd(id, "say /test_1")
        case 2: client_cmd(id, "say /test_2")
        case 3: menuWyboru(id)
    }                       
    
    menu_destroy(menu)
    return PLUGIN_HANDLED
}
 
Сообщения
272
Реакции
14
My point is that when I go to ak47 in the menu, for example, and the weapon skins are displayed there, I can't go back to the main menu, I just have to go out and re-enter.

Код:
#include <amxmodx>
#include <amxmisc>
#include <engine> 
#include <vault>
#include <fun>

new model_m4[33]
new model_ak[33]
new model_awp[33]
new model_knife[33]
new model_deagle[33]

new NazwyM4A1[][] = {"Standardowy", "Invisible", "LimitedBlack", "LimitedGold", "Molerdo", "Teradino", "DevillSkull"}
new NazwyAK47[][] = {"Standardowy", "Invisible", "LimitedBlack", "LimitedGold", "Strike", "Sepia", "Limonero"}
new NazwyAWP[][] = {"Standardowy", "Invisible", "Black", "Tiger", "Jungle", "Volcano", "Teranivo"}
new NazwyKNIFE[][] = {"Standardowy", "Invisible", "Blood", "Bevasto", "FineGold", "Joker1", "Joker2"}
new NazwyDEAGLE[][] = {"Standardowy", "Invisible", "LimitedBlack", "LimitedGold", "Futrick", "Xperient", "FireBlack"}

public plugin_init() { 
	
	register_event("CurWeapon","CurWeapon","be","1=1") 
	register_clcmd("say /skiny", "menuWyboru")
	register_clcmd("say /skin", "menuWyboru")
	register_clcmd("say /skins", "menuWyboru")
	register_clcmd("say /modele", "menuWyboru")
	register_clcmd("say /model", "menuWyboru")
	register_clcmd("say /models", "menuWyboru")
	
}

public plugin_precache() { 
	precache_model("models/mendolivo/m4a1/1_Invisible.mdl")
	precache_model("models/mendolivo/m4a1/2_LimitedBlack.mdl")
	precache_model("models/mendolivo/m4a1/3_LimitedGold.mdl")
        precache_model("models/mendolivo/m4a1/4_Molerdo.mdl")
	precache_model("models/mendolivo/m4a1/5_Teradino.mdl")
	precache_model("models/mendolivo/m4a1/6_DevillSkull.mdl")
        
	precache_model("models/mendolivo/ak47/1_Invisible.mdl")
	precache_model("models/mendolivo/ak47/2_LimitedBlack.mdl")
	precache_model("models/mendolivo/ak47/3_LimitedGold.mdl")
	precache_model("models/mendolivo/ak47/4_Strike.mdl")
	precache_model("models/mendolivo/ak47/5_Sepia.mdl")
        precache_model("models/mendolivo/ak47/6_Limonero.mdl")
        
        precache_model("models/mendolivo/awp/1_Invisible.mdl")
	precache_model("models/mendolivo/awp/2_Black.mdl")
	precache_model("models/mendolivo/awp/3_Tiger.mdl")
	precache_model("models/mendolivo/awp/4_Jungle.mdl")
	precache_model("models/mendolivo/awp/5_Volcano.mdl")
        precache_model("models/mendolivo/awp/6_Teranivo.mdl")
        
        precache_model("models/mendolivo/knife/1_Invisible.mdl")
	precache_model("models/mendolivo/knife/2_Blood.mdl")
	precache_model("models/mendolivo/knife/3_Bevasto.mdl")
        precache_model("models/mendolivo/knife/4_FineGold.mdl")
        precache_model("models/mendolivo/knife/5_Joker1.mdl")
        precache_model("models/mendolivo/knife/6_Joker2.mdl")
        
        precache_model("models/mendolivo/deagle/1_Invisible.mdl")
	precache_model("models/mendolivo/deagle/2_LimitedBlack.mdl")
	precache_model("models/mendolivo/deagle/3_LimitedGold.mdl")
	precache_model("models/mendolivo/deagle/4_Futrick.mdl")
	precache_model("models/mendolivo/deagle/5_Xperient.mdl")
        precache_model("models/mendolivo/deagle/6_FireBlack.mdl")
} 

public menuWyboru(id)
{
	new menuBody[512]
	formatex(menuBody, charsmax(menuBody), "\dGZH \ySKINS MENU^n^n\rKtory model chcesz zmienic?")
	new menu = menu_create(menuBody, "skinsmenu")

	menu_additem(menu, "\wZmieniam model \yM4A1 \d(6)")
	menu_additem(menu, "\wZmieniam model \yAK-47 \d(6)")
	menu_additem(menu, "\wZmieniam model \yAWP \d(6)")
        menu_additem(menu, "\wZmieniam model \yKnife \d(6)")
        menu_additem(menu, "\wZmieniam model \yDeagle \d(6)")
	
	
        menu_setprop(menu, MPROP_BACKNAME, "Cofnij");
	menu_setprop(menu, MPROP_NEXTNAME, "Dalej");
	menu_setprop(menu, MPROP_EXITNAME, "Wyjdz");

	menu_display(id, menu);
}

public skinsmenu(id, menu, item) {

	if(item == MENU_EXIT)
	{
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}
	
	switch(item) 
	{
		case 0: menu_m4(id)
		case 1: menu_ak(id)
		case 2: menu_awp(id)
                case 3: menu_knife(id)
                case 4: menu_deagle(id)
                default: return PLUGIN_HANDLED
	}
	return PLUGIN_HANDLED
} 

public menu_m4(id) {
	new menuBody[512]
	formatex(menuBody, charsmax(menuBody), "\dGZH \ySKINS MENU^n^n\rWybierz model \w[ \dM4A1 \w]^n\wAktualny skin: \y%s", NazwyM4A1[model_m4[id]])
	new menu = menu_create(menuBody, "m4menu")
	
	menu_additem(menu, "\yStandardowy model")
	
	menu_additem(menu, "\wM4A1 \d- \yInvisible")
	
	menu_additem(menu, "\wM4A1 \d- \yLimitedBlack")
	
	menu_additem(menu, "\wM4A1 \d- \yLimitedGold")
	
	menu_additem(menu, "\wM4A1 \d- \yMolerdo")
	
	menu_additem(menu, "\wM4A1 \d- \yTeradino")

	menu_additem(menu, "\wM4A1 \d- \yDevillSkull")

        
        menu_setprop(menu, MPROP_BACKNAME, "Cofnij");
	menu_setprop(menu, MPROP_NEXTNAME, "Dalej");
	menu_setprop(menu, MPROP_EXITNAME, "Wyjdz");

	menu_display(id, menu);

        return PLUGIN_HANDLED;
}

public m4menu(id, menu, item) {
    switch(item)
    {
        case 0:
        {
            SetM4A1(id , 0)
            client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4M4A1 ^1na: ^3Standardowy model")
            client_cmd(id, "spk plats/elevbell1.wav")
        }
        case 1:
        {
            SetM4A1(id , 1)
            client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4M4A1 ^1na: ^3Invisible")
            client_cmd(id, "spk plats/elevbell1.wav")
        }
        case 2:
        {
            SetM4A1(id , 2)
            client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4M4A1 ^1na: ^3LimitedBlack")
            client_cmd(id, "spk plats/elevbell1.wav")
        }
        case 3:
        {
            SetM4A1(id , 3)
            client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4M4A1 ^1na: ^3LimitedGold")
            client_cmd(id, "spk plats/elevbell1.wav")
        }
        case 4:
        {
            SetM4A1(id , 4)
            client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4M4A1 ^1na: ^3Molerdo")
            client_cmd(id, "spk plats/elevbell1.wav")
        }
        case 5:
        {
            SetM4A1(id , 5)
            client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4M4A1 ^1na: ^3Teradino")
            client_cmd(id, "spk plats/elevbell1.wav")
        }
        case 6:
        {
            SetM4A1(id , 6)
            client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4M4A1 ^1na: ^3DevillSkull")
            client_cmd(id, "spk plats/elevbell1.wav")
        }
        default: return PLUGIN_HANDLED
    }
    ZapiszM4(id)
    return menu_m4(id)
}

public SetM4A1(id , M4A1) {
	model_m4[id] = M4A1
	
	new Clip, Ammo, Weapon = get_user_weapon(id, Clip, Ammo) 
	if ( Weapon != CSW_M4A1 )
	return PLUGIN_HANDLED
	
	new vModel[56]
	
	switch(M4A1)
	{
	case 0: {
			format(vModel,55,"models/v_m4a1.mdl")
		}
	case 1: {
			format(vModel,55,"models/mendolivo/m4a1/1_Invisible.mdl")
		}
	case 2: {
			format(vModel,55,"models/mendolivo/m4a1/2_LimitedBlack.mdl")
		}
	case 3: {
			format(vModel,55,"models/mendolivo/m4a1/3_LimitedGold.mdl")
		}
	case 4: {
			format(vModel,55,"models/mendolivo/m4a1/4_Molerdo.mdl")
		}
	case 5: {
			format(vModel,55,"models/mendolivo/m4a1/5_Teradino.mdl")
		}
	case 6: {
			format(vModel,55,"models/mendolivo/m4a1/6_DevillSkull.mdl")
		}
        } 
	
	entity_set_string(id, EV_SZ_viewmodel, vModel)
	
	return PLUGIN_HANDLED;  
}
27 Сен 2022
This is code, later in the code, they are just another weapon, that's why I shared. Can anyone help add the "Back" option here?
Then I will also add myself to other submenus, because I will know how to do it then
 
Сообщения
397
Реакции
221
Помог
13 раз(а)
pmadisson75,

Код:
#include <amxmodx>
#include <amxmisc>
#include <engine> 
#include <vault>
#include <fun>
new model_m4[33]
new model_ak[33]
new model_awp[33]
new model_knife[33]
new model_deagle[33]
new NazwyM4A1[][] = {"Standardowy", "Invisible", "LimitedBlack", "LimitedGold", "Molerdo", "Teradino", "DevillSkull"}
new NazwyAK47[][] = {"Standardowy", "Invisible", "LimitedBlack", "LimitedGold", "Strike", "Sepia", "Limonero"}
new NazwyAWP[][] = {"Standardowy", "Invisible", "Black", "Tiger", "Jungle", "Volcano", "Teranivo"}
new NazwyKNIFE[][] = {"Standardowy", "Invisible", "Blood", "Bevasto", "FineGold", "Joker1", "Joker2"}
new NazwyDEAGLE[][] = {"Standardowy", "Invisible", "LimitedBlack", "LimitedGold", "Futrick", "Xperient", "FireBlack"}
public plugin_init() { 
    
    register_event("CurWeapon","CurWeapon","be","1=1") 
    register_clcmd("say /skiny", "menuWyboru")
    register_clcmd("say /skin", "menuWyboru")
    register_clcmd("say /skins", "menuWyboru")
    register_clcmd("say /modele", "menuWyboru")
    register_clcmd("say /model", "menuWyboru")
    register_clcmd("say /models", "menuWyboru")
    
}
public plugin_precache() { 
    precache_model("models/mendolivo/m4a1/1_Invisible.mdl")
    precache_model("models/mendolivo/m4a1/2_LimitedBlack.mdl")
    precache_model("models/mendolivo/m4a1/3_LimitedGold.mdl")
        precache_model("models/mendolivo/m4a1/4_Molerdo.mdl")
    precache_model("models/mendolivo/m4a1/5_Teradino.mdl")
    precache_model("models/mendolivo/m4a1/6_DevillSkull.mdl")
        
    precache_model("models/mendolivo/ak47/1_Invisible.mdl")
    precache_model("models/mendolivo/ak47/2_LimitedBlack.mdl")
    precache_model("models/mendolivo/ak47/3_LimitedGold.mdl")
    precache_model("models/mendolivo/ak47/4_Strike.mdl")
    precache_model("models/mendolivo/ak47/5_Sepia.mdl")
        precache_model("models/mendolivo/ak47/6_Limonero.mdl")
        
        precache_model("models/mendolivo/awp/1_Invisible.mdl")
    precache_model("models/mendolivo/awp/2_Black.mdl")
    precache_model("models/mendolivo/awp/3_Tiger.mdl")
    precache_model("models/mendolivo/awp/4_Jungle.mdl")
    precache_model("models/mendolivo/awp/5_Volcano.mdl")
        precache_model("models/mendolivo/awp/6_Teranivo.mdl")
        
        precache_model("models/mendolivo/knife/1_Invisible.mdl")
    precache_model("models/mendolivo/knife/2_Blood.mdl")
    precache_model("models/mendolivo/knife/3_Bevasto.mdl")
        precache_model("models/mendolivo/knife/4_FineGold.mdl")
        precache_model("models/mendolivo/knife/5_Joker1.mdl")
        precache_model("models/mendolivo/knife/6_Joker2.mdl")
        
        precache_model("models/mendolivo/deagle/1_Invisible.mdl")
    precache_model("models/mendolivo/deagle/2_LimitedBlack.mdl")
    precache_model("models/mendolivo/deagle/3_LimitedGold.mdl")
    precache_model("models/mendolivo/deagle/4_Futrick.mdl")
    precache_model("models/mendolivo/deagle/5_Xperient.mdl")
        precache_model("models/mendolivo/deagle/6_FireBlack.mdl")
} 
public menuWyboru(id)
{
    new menuBody[512]
    formatex(menuBody, charsmax(menuBody), "\dGZH \ySKINS MENU^n^n\rKtory model chcesz zmienic?")
    new menu = menu_create(menuBody, "skinsmenu")
    menu_additem(menu, "\wZmieniam model \yM4A1 \d(6)")
    menu_additem(menu, "\wZmieniam model \yAK-47 \d(6)")
    menu_additem(menu, "\wZmieniam model \yAWP \d(6)")
        menu_additem(menu, "\wZmieniam model \yKnife \d(6)")
        menu_additem(menu, "\wZmieniam model \yDeagle \d(6)")
    
    
        menu_setprop(menu, MPROP_BACKNAME, "Cofnij");
    menu_setprop(menu, MPROP_NEXTNAME, "Dalej");
    menu_setprop(menu, MPROP_EXITNAME, "Wyjdz");
    menu_display(id, menu);
}
public skinsmenu(id, menu, item) {
    if(item == MENU_EXIT)
    {
        menu_destroy(menu);
        return PLUGIN_HANDLED;
    }
    
    switch(item) 
    {
        case 0: menu_m4(id)
        case 1: menu_ak(id)
        case 2: menu_awp(id)
                case 3: menu_knife(id)
                case 4: menu_deagle(id)
                default: return PLUGIN_HANDLED
    }
    return PLUGIN_HANDLED
} 
public menu_m4(id) {
    new menuBody[512]
    formatex(menuBody, charsmax(menuBody), "\dGZH \ySKINS MENU^n^n\rWybierz model \w[ \dM4A1 \w]^n\wAktualny skin: \y%s", NazwyM4A1[model_m4[id]])
    new menu = menu_create(menuBody, "m4menu")
    
    menu_additem(menu, "\yStandardowy model")
    
    menu_additem(menu, "\wM4A1 \d- \yInvisible")
    
    menu_additem(menu, "\wM4A1 \d- \yLimitedBlack")
    
    menu_additem(menu, "\wM4A1 \d- \yLimitedGold")
    
    menu_additem(menu, "\wM4A1 \d- \yMolerdo")
    
    menu_additem(menu, "\wM4A1 \d- \yTeradino")
    menu_additem(menu, "\wM4A1 \d- \yDevillSkull")
        
        menu_setprop(menu, MPROP_BACKNAME, "Back");
    menu_setprop(menu, MPROP_NEXTNAME, "Next");
    menu_setprop(menu, MPROP_EXITNAME, "Exit in menu");
    menu_display(id, menu);
        return PLUGIN_HANDLED;
}
public m4menu(id, menu, item) {
    menu_destroy(iMenu);
    if(item == MENU_EXIT) {
        if(is_user_connected(id))
            menuWyboru(id);
        
        return PLUGIN_HANDLED;
    }
    client_cmd(id, "spk plats/elevbell1.wav");
    SetM4A1(id,item);
    switch(item)
    {
        case 0: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4M4A1 ^1na: ^3Standardowy model")
        case 1: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4M4A1 ^1na: ^3Invisible")
        case 2: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4M4A1 ^1na: ^3LimitedBlack")
        case 3: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4M4A1 ^1na: ^3LimitedGold")
        case 4: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4M4A1 ^1na: ^3Molerdo")
        case 5: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4M4A1 ^1na: ^3Teradino")
        case 6: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4M4A1 ^1na: ^3DevillSkull")
    }
    ZapiszM4(id);
    menu_m4(id);
    
    return PLUGIN_HANDLED;
}
public SetM4A1(id , M4A1) {
    model_m4[id] = M4A1
    
    new Clip, Ammo, Weapon = get_user_weapon(id, Clip, Ammo) 
    if ( Weapon != CSW_M4A1 )
    return PLUGIN_HANDLED
    
    new vModel[56]
    
    switch(M4A1)
    {
    case 0: {
            format(vModel,55,"models/v_m4a1.mdl")
        }
    case 1: {
            format(vModel,55,"models/mendolivo/m4a1/1_Invisible.mdl")
        }
    case 2: {
            format(vModel,55,"models/mendolivo/m4a1/2_LimitedBlack.mdl")
        }
    case 3: {
            format(vModel,55,"models/mendolivo/m4a1/3_LimitedGold.mdl")
        }
    case 4: {
            format(vModel,55,"models/mendolivo/m4a1/4_Molerdo.mdl")
        }
    case 5: {
            format(vModel,55,"models/mendolivo/m4a1/5_Teradino.mdl")
        }
    case 6: {
            format(vModel,55,"models/mendolivo/m4a1/6_DevillSkull.mdl")
        }
        } 
    
    entity_set_string(id, EV_SZ_viewmodel, vModel)
    
    return PLUGIN_HANDLED;  
}
 

Вложения

  • 6.8 KB Просмотры: 4
Последнее редактирование:
Сообщения
397
Реакции
221
Помог
13 раз(а)
pmadisson75, Unknown symbol. Most likely, another designation is used there. Send the entire code in its entirety
 
Сообщения
272
Реакции
14
Код:
#include <amxmodx>
#include <amxmisc>
#include <engine> 
#include <vault>
#include <fun>

new model_m4[33]
new model_ak[33]
new model_awp[33]
new model_knife[33]
new model_deagle[33]

new NazwyM4A1[][] = {"Standardowy", "Invisible", "LimitedBlack", "LimitedGold", "Molerdo", "Teradino", "DevillSkull"}
new NazwyAK47[][] = {"Standardowy", "Invisible", "LimitedBlack", "LimitedGold", "Strike", "Sepia", "Limonero"}
new NazwyAWP[][] = {"Standardowy", "Invisible", "Black", "Tiger", "Jungle", "Volcano", "Teranivo"}
new NazwyKNIFE[][] = {"Standardowy", "Invisible", "Blood", "Bevasto", "FineGold", "Joker1", "Joker2"}
new NazwyDEAGLE[][] = {"Standardowy", "Invisible", "LimitedBlack", "LimitedGold", "Futrick", "Xperient", "FireBlack"}

public plugin_init() { 
	
	register_event("CurWeapon","CurWeapon","be","1=1") 
	register_clcmd("say /skiny", "menuWyboru")
	register_clcmd("say /skin", "menuWyboru")
	register_clcmd("say /skins", "menuWyboru")
	register_clcmd("say /modele", "menuWyboru")
	register_clcmd("say /model", "menuWyboru")
	register_clcmd("say /models", "menuWyboru")
	
}

public plugin_precache() { 
	precache_model("models/mendolivo/m4a1/1_Invisible.mdl")
	precache_model("models/mendolivo/m4a1/2_LimitedBlack.mdl")
	precache_model("models/mendolivo/m4a1/3_LimitedGold.mdl")
        precache_model("models/mendolivo/m4a1/4_Molerdo.mdl")
	precache_model("models/mendolivo/m4a1/5_Teradino.mdl")
	precache_model("models/mendolivo/m4a1/6_DevillSkull.mdl")
        
	precache_model("models/mendolivo/ak47/1_Invisible.mdl")
	precache_model("models/mendolivo/ak47/2_LimitedBlack.mdl")
	precache_model("models/mendolivo/ak47/3_LimitedGold.mdl")
	precache_model("models/mendolivo/ak47/4_Strike.mdl")
	precache_model("models/mendolivo/ak47/5_Sepia.mdl")
        precache_model("models/mendolivo/ak47/6_Limonero.mdl")
        
        precache_model("models/mendolivo/awp/1_Invisible.mdl")
	precache_model("models/mendolivo/awp/2_Black.mdl")
	precache_model("models/mendolivo/awp/3_Tiger.mdl")
	precache_model("models/mendolivo/awp/4_Jungle.mdl")
	precache_model("models/mendolivo/awp/5_Volcano.mdl")
        precache_model("models/mendolivo/awp/6_Teranivo.mdl")
        
        precache_model("models/mendolivo/knife/1_Invisible.mdl")
	precache_model("models/mendolivo/knife/2_Blood.mdl")
	precache_model("models/mendolivo/knife/3_Bevasto.mdl")
        precache_model("models/mendolivo/knife/4_FineGold.mdl")
        precache_model("models/mendolivo/knife/5_Joker1.mdl")
        precache_model("models/mendolivo/knife/6_Joker2.mdl")
        
        precache_model("models/mendolivo/deagle/1_Invisible.mdl")
	precache_model("models/mendolivo/deagle/2_LimitedBlack.mdl")
	precache_model("models/mendolivo/deagle/3_LimitedGold.mdl")
	precache_model("models/mendolivo/deagle/4_Futrick.mdl")
	precache_model("models/mendolivo/deagle/5_Xperient.mdl")
        precache_model("models/mendolivo/deagle/6_FireBlack.mdl")
} 

public menuWyboru(id)
{
	new menuBody[512]
	formatex(menuBody, charsmax(menuBody), "\dGZH \ySKINS MENU^n^n\rKtory model chcesz zmienic?")
	new menu = menu_create(menuBody, "skinsmenu")

	menu_additem(menu, "\wZmieniam model \yM4A1 \d(6)")
	menu_additem(menu, "\wZmieniam model \yAK-47 \d(6)")
	menu_additem(menu, "\wZmieniam model \yAWP \d(6)")
        menu_additem(menu, "\wZmieniam model \yKnife \d(6)")
        menu_additem(menu, "\wZmieniam model \yDeagle \d(6)")
	
	
        menu_setprop(menu, MPROP_BACKNAME, "Cofnij");
	menu_setprop(menu, MPROP_NEXTNAME, "Dalej");
	menu_setprop(menu, MPROP_EXITNAME, "Wyjdz");

	menu_display(id, menu);
}

public skinsmenu(id, menu, item) {

	if(item == MENU_EXIT)
	{
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}
	
	switch(item) 
	{
		case 0: menu_m4(id)
		case 1: menu_ak(id)
		case 2: menu_awp(id)
                case 3: menu_knife(id)
                case 4: menu_deagle(id)
                default: return PLUGIN_HANDLED
	}
	return PLUGIN_HANDLED
} 

public menu_m4(id) {
	new menuBody[512]
	formatex(menuBody, charsmax(menuBody), "\dGZH \ySKINS MENU^n^n\rWybierz model \w[ \dM4A1 \w]^n\wAktualny skin: \y%s", NazwyM4A1[model_m4[id]])
	new menu = menu_create(menuBody, "m4menu")
	
	menu_additem(menu, "\yStandardowy model")
	
	menu_additem(menu, "\wM4A1 \d- \yInvisible")
	
	menu_additem(menu, "\wM4A1 \d- \yLimitedBlack")
	
	menu_additem(menu, "\wM4A1 \d- \yLimitedGold")
	
	menu_additem(menu, "\wM4A1 \d- \yMolerdo")
	
	menu_additem(menu, "\wM4A1 \d- \yTeradino")

	menu_additem(menu, "\wM4A1 \d- \yDevillSkull")

        
        menu_setprop(menu, MPROP_BACKNAME, "Back");
	menu_setprop(menu, MPROP_NEXTNAME, "Next");
	menu_setprop(menu, MPROP_EXITNAME, "Exit in menu");

	menu_display(id, menu);

        return PLUGIN_HANDLED;
}

public m4menu(id, menu, item) {
    menu_destroy(iMenu);

    if(item == MENU_EXIT) {
        if(is_user_connected(id))
            menuWyboru(id);
        
        return PLUGIN_HANDLED;
    }

    client_cmd(id, "spk plats/elevbell1.wav");
    SetM4A1(id,item);

    switch(item)
    {
        case 0: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4M4A1 ^1na: ^3Standardowy model")
        case 1: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4M4A1 ^1na: ^3Invisible")
        case 2: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4M4A1 ^1na: ^3LimitedBlack")
        case 3: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4M4A1 ^1na: ^3LimitedGold")
        case 4: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4M4A1 ^1na: ^3Molerdo")
        case 5: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4M4A1 ^1na: ^3Teradino")
        case 6: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4M4A1 ^1na: ^3DevillSkull")
    }

    ZapiszM4(id);
    menu_m4(id);
    
    return PLUGIN_HANDLED;
}

public SetM4A1(id , M4A1) {
	model_m4[id] = M4A1
	
	new Clip, Ammo, Weapon = get_user_weapon(id, Clip, Ammo) 
	if ( Weapon != CSW_M4A1 )
	return PLUGIN_HANDLED
	
	new vModel[56]
	
	switch(M4A1)
	{
	case 0: {
			format(vModel,55,"models/v_m4a1.mdl")
		}
	case 1: {
			format(vModel,55,"models/mendolivo/m4a1/1_Invisible.mdl")
		}
	case 2: {
			format(vModel,55,"models/mendolivo/m4a1/2_LimitedBlack.mdl")
		}
	case 3: {
			format(vModel,55,"models/mendolivo/m4a1/3_LimitedGold.mdl")
		}
	case 4: {
			format(vModel,55,"models/mendolivo/m4a1/4_Molerdo.mdl")
		}
	case 5: {
			format(vModel,55,"models/mendolivo/m4a1/5_Teradino.mdl")
		}
	case 6: {
			format(vModel,55,"models/mendolivo/m4a1/6_DevillSkull.mdl")
		}
        } 
	
	entity_set_string(id, EV_SZ_viewmodel, vModel)
	
	return PLUGIN_HANDLED;  
}

public menu_ak(id) {
	new menuBody[512]
	formatex(menuBody, charsmax(menuBody), "\dGZH \ySKINS MENU^n^n\rWybierz model \w[ \dAK-47 \w]^n\wAktualny skin: \y%s", NazwyAK47[model_ak[id]])
	new menu = menu_create(menuBody, "akmenu")
	
	menu_additem(menu, "\yStandardowy model")
	
	menu_additem(menu, "\wAK-47 \d- \yInvisible")
	
	menu_additem(menu, "\wAK-47 \d- \yLimitedBlack")
	
	menu_additem(menu, "\wAK-47 \d- \yLimitedGold")
	
	menu_additem(menu, "\wAK-47 \d- \yStrike")
	
	menu_additem(menu, "\wAK-47 \d- \ySepia")

	menu_additem(menu, "\wAK-47 \d- \yLimonero")

        
        menu_setprop(menu, MPROP_BACKNAME, "Back");
	menu_setprop(menu, MPROP_NEXTNAME, "Next");
	menu_setprop(menu, MPROP_EXITNAME, "Exit in menu");

	menu_display(id, menu);

        return PLUGIN_HANDLED;
}

public akmenu(id, menu, item) {
    menu_destroy(iMenu);

    if(item == MENU_EXIT) {
        if(is_user_connected(id))
            menuWyboru(id);
        
        return PLUGIN_HANDLED;
    }

    client_cmd(id, "spk plats/elevbell1.wav");
    SetAK47(id,item);

    switch(item)
    {
        case 0: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4AK-47 ^1na: ^3Standardowy model")
        case 1: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4AK-47 ^1na: ^3Invisible")
        case 2: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4AK-47 ^1na: ^3LimitedBlack")
        case 3: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4AK-47 ^1na: ^3LimitedGold")
        case 4: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4AK-47 ^1na: ^3Strike")
        case 5: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4AK-47 ^1na: ^3Sepia")
        case 6: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4AK-47 ^1na: ^3Limonero")
    }

    ZapiszAK(id);
    menu_ak(id);
    
    return PLUGIN_HANDLED;
}

public SetAK47(id , AK47) {
	model_ak[id] = AK47
	
	new Clip, Ammo, Weapon = get_user_weapon(id, Clip, Ammo) 
	if ( Weapon != CSW_AK47 )
	return PLUGIN_HANDLED
	
	new vModel[56]
	
	switch(AK47)
	{
	case 0: {
			format(vModel,55,"models/v_ak47.mdl")
		}
	case 1: {
			format(vModel,55,"models/mendolivo/ak47/1_Invisible.mdl")
		}
	case 2: {
			format(vModel,55,"models/mendolivo/ak47/2_LimitedBlack.mdl")
		}
	case 3: {
			format(vModel,55,"models/mendolivo/ak47/3_LimitedGold.mdl")
		}
	case 4: {
			format(vModel,55,"models/mendolivo/ak47/4_Strike.mdl")
		}
	case 5: {
			format(vModel,55,"models/mendolivo/ak47/5_Sepia.mdl")
		}
	case 6: {
			format(vModel,55,"models/mendolivo/ak47/6_Limonero.mdl")
		}
        } 
	
	entity_set_string(id, EV_SZ_viewmodel, vModel)
	
	return PLUGIN_HANDLED;  
}

public menu_awp(id) {
	new menuBody[512]
	formatex(menuBody, charsmax(menuBody), "\dGZH \ySKINS MENU^n^n\rWybierz model \w[ \dAWP \w]^n\wAktualny skin: \y%s", NazwyAWP[model_awp[id]])
	new menu = menu_create(menuBody, "awpmenu")
	
	menu_additem(menu, "\yStandardowy model")
	
	menu_additem(menu, "\wAWP \d- \yInvisible")
	
	menu_additem(menu, "\wAWP \d- \yBlack")
	
	menu_additem(menu, "\wAWP \d- \yTiger")
	
	menu_additem(menu, "\wAWP \d- \yJungle")
	
	menu_additem(menu, "\wAWP \d- \yVolcano")

	menu_additem(menu, "\wAWP \d- \yTeranivo")

        
        menu_setprop(menu, MPROP_BACKNAME, "Back");
	menu_setprop(menu, MPROP_NEXTNAME, "Next");
	menu_setprop(menu, MPROP_EXITNAME, "Exit in menu");

	menu_display(id, menu);

        return PLUGIN_HANDLED;
}

public awpmenu(id, menu, item) {
    menu_destroy(iMenu);

    if(item == MENU_EXIT) {
        if(is_user_connected(id))
            menuWyboru(id);
        
        return PLUGIN_HANDLED;
    }

    client_cmd(id, "spk plats/elevbell1.wav");
    SetAWP(id,item);

    switch(item)
    {
        case 0: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4AWP ^1na: ^3Standardowy model")
        case 1: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4AWP ^1na: ^3Invisible")
        case 2: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4AWP ^1na: ^3Black")
        case 3: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4AWP ^1na: ^3Tiger")
        case 4: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4AWP ^1na: ^3Jungle")
        case 5: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4AWP ^1na: ^3Volcano")
        case 6: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4AWP ^1na: ^3Teranivo")
    }

    ZapiszAWP(id);
    menu_awp(id);
    
    return PLUGIN_HANDLED;
}

public SetAWP(id , AWP) {
	model_awp[id] = AWP
	
	new Clip, Ammo, Weapon = get_user_weapon(id, Clip, Ammo) 
	if ( Weapon != CSW_AWP )
	return PLUGIN_HANDLED
	
	new vModel[56]
	
	switch(AWP)
	{
	case 0: {
			format(vModel,55,"models/v_awp.mdl")
		}
	case 1: {
			format(vModel,55,"models/mendolivo/awp/1_Invisible.mdl")
		}
	case 2: {
			format(vModel,55,"models/mendolivo/awp/2_Black.mdl")
		}
	case 3: {
			format(vModel,55,"models/mendolivo/awp/3_Tiger.mdl")
		}
	case 4: {
			format(vModel,55,"models/mendolivo/awp/4_Jungle.mdl")
		}
	case 5: {
			format(vModel,55,"models/mendolivo/awp/5_Volcano.mdl")
		}
	case 6: {
			format(vModel,55,"models/mendolivo/awp/6_Teranivo.mdl")
		}
        } 
	
	entity_set_string(id, EV_SZ_viewmodel, vModel)
	
	return PLUGIN_HANDLED;  
}

public menu_knife(id) {
	new menuBody[512]
	formatex(menuBody, charsmax(menuBody), "\dGZH \ySKINS MENU^n^n\rWybierz model \w[ \dKnife \w]^n\wAktualny skin: \y%s", NazwyKNIFE[model_knife[id]])
	new menu = menu_create(menuBody, "knifemenu")
	
	menu_additem(menu, "\yStandardowy model")
	
	menu_additem(menu, "\wKnife \d- \yInvisible")
	
	menu_additem(menu, "\wKnife \d- \yBlood")
	
	menu_additem(menu, "\wKnife \d- \yBevasto")
	
	menu_additem(menu, "\wKnife \d- \yFineGold")
	
	menu_additem(menu, "\wKnife \d- \yJoker1")

	menu_additem(menu, "\wKnife \d- \yJoker2")

        
        menu_setprop(menu, MPROP_BACKNAME, "Back");
	menu_setprop(menu, MPROP_NEXTNAME, "Next");
	menu_setprop(menu, MPROP_EXITNAME, "Exit in menu");

	menu_display(id, menu);

        return PLUGIN_HANDLED;
}

public knifemenu(id, menu, item) {
    menu_destroy(iMenu);

    if(item == MENU_EXIT) {
        if(is_user_connected(id))
            menuWyboru(id);
        
        return PLUGIN_HANDLED;
    }

    client_cmd(id, "spk plats/elevbell1.wav");
    SetKNIFE(id,item);

    switch(item)
    {
        case 0: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4Knife ^1na: ^3Standardowy model")
        case 1: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4Knife ^1na: ^3Invisible")
        case 2: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4Knife ^1na: ^3Blood")
        case 3: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4Knife ^1na: ^3Bevasto")
        case 4: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4Knife ^1na: ^3FineGold")
        case 5: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4Knife ^1na: ^3Joker1")
        case 6: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4Knife ^1na: ^3Joker2")
    }

    ZapiszKNIFE(id);
    menu_knife(id);
    
    return PLUGIN_HANDLED;
}

public SetKNIFE(id , KNIFE) {
	model_knife[id] = KNIFE
	
	new Clip, Ammo, Weapon = get_user_weapon(id, Clip, Ammo) 
	if ( Weapon != CSW_KNIFE )
	return PLUGIN_HANDLED
	
	new vModel[56]
	
	switch(KNIFE)
	{
	case 0: {
			format(vModel,55,"models/v_knife.mdl")
		}
	case 1: {
			format(vModel,55,"models/mendolivo/knife/1_Invisible.mdl")
		}
	case 2: {
			format(vModel,55,"models/mendolivo/knife/2_Blood.mdl")
		}
	case 3: {
			format(vModel,55,"models/mendolivo/knife/3_Bevasto.mdl")
		}
	case 4: {
			format(vModel,55,"models/mendolivo/knife/4_FineGold.mdl")
		}
	case 5: {
			format(vModel,55,"models/mendolivo/knife/5_Joker1.mdl")
		}
	case 6: {
			format(vModel,55,"models/mendolivo/knife/6_Joker2.mdl")
		}
        } 
	
	entity_set_string(id, EV_SZ_viewmodel, vModel)
	
	return PLUGIN_HANDLED;  
}

public menu_deagle(id) {
	new menuBody[512]
	formatex(menuBody, charsmax(menuBody), "\dGZH \ySKINS MENU^n^n\rWybierz model \w[ \dDeagle \w]^n\wAktualny skin: \y%s", NazwyDEAGLE[model_deagle[id]])
	new menu = menu_create(menuBody, "deaglemenu")
	
	menu_additem(menu, "\yStandardowy model")
	
	menu_additem(menu, "\wDeagle \d- \yInvisible")
	
	menu_additem(menu, "\wDeagle \d- \yLimitedBlack")
	
	menu_additem(menu, "\wDeagle \d- \yLimitedGold")
	
	menu_additem(menu, "\wDeagle \d- \yFutrick")
	
	menu_additem(menu, "\wDeagle \d- \yXperient")

	menu_additem(menu, "\wDeagle \d- \yFireBlack")

        
        menu_setprop(menu, MPROP_BACKNAME, "Back");
	menu_setprop(menu, MPROP_NEXTNAME, "Next");
	menu_setprop(menu, MPROP_EXITNAME, "Exit in menu");

	menu_display(id, menu);

        return PLUGIN_HANDLED;
}

public deaglemenu(id, menu, item) {
    menu_destroy(iMenu);

    if(item == MENU_EXIT) {
        if(is_user_connected(id))
            menuWyboru(id);
        
        return PLUGIN_HANDLED;
    }

    client_cmd(id, "spk plats/elevbell1.wav");
    SetDEAGLE(id,item);

    switch(item)
    {
        case 0: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4Deagle ^1na: ^3Standardowy model")
        case 1: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4Deagle ^1na: ^3Invisible")
        case 2: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4Deagle ^1na: ^3LimitedBlack")
        case 3: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4Deagle ^1na: ^3LimitedGold")
        case 4: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4Deagle ^1na: ^3Futrick")
        case 5: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4Deagle ^1na: ^3Xperient")
        case 6: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4Deagle ^1na: ^3FireBlack")
    }

    ZapiszDEAGLE(id);
    menu_deagle(id);
    
    return PLUGIN_HANDLED;
}

public SetDEAGLE(id , DEAGLE) {
	model_deagle[id] = DEAGLE
	
	new Clip, Ammo, Weapon = get_user_weapon(id, Clip, Ammo) 
	if ( Weapon != CSW_DEAGLE )
	return PLUGIN_HANDLED
	
	new vModel[56]
	
	switch(DEAGLE)
	{
	case 0: {
			format(vModel,55,"models/v_m4a1.mdl")
		}
	case 1: {
			format(vModel,55,"models/mendolivo/deagle/1_Invisible.mdl")
		}
	case 2: {
			format(vModel,55,"models/mendolivo/deagle/2_LimitedBlack.mdl")
		}
	case 3: {
			format(vModel,55,"models/mendolivo/deagle/3_LimitedGold.mdl")
		}
	case 4: {
			format(vModel,55,"models/mendolivo/deagle/4_Futrick.mdl")
		}
	case 5: {
			format(vModel,55,"models/mendolivo/deagle/5_Xperient.mdl")
		}
	case 6: {
			format(vModel,55,"models/mendolivo/deagle/6_FireBlack.mdl")
		}
        } 
	
	entity_set_string(id, EV_SZ_viewmodel, vModel)
	
	return PLUGIN_HANDLED;  
}

public CurWeapon(id)
{
	if(!is_user_alive(id))
		return PLUGIN_HANDLED;
	

	SetM4A1(id, model_m4[id])
	SetAK47(id, model_ak[id])
        SetAWP(id, model_awp[id])
	SetKNIFE(id, model_knife[id])
        SetDEAGLE(id, model_deagle[id])
        
        return PLUGIN_HANDLED   

}

public client_authorized(id)
{
	ZaladujM4(id)
	ZaladujAK(id)
        ZaladujAWP(id)
        ZaladujKNIFE(id)
        ZaladujDEAGLE(id)
}


ZapiszM4(id)
{ 
	
	new authid[32]
	get_user_authid(id, authid, 31)
	
	new vaultkey[64]
	new vaultdata[64]
	
	format(vaultkey, 63, "M4A1_%s", authid)
	format(vaultdata, 63, "%d", model_m4[id])
	set_vaultdata(vaultkey, vaultdata)
}

ZaladujM4(id) 
{ 
	new authid[32] 
	get_user_authid(id,authid,31)
	
	new vaultkey[64], vaultdata[64]
	
	format(vaultkey, 63, "M4A1_%s", authid)
	get_vaultdata(vaultkey, vaultdata, 63)
	model_m4[id] = str_to_num(vaultdata)
	
}

ZapiszAK(id)
{ 
	
	new authid[32]
	get_user_authid(id, authid, 31)
	
	new vaultkey[64]
	new vaultdata[64]
	
	format(vaultkey, 63, "AK47_%s", authid)
	format(vaultdata, 63, "%d", model_ak[id])
	set_vaultdata(vaultkey, vaultdata)
}

ZaladujAK(id) 
{ 
	new authid[32] 
	get_user_authid(id,authid,31)
	
	new vaultkey[64], vaultdata[64]
	
	format(vaultkey, 63, "AK47_%s", authid)
	get_vaultdata(vaultkey, vaultdata, 63)
	model_ak[id] = str_to_num(vaultdata)
	
}

ZapiszAWP(id)
{ 
	
	new authid[32]
	get_user_authid(id, authid, 31)
	
	new vaultkey[64]
	new vaultdata[64]
	
	format(vaultkey, 63, "AWP_%s", authid)
	format(vaultdata, 63, "%d", model_awp[id])
	set_vaultdata(vaultkey, vaultdata)
}

ZaladujAWP(id) 
{ 
	new authid[32] 
	get_user_authid(id,authid,31)
	
	new vaultkey[64], vaultdata[64]
	
	format(vaultkey, 63, "AWP_%s", authid)
	get_vaultdata(vaultkey, vaultdata, 63)
	model_awp[id] = str_to_num(vaultdata)
	
}

ZapiszKNIFE(id)
{ 
	
	new authid[32]
	get_user_authid(id, authid, 31)
	
	new vaultkey[64]
	new vaultdata[64]
	
	format(vaultkey, 63, "KNIFE_%s", authid)
	format(vaultdata, 63, "%d", model_knife[id])
	set_vaultdata(vaultkey, vaultdata)
}

ZaladujKNIFE(id) 
{ 
	new authid[32] 
	get_user_authid(id,authid,31)
	
	new vaultkey[64], vaultdata[64]
	
	format(vaultkey, 63, "KNIFE_%s", authid)
	get_vaultdata(vaultkey, vaultdata, 63)
	model_knife[id] = str_to_num(vaultdata)
	
}

ZapiszDEAGLE(id)
{ 
	
	new authid[32]
	get_user_authid(id, authid, 31)
	
	new vaultkey[64]
	new vaultdata[64]
	
	format(vaultkey, 63, "DEAGLE_%s", authid)
	format(vaultdata, 63, "%d", model_deagle[id])
	set_vaultdata(vaultkey, vaultdata)
}

ZaladujDEAGLE(id) 
{ 
	new authid[32] 
	get_user_authid(id,authid,31)
	
	new vaultkey[64], vaultdata[64]
	
	format(vaultkey, 63, "DEAGLE_%s", authid)
	get_vaultdata(vaultkey, vaultdata, 63)
	model_deagle[id] = str_to_num(vaultdata)
	
}
 
Сообщения
397
Реакции
221
Помог
13 раз(а)
pmadisson75,

Код:
#include <amxmodx>
#include <amxmisc>
#include <engine> 
#include <vault>
#include <fun>
new model_m4[33]
new model_ak[33]
new model_awp[33]
new model_knife[33]
new model_deagle[33]
new NazwyM4A1[][] = {"Standardowy", "Invisible", "LimitedBlack", "LimitedGold", "Molerdo", "Teradino", "DevillSkull"}
new NazwyAK47[][] = {"Standardowy", "Invisible", "LimitedBlack", "LimitedGold", "Strike", "Sepia", "Limonero"}
new NazwyAWP[][] = {"Standardowy", "Invisible", "Black", "Tiger", "Jungle", "Volcano", "Teranivo"}
new NazwyKNIFE[][] = {"Standardowy", "Invisible", "Blood", "Bevasto", "FineGold", "Joker1", "Joker2"}
new NazwyDEAGLE[][] = {"Standardowy", "Invisible", "LimitedBlack", "LimitedGold", "Futrick", "Xperient", "FireBlack"}
public plugin_init() { 
    
    register_event("CurWeapon","CurWeapon","be","1=1") 
    register_clcmd("say /skiny", "menuWyboru")
    register_clcmd("say /skin", "menuWyboru")
    register_clcmd("say /skins", "menuWyboru")
    register_clcmd("say /modele", "menuWyboru")
    register_clcmd("say /model", "menuWyboru")
    register_clcmd("say /models", "menuWyboru")
    
}
public plugin_precache() { 
    precache_model("models/mendolivo/m4a1/1_Invisible.mdl")
    precache_model("models/mendolivo/m4a1/2_LimitedBlack.mdl")
    precache_model("models/mendolivo/m4a1/3_LimitedGold.mdl")
        precache_model("models/mendolivo/m4a1/4_Molerdo.mdl")
    precache_model("models/mendolivo/m4a1/5_Teradino.mdl")
    precache_model("models/mendolivo/m4a1/6_DevillSkull.mdl")
        
    precache_model("models/mendolivo/ak47/1_Invisible.mdl")
    precache_model("models/mendolivo/ak47/2_LimitedBlack.mdl")
    precache_model("models/mendolivo/ak47/3_LimitedGold.mdl")
    precache_model("models/mendolivo/ak47/4_Strike.mdl")
    precache_model("models/mendolivo/ak47/5_Sepia.mdl")
        precache_model("models/mendolivo/ak47/6_Limonero.mdl")
        
        precache_model("models/mendolivo/awp/1_Invisible.mdl")
    precache_model("models/mendolivo/awp/2_Black.mdl")
    precache_model("models/mendolivo/awp/3_Tiger.mdl")
    precache_model("models/mendolivo/awp/4_Jungle.mdl")
    precache_model("models/mendolivo/awp/5_Volcano.mdl")
        precache_model("models/mendolivo/awp/6_Teranivo.mdl")
        
        precache_model("models/mendolivo/knife/1_Invisible.mdl")
    precache_model("models/mendolivo/knife/2_Blood.mdl")
    precache_model("models/mendolivo/knife/3_Bevasto.mdl")
        precache_model("models/mendolivo/knife/4_FineGold.mdl")
        precache_model("models/mendolivo/knife/5_Joker1.mdl")
        precache_model("models/mendolivo/knife/6_Joker2.mdl")
        
        precache_model("models/mendolivo/deagle/1_Invisible.mdl")
    precache_model("models/mendolivo/deagle/2_LimitedBlack.mdl")
    precache_model("models/mendolivo/deagle/3_LimitedGold.mdl")
    precache_model("models/mendolivo/deagle/4_Futrick.mdl")
    precache_model("models/mendolivo/deagle/5_Xperient.mdl")
        precache_model("models/mendolivo/deagle/6_FireBlack.mdl")
} 
public menuWyboru(id)
{
    new menuBody[512]
    formatex(menuBody, charsmax(menuBody), "\dGZH \ySKINS MENU^n^n\rKtory model chcesz zmienic?")
    new menu = menu_create(menuBody, "skinsmenu")
    menu_additem(menu, "\wZmieniam model \yM4A1 \d(6)")
    menu_additem(menu, "\wZmieniam model \yAK-47 \d(6)")
    menu_additem(menu, "\wZmieniam model \yAWP \d(6)")
        menu_additem(menu, "\wZmieniam model \yKnife \d(6)")
        menu_additem(menu, "\wZmieniam model \yDeagle \d(6)")
    
    
        menu_setprop(menu, MPROP_BACKNAME, "Cofnij");
    menu_setprop(menu, MPROP_NEXTNAME, "Dalej");
    menu_setprop(menu, MPROP_EXITNAME, "Wyjdz");
    menu_display(id, menu);
}
public skinsmenu(id, menu, item) {
    if(item == MENU_EXIT)
    {
        menu_destroy(menu);
        return PLUGIN_HANDLED;
    }
    
    switch(item) 
    {
        case 0: menu_m4(id)
        case 1: menu_ak(id)
        case 2: menu_awp(id)
                case 3: menu_knife(id)
                case 4: menu_deagle(id)
                default: return PLUGIN_HANDLED
    }
    return PLUGIN_HANDLED
} 
public menu_m4(id) {
    new menuBody[512]
    formatex(menuBody, charsmax(menuBody), "\dGZH \ySKINS MENU^n^n\rWybierz model \w[ \dM4A1 \w]^n\wAktualny skin: \y%s", NazwyM4A1[model_m4[id]])
    new menu = menu_create(menuBody, "m4menu")
    
    menu_additem(menu, "\yStandardowy model")
    
    menu_additem(menu, "\wM4A1 \d- \yInvisible")
    
    menu_additem(menu, "\wM4A1 \d- \yLimitedBlack")
    
    menu_additem(menu, "\wM4A1 \d- \yLimitedGold")
    
    menu_additem(menu, "\wM4A1 \d- \yMolerdo")
    
    menu_additem(menu, "\wM4A1 \d- \yTeradino")
    menu_additem(menu, "\wM4A1 \d- \yDevillSkull")
        
        menu_setprop(menu, MPROP_BACKNAME, "Back");
    menu_setprop(menu, MPROP_NEXTNAME, "Next");
    menu_setprop(menu, MPROP_EXITNAME, "Exit in menu");
    menu_display(id, menu);
        return PLUGIN_HANDLED;
}
public m4menu(id, menu, item) {
    menu_destroy(menu);
    if(item == MENU_EXIT) {
        if(is_user_connected(id))
            menuWyboru(id);
        
        return PLUGIN_HANDLED;
    }
    client_cmd(id, "spk plats/elevbell1.wav");
    SetM4A1(id,item);
    switch(item)
    {
        case 0: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4M4A1 ^1na: ^3Standardowy model")
        case 1: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4M4A1 ^1na: ^3Invisible")
        case 2: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4M4A1 ^1na: ^3LimitedBlack")
        case 3: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4M4A1 ^1na: ^3LimitedGold")
        case 4: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4M4A1 ^1na: ^3Molerdo")
        case 5: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4M4A1 ^1na: ^3Teradino")
        case 6: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4M4A1 ^1na: ^3DevillSkull")
    }
    ZapiszM4(id);
    menu_m4(id);
    
    return PLUGIN_HANDLED;
}
public SetM4A1(id , M4A1) {
    model_m4[id] = M4A1
    
    new Clip, Ammo, Weapon = get_user_weapon(id, Clip, Ammo) 
    if ( Weapon != CSW_M4A1 )
    return PLUGIN_HANDLED
    
    new vModel[56]
    
    switch(M4A1)
    {
    case 0: {
            format(vModel,55,"models/v_m4a1.mdl")
        }
    case 1: {
            format(vModel,55,"models/mendolivo/m4a1/1_Invisible.mdl")
        }
    case 2: {
            format(vModel,55,"models/mendolivo/m4a1/2_LimitedBlack.mdl")
        }
    case 3: {
            format(vModel,55,"models/mendolivo/m4a1/3_LimitedGold.mdl")
        }
    case 4: {
            format(vModel,55,"models/mendolivo/m4a1/4_Molerdo.mdl")
        }
    case 5: {
            format(vModel,55,"models/mendolivo/m4a1/5_Teradino.mdl")
        }
    case 6: {
            format(vModel,55,"models/mendolivo/m4a1/6_DevillSkull.mdl")
        }
        } 
    
    entity_set_string(id, EV_SZ_viewmodel, vModel)
    
    return PLUGIN_HANDLED;  
}
public menu_ak(id) {
    new menuBody[512]
    formatex(menuBody, charsmax(menuBody), "\dGZH \ySKINS MENU^n^n\rWybierz model \w[ \dAK-47 \w]^n\wAktualny skin: \y%s", NazwyAK47[model_ak[id]])
    new menu = menu_create(menuBody, "akmenu")
    
    menu_additem(menu, "\yStandardowy model")
    
    menu_additem(menu, "\wAK-47 \d- \yInvisible")
    
    menu_additem(menu, "\wAK-47 \d- \yLimitedBlack")
    
    menu_additem(menu, "\wAK-47 \d- \yLimitedGold")
    
    menu_additem(menu, "\wAK-47 \d- \yStrike")
    
    menu_additem(menu, "\wAK-47 \d- \ySepia")
    menu_additem(menu, "\wAK-47 \d- \yLimonero")
        
        menu_setprop(menu, MPROP_BACKNAME, "Back");
    menu_setprop(menu, MPROP_NEXTNAME, "Next");
    menu_setprop(menu, MPROP_EXITNAME, "Exit in menu");
    menu_display(id, menu);
        return PLUGIN_HANDLED;
}
public akmenu(id, menu, item) {
    menu_destroy(menu);
    if(item == MENU_EXIT) {
        if(is_user_connected(id))
            menuWyboru(id);
        
        return PLUGIN_HANDLED;
    }
    client_cmd(id, "spk plats/elevbell1.wav");
    SetAK47(id,item);
    switch(item)
    {
        case 0: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4AK-47 ^1na: ^3Standardowy model")
        case 1: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4AK-47 ^1na: ^3Invisible")
        case 2: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4AK-47 ^1na: ^3LimitedBlack")
        case 3: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4AK-47 ^1na: ^3LimitedGold")
        case 4: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4AK-47 ^1na: ^3Strike")
        case 5: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4AK-47 ^1na: ^3Sepia")
        case 6: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4AK-47 ^1na: ^3Limonero")
    }
    ZapiszAK(id);
    menu_ak(id);
    
    return PLUGIN_HANDLED;
}
public SetAK47(id , AK47) {
    model_ak[id] = AK47
    
    new Clip, Ammo, Weapon = get_user_weapon(id, Clip, Ammo) 
    if ( Weapon != CSW_AK47 )
    return PLUGIN_HANDLED
    
    new vModel[56]
    
    switch(AK47)
    {
    case 0: {
            format(vModel,55,"models/v_ak47.mdl")
        }
    case 1: {
            format(vModel,55,"models/mendolivo/ak47/1_Invisible.mdl")
        }
    case 2: {
            format(vModel,55,"models/mendolivo/ak47/2_LimitedBlack.mdl")
        }
    case 3: {
            format(vModel,55,"models/mendolivo/ak47/3_LimitedGold.mdl")
        }
    case 4: {
            format(vModel,55,"models/mendolivo/ak47/4_Strike.mdl")
        }
    case 5: {
            format(vModel,55,"models/mendolivo/ak47/5_Sepia.mdl")
        }
    case 6: {
            format(vModel,55,"models/mendolivo/ak47/6_Limonero.mdl")
        }
        } 
    
    entity_set_string(id, EV_SZ_viewmodel, vModel)
    
    return PLUGIN_HANDLED;  
}
public menu_awp(id) {
    new menuBody[512]
    formatex(menuBody, charsmax(menuBody), "\dGZH \ySKINS MENU^n^n\rWybierz model \w[ \dAWP \w]^n\wAktualny skin: \y%s", NazwyAWP[model_awp[id]])
    new menu = menu_create(menuBody, "awpmenu")
    
    menu_additem(menu, "\yStandardowy model")
    
    menu_additem(menu, "\wAWP \d- \yInvisible")
    
    menu_additem(menu, "\wAWP \d- \yBlack")
    
    menu_additem(menu, "\wAWP \d- \yTiger")
    
    menu_additem(menu, "\wAWP \d- \yJungle")
    
    menu_additem(menu, "\wAWP \d- \yVolcano")
    menu_additem(menu, "\wAWP \d- \yTeranivo")
        
        menu_setprop(menu, MPROP_BACKNAME, "Back");
    menu_setprop(menu, MPROP_NEXTNAME, "Next");
    menu_setprop(menu, MPROP_EXITNAME, "Exit in menu");
    menu_display(id, menu);
        return PLUGIN_HANDLED;
}
public awpmenu(id, menu, item) {
    menu_destroy(menu);
    if(item == MENU_EXIT) {
        if(is_user_connected(id))
            menuWyboru(id);
        
        return PLUGIN_HANDLED;
    }
    client_cmd(id, "spk plats/elevbell1.wav");
    SetAWP(id,item);
    switch(item)
    {
        case 0: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4AWP ^1na: ^3Standardowy model")
        case 1: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4AWP ^1na: ^3Invisible")
        case 2: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4AWP ^1na: ^3Black")
        case 3: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4AWP ^1na: ^3Tiger")
        case 4: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4AWP ^1na: ^3Jungle")
        case 5: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4AWP ^1na: ^3Volcano")
        case 6: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4AWP ^1na: ^3Teranivo")
    }
    ZapiszAWP(id);
    menu_awp(id);
    
    return PLUGIN_HANDLED;
}
public SetAWP(id , AWP) {
    model_awp[id] = AWP
    
    new Clip, Ammo, Weapon = get_user_weapon(id, Clip, Ammo) 
    if ( Weapon != CSW_AWP )
    return PLUGIN_HANDLED
    
    new vModel[56]
    
    switch(AWP)
    {
    case 0: {
            format(vModel,55,"models/v_awp.mdl")
        }
    case 1: {
            format(vModel,55,"models/mendolivo/awp/1_Invisible.mdl")
        }
    case 2: {
            format(vModel,55,"models/mendolivo/awp/2_Black.mdl")
        }
    case 3: {
            format(vModel,55,"models/mendolivo/awp/3_Tiger.mdl")
        }
    case 4: {
            format(vModel,55,"models/mendolivo/awp/4_Jungle.mdl")
        }
    case 5: {
            format(vModel,55,"models/mendolivo/awp/5_Volcano.mdl")
        }
    case 6: {
            format(vModel,55,"models/mendolivo/awp/6_Teranivo.mdl")
        }
        } 
    
    entity_set_string(id, EV_SZ_viewmodel, vModel)
    
    return PLUGIN_HANDLED;  
}
public menu_knife(id) {
    new menuBody[512]
    formatex(menuBody, charsmax(menuBody), "\dGZH \ySKINS MENU^n^n\rWybierz model \w[ \dKnife \w]^n\wAktualny skin: \y%s", NazwyKNIFE[model_knife[id]])
    new menu = menu_create(menuBody, "knifemenu")
    
    menu_additem(menu, "\yStandardowy model")
    
    menu_additem(menu, "\wKnife \d- \yInvisible")
    
    menu_additem(menu, "\wKnife \d- \yBlood")
    
    menu_additem(menu, "\wKnife \d- \yBevasto")
    
    menu_additem(menu, "\wKnife \d- \yFineGold")
    
    menu_additem(menu, "\wKnife \d- \yJoker1")
    menu_additem(menu, "\wKnife \d- \yJoker2")
        
        menu_setprop(menu, MPROP_BACKNAME, "Back");
    menu_setprop(menu, MPROP_NEXTNAME, "Next");
    menu_setprop(menu, MPROP_EXITNAME, "Exit in menu");
    menu_display(id, menu);
        return PLUGIN_HANDLED;
}
public knifemenu(id, menu, item) {
    menu_destroy(menu);
    if(item == MENU_EXIT) {
        if(is_user_connected(id))
            menuWyboru(id);
        
        return PLUGIN_HANDLED;
    }
    client_cmd(id, "spk plats/elevbell1.wav");
    SetKNIFE(id,item);
    switch(item)
    {
        case 0: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4Knife ^1na: ^3Standardowy model")
        case 1: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4Knife ^1na: ^3Invisible")
        case 2: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4Knife ^1na: ^3Blood")
        case 3: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4Knife ^1na: ^3Bevasto")
        case 4: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4Knife ^1na: ^3FineGold")
        case 5: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4Knife ^1na: ^3Joker1")
        case 6: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4Knife ^1na: ^3Joker2")
    }
    ZapiszKNIFE(id);
    menu_knife(id);
    
    return PLUGIN_HANDLED;
}
public SetKNIFE(id , KNIFE) {
    model_knife[id] = KNIFE
    
    new Clip, Ammo, Weapon = get_user_weapon(id, Clip, Ammo) 
    if ( Weapon != CSW_KNIFE )
    return PLUGIN_HANDLED
    
    new vModel[56]
    
    switch(KNIFE)
    {
    case 0: {
            format(vModel,55,"models/v_knife.mdl")
        }
    case 1: {
            format(vModel,55,"models/mendolivo/knife/1_Invisible.mdl")
        }
    case 2: {
            format(vModel,55,"models/mendolivo/knife/2_Blood.mdl")
        }
    case 3: {
            format(vModel,55,"models/mendolivo/knife/3_Bevasto.mdl")
        }
    case 4: {
            format(vModel,55,"models/mendolivo/knife/4_FineGold.mdl")
        }
    case 5: {
            format(vModel,55,"models/mendolivo/knife/5_Joker1.mdl")
        }
    case 6: {
            format(vModel,55,"models/mendolivo/knife/6_Joker2.mdl")
        }
        } 
    
    entity_set_string(id, EV_SZ_viewmodel, vModel)
    
    return PLUGIN_HANDLED;  
}
public menu_deagle(id) {
    new menuBody[512]
    formatex(menuBody, charsmax(menuBody), "\dGZH \ySKINS MENU^n^n\rWybierz model \w[ \dDeagle \w]^n\wAktualny skin: \y%s", NazwyDEAGLE[model_deagle[id]])
    new menu = menu_create(menuBody, "deaglemenu")
    
    menu_additem(menu, "\yStandardowy model")
    
    menu_additem(menu, "\wDeagle \d- \yInvisible")
    
    menu_additem(menu, "\wDeagle \d- \yLimitedBlack")
    
    menu_additem(menu, "\wDeagle \d- \yLimitedGold")
    
    menu_additem(menu, "\wDeagle \d- \yFutrick")
    
    menu_additem(menu, "\wDeagle \d- \yXperient")
    menu_additem(menu, "\wDeagle \d- \yFireBlack")
        
        menu_setprop(menu, MPROP_BACKNAME, "Back");
    menu_setprop(menu, MPROP_NEXTNAME, "Next");
    menu_setprop(menu, MPROP_EXITNAME, "Exit in menu");
    menu_display(id, menu);
        return PLUGIN_HANDLED;
}
public deaglemenu(id, menu, item) {
    menu_destroy(menu);
    if(item == MENU_EXIT) {
        if(is_user_connected(id))
            menuWyboru(id);
        
        return PLUGIN_HANDLED;
    }
    client_cmd(id, "spk plats/elevbell1.wav");
    SetDEAGLE(id,item);
    switch(item)
    {
        case 0: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4Deagle ^1na: ^3Standardowy model")
        case 1: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4Deagle ^1na: ^3Invisible")
        case 2: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4Deagle ^1na: ^3LimitedBlack")
        case 3: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4Deagle ^1na: ^3LimitedGold")
        case 4: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4Deagle ^1na: ^3Futrick")
        case 5: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4Deagle ^1na: ^3Xperient")
        case 6: client_print_color(id, print_team_default, "^1[^4GZH SKINS^1] Zmieniles model broni ^4Deagle ^1na: ^3FireBlack")
    }
    ZapiszDEAGLE(id);
    menu_deagle(id);
    
    return PLUGIN_HANDLED;
}
public SetDEAGLE(id , DEAGLE) {
    model_deagle[id] = DEAGLE
    
    new Clip, Ammo, Weapon = get_user_weapon(id, Clip, Ammo) 
    if ( Weapon != CSW_DEAGLE )
    return PLUGIN_HANDLED
    
    new vModel[56]
    
    switch(DEAGLE)
    {
    case 0: {
            format(vModel,55,"models/v_m4a1.mdl")
        }
    case 1: {
            format(vModel,55,"models/mendolivo/deagle/1_Invisible.mdl")
        }
    case 2: {
            format(vModel,55,"models/mendolivo/deagle/2_LimitedBlack.mdl")
        }
    case 3: {
            format(vModel,55,"models/mendolivo/deagle/3_LimitedGold.mdl")
        }
    case 4: {
            format(vModel,55,"models/mendolivo/deagle/4_Futrick.mdl")
        }
    case 5: {
            format(vModel,55,"models/mendolivo/deagle/5_Xperient.mdl")
        }
    case 6: {
            format(vModel,55,"models/mendolivo/deagle/6_FireBlack.mdl")
        }
        } 
    
    entity_set_string(id, EV_SZ_viewmodel, vModel)
    
    return PLUGIN_HANDLED;  
}
public CurWeapon(id)
{
    if(!is_user_alive(id))
        return PLUGIN_HANDLED;
    
    SetM4A1(id, model_m4[id])
    SetAK47(id, model_ak[id])
        SetAWP(id, model_awp[id])
    SetKNIFE(id, model_knife[id])
        SetDEAGLE(id, model_deagle[id])
        
        return PLUGIN_HANDLED   
}
public client_authorized(id)
{
    ZaladujM4(id)
    ZaladujAK(id)
        ZaladujAWP(id)
        ZaladujKNIFE(id)
        ZaladujDEAGLE(id)
}

ZapiszM4(id)
{ 
    
    new authid[32]
    get_user_authid(id, authid, 31)
    
    new vaultkey[64]
    new vaultdata[64]
    
    format(vaultkey, 63, "M4A1_%s", authid)
    format(vaultdata, 63, "%d", model_m4[id])
    set_vaultdata(vaultkey, vaultdata)
}
ZaladujM4(id) 
{ 
    new authid[32] 
    get_user_authid(id,authid,31)
    
    new vaultkey[64], vaultdata[64]
    
    format(vaultkey, 63, "M4A1_%s", authid)
    get_vaultdata(vaultkey, vaultdata, 63)
    model_m4[id] = str_to_num(vaultdata)
    
}
ZapiszAK(id)
{ 
    
    new authid[32]
    get_user_authid(id, authid, 31)
    
    new vaultkey[64]
    new vaultdata[64]
    
    format(vaultkey, 63, "AK47_%s", authid)
    format(vaultdata, 63, "%d", model_ak[id])
    set_vaultdata(vaultkey, vaultdata)
}
ZaladujAK(id) 
{ 
    new authid[32] 
    get_user_authid(id,authid,31)
    
    new vaultkey[64], vaultdata[64]
    
    format(vaultkey, 63, "AK47_%s", authid)
    get_vaultdata(vaultkey, vaultdata, 63)
    model_ak[id] = str_to_num(vaultdata)
    
}
ZapiszAWP(id)
{ 
    
    new authid[32]
    get_user_authid(id, authid, 31)
    
    new vaultkey[64]
    new vaultdata[64]
    
    format(vaultkey, 63, "AWP_%s", authid)
    format(vaultdata, 63, "%d", model_awp[id])
    set_vaultdata(vaultkey, vaultdata)
}
ZaladujAWP(id) 
{ 
    new authid[32] 
    get_user_authid(id,authid,31)
    
    new vaultkey[64], vaultdata[64]
    
    format(vaultkey, 63, "AWP_%s", authid)
    get_vaultdata(vaultkey, vaultdata, 63)
    model_awp[id] = str_to_num(vaultdata)
    
}
ZapiszKNIFE(id)
{ 
    
    new authid[32]
    get_user_authid(id, authid, 31)
    
    new vaultkey[64]
    new vaultdata[64]
    
    format(vaultkey, 63, "KNIFE_%s", authid)
    format(vaultdata, 63, "%d", model_knife[id])
    set_vaultdata(vaultkey, vaultdata)
}
ZaladujKNIFE(id) 
{ 
    new authid[32] 
    get_user_authid(id,authid,31)
    
    new vaultkey[64], vaultdata[64]
    
    format(vaultkey, 63, "KNIFE_%s", authid)
    get_vaultdata(vaultkey, vaultdata, 63)
    model_knife[id] = str_to_num(vaultdata)
    
}
ZapiszDEAGLE(id)
{ 
    
    new authid[32]
    get_user_authid(id, authid, 31)
    
    new vaultkey[64]
    new vaultdata[64]
    
    format(vaultkey, 63, "DEAGLE_%s", authid)
    format(vaultdata, 63, "%d", model_deagle[id])
    set_vaultdata(vaultkey, vaultdata)
}
ZaladujDEAGLE(id) 
{ 
    new authid[32] 
    get_user_authid(id,authid,31)
    
    new vaultkey[64], vaultdata[64]
    
    format(vaultkey, 63, "DEAGLE_%s", authid)
    get_vaultdata(vaultkey, vaultdata, 63)
    model_deagle[id] = str_to_num(vaultdata)
    
}
 

Вложения

  • 21.2 KB Просмотры: 2
Сообщения
272
Реакции
14
It works! <3 Thank you very much for your help, good man. Subject to be closed. :)
 
  • Нравится
Реакции: b0t.
Статус
В этой теме нельзя размещать новые ответы.

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу