Senior Member
|
03-21-2018
, 13:14
Player Skins Pick
|
#1
|
Hello dear friends, i just maked some plugin to my server, vip players can pick model to self, so, can someone help me to make check to player team & save type with steamid?
PHP Code:
#include <amxmodx> #include <fakemeta> #include <cstrike> #include <fun>
public plugin_init() {
register_clcmd("say /vmodels","My_Menu",ADMIN_LEVEL_H,"Menu") } public plugin_precache() { // Change your models here. engfunc(EngFunc_PrecacheModel, "models/player/type1_ct/type1_ct.mdl") engfunc(EngFunc_PrecacheModel, "models/player/type1_t/type1_t.mdl") engfunc(EngFunc_PrecacheModel, "models/player/type2_ct/type2_ct.mdl") engfunc(EngFunc_PrecacheModel, "models/player/type2_t/type2_t.mdl") engfunc(EngFunc_PrecacheModel, "models/player/type3_ct/type3_ct.mdl") engfunc(EngFunc_PrecacheModel, "models/player/type3_t/type3_t.mdl") engfunc(EngFunc_PrecacheModel, "models/player/type4_ct/type4_ct.mdl") engfunc(EngFunc_PrecacheModel, "models/player/type4_t/type4_t.mdl") engfunc(EngFunc_PrecacheModel, "models/player/type5_ct/type5_ct.mdl") engfunc(EngFunc_PrecacheModel, "models/player/type5_t/type5_t.mdl") engfunc(EngFunc_PrecacheModel, "models/player/type2_t/type2_tT.mdl") engfunc(EngFunc_PrecacheModel, "models/player/type3_t/type3_tT.mdl") engfunc(EngFunc_PrecacheModel, "models/player/type4_t/type4_tT.mdl")
} public My_Menu(id) { new i_Menu = menu_create("\rКакую модель хотите?", "menu_handler")
menu_additem(i_Menu, "\wType 1", "1", ADMIN_LEVEL_H) menu_additem(i_Menu, "\wType 2", "2", ADMIN_LEVEL_H) menu_additem(i_Menu, "\wType 3", "3", ADMIN_LEVEL_H) menu_additem(i_Menu, "\wType 4", "4", ADMIN_LEVEL_H) menu_additem(i_Menu, "\wType 5", "5", ADMIN_LEVEL_H) menu_additem(i_Menu, "\wType 6", "6", ADMIN_RCON) menu_additem(i_Menu, "\wType 7", "7", ADMIN_LEVEL_D) menu_setprop(i_Menu, MPROP_EXIT, MEXIT_ALL)
menu_display(id, i_Menu, 0) }
public menu_handler(id, menu, item) { if (item == MENU_EXIT) { menu_destroy(menu) return PLUGIN_HANDLED }
new s_Data[6], s_Name[64], i_Access, i_Callback
menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback)
new i_Key = str_to_num(s_Data)
switch(i_Key) { case 1: /* Item 1*/ { if (get_user_team( id ) == CS_TEAM_T) { cs_set_user_model(id, "type1_t") } if ( get_user_team( id ) == CS_TEAM_CT ) { cs_set_user_model(id, "type1_ct") } client_print(id,print_chat, "You picked #1") } case 2: /* Item 2*/ { if (get_user_team( id ) == CS_TEAM_T) { cs_set_user_model(id, "type2_t") } if ( get_user_team( id ) == CS_TEAM_CT ) { cs_set_user_model(id, "type2_ct") } client_print(id,print_chat, "You picked #2") } case 3:/* Item 3*/ { if (get_user_team( id ) == CS_TEAM_T) { cs_set_user_model(id, "type3_t") } if ( get_user_team( id ) == CS_TEAM_CT ) { cs_set_user_model(id, "type3_ct") } client_print(id,print_chat, "You picked #3") } case 4: /* Item 4*/ { if (get_user_team( id ) == CS_TEAM_T) { cs_set_user_model(id, "type4_t") } if ( get_user_team( id ) == CS_TEAM_CT ) { cs_set_user_model(id, "type4_ct") } client_print(id,print_chat, "You picked #4") } case 5: /* Item 1*/ { if (get_user_team( id ) == CS_TEAM_T) { cs_set_user_model(id, "type5_t") } if ( get_user_team( id ) == CS_TEAM_CT ) { cs_set_user_model(id, "type5_ct") } client_print(id,print_chat, "You picked #5") } case 6: { client_print(id,print_chat, "You picked #6") } case 7: { client_print(id,print_chat, "You picked #7") } } // Destroy menu menu_destroy(menu) return PLUGIN_HANDLED }
code is here, thanks!
Last edited by ghostz0r; 03-21-2018 at 13:15.
|
|