Witam, napisałem dziś plugin na serwer, który umożliwiałby VIP'om wybieranie modeli z menu.
Plugins działa, po wejściu na serwer modele sie pobierają, menu również działa, ale gdy wybiore model nie widać żadnych zmian w modelu postaci (na thirdperson)
Kod pluginu:
#pragma tabsize 0 #include <sourcemod> #include <cstrike> #include <sdkhooks> #include <sdktools> #include <colorvariables> public Plugin:myinfo = { name = "Modele dla VIP'ów", author = "cocojambopl", description = "Dodaje menu modeli dla VIP'ów", version = "1.0", url = "" }; InitPrecache() { PrecacheModel("models/player/custom_player/legacy/santa/santa.mdl"); PrecacheModel("models/player/custom_player/voikanaa/rayman.mdl"); PrecacheModel("models/player/custom_player/kodua/re/eliminator/eelo.mdl"); PrecacheModel("models/player/kodua/hellknight_zds/hellknight_zds.mdl"); AddFileToDownloadsTable("models/player/custom_player/legacy/santa/santa.mdl"); AddFileToDownloadsTable("models/player/custom_player/legacy/santa/santa.dx90.vtx"); AddFileToDownloadsTable("models/player/custom_player/legacy/santa/santa.phy"); AddFileToDownloadsTable("models/player/custom_player/legacy/santa/santa.vvd"); AddFileToDownloadsTable("materials/models/player/custom/santa/Santa_Dif_01.vmt"); AddFileToDownloadsTable("materials/models/player/custom/santa/Santa_Dif_01.vtf"); AddFileToDownloadsTable("materials/models/player/custom/santa/Santa_Nor_01.vtf"); AddFileToDownloadsTable("models/player/custom_player/voikanaa/rayman.mdl"); AddFileToDownloadsTable("models/player/custom_player/voikanaa/rayman.phy"); AddFileToDownloadsTable("models/player/custom_player/voikanaa/rayman.vvd"); AddFileToDownloadsTable("models/player/custom_player/voikanaa/rayman.dx90.vtx"); AddFileToDownloadsTable("materials/models/player/voikanaa/rayman/rayman_sheet.vtf"); AddFileToDownloadsTable("materials/models/player/voikanaa/rayman/rayman_sheet_bump.vtf"); AddFileToDownloadsTable("materials/models/player/voikanaa/rayman/rayman_sheet.vmt"); AddFileToDownloadsTable("models/player/custom_player/kodua/re/eliminator/eelo.mdl"); AddFileToDownloadsTable("models/player/custom_player/kodua/re/eliminator/eelo.phy"); AddFileToDownloadsTable("models/player/custom_player/kodua/re/eliminator/eelo.vvd"); AddFileToDownloadsTable("models/player/custom_player/kodua/re/eliminator/eelo.dx90.vtx"); AddFileToDownloadsTable("materials/models/player/custom_player/kodua/re/eliminator/em3900.vmt"); AddFileToDownloadsTable("materials/models/player/custom_player/kodua/re/eliminator/em3900.vtf"); AddFileToDownloadsTable("materials/models/player/custom_player/kodua/re/eliminator/em3900_i.vtf"); AddFileToDownloadsTable("materials/models/player/custom_player/kodua/re/eliminator/em3901.vmt"); AddFileToDownloadsTable("materials/models/player/custom_player/kodua/re/eliminator/em3901.vtf"); AddFileToDownloadsTable("materials/models/player/custom_player/kodua/re/eliminator/em3901_i.vtf"); AddFileToDownloadsTable("materials/models/player/custom_player/kodua/re/eliminator/em3902.vmt"); AddFileToDownloadsTable("materials/models/player/custom_player/kodua/re/eliminator/em3902.vtf"); AddFileToDownloadsTable("materials/models/player/custom_player/kodua/re/eliminator/em3903.vmt"); AddFileToDownloadsTable("materials/models/player/custom_player/kodua/re/eliminator/em3903.vtf"); AddFileToDownloadsTable("materials/models/player/custom_player/kodua/re/eliminator/em3904.vmt"); AddFileToDownloadsTable("materials/models/player/custom_player/kodua/re/eliminator/em3904.vtf"); AddFileToDownloadsTable("materials/models/player/custom_player/kodua/re/eliminator/em3904_i.vtf"); AddFileToDownloadsTable("materials/models/player/custom_player/kodua/re/eliminator/em3905.vmt"); AddFileToDownloadsTable("materials/models/player/custom_player/kodua/re/eliminator/em3905.vtf"); AddFileToDownloadsTable("models/player/kodua/hellknight_zds/hellknight_zds.dx90.vtx"); AddFileToDownloadsTable("models/player/kodua/hellknight_zds/hellknight_zds.mdl"); AddFileToDownloadsTable("models/player/kodua/hellknight_zds/hellknight_zds.phy"); AddFileToDownloadsTable("models/player/kodua/hellknight_zds/hellknight_zds.vvd"); AddFileToDownloadsTable("materials/models/player/kodua/hellknight_zds/Estuche.vmt"); AddFileToDownloadsTable("materials/models/player/kodua/hellknight_zds/Estuche.vtf"); AddFileToDownloadsTable("materials/models/player/kodua/hellknight_zds/hellknight.vmt"); AddFileToDownloadsTable("materials/models/player/kodua/hellknight_zds/hellknight.vtf"); AddFileToDownloadsTable("materials/models/player/kodua/hellknight_zds/hellknight_Normal.vtf"); AddFileToDownloadsTable("materials/models/player/kodua/hellknight_zds/blood.vmt"); AddFileToDownloadsTable("materials/models/player/kodua/hellknight_zds/blood.vtf"); AddFileToDownloadsTable("models/player/kodua/hellknight_zds_hs/hellknight_zds_hs.dx90.vtx"); AddFileToDownloadsTable("models/player/kodua/hellknight_zds_hs/hellknight_zds_hs.mdl"); AddFileToDownloadsTable("models/player/kodua/hellknight_zds_hs/hellknight_zds_hs.phy"); AddFileToDownloadsTable("models/player/kodua/hellknight_zds_hs/hellknight_zds_hs.vvd"); AddFileToDownloadsTable("models/props/kodua/hellknight_zds_head/hellknight_zds_head.dx90.vtx"); AddFileToDownloadsTable("models/props/kodua/hellknight_zds_head/hellknight_zds_head.mdl"); AddFileToDownloadsTable("models/props/kodua/hellknight_zds_head/hellknight_zds_head.phy"); AddFileToDownloadsTable("models/props/kodua/hellknight_zds_head/hellknight_zds_head.vvd"); } public OnMapStart() { RegConsoleCmd("sm_model", ModelMenu); InitPrecache(); } public Action:ModelMenu(client, args) { new Handle:menu = CreateMenu(MenuModel, MenuAction_Select | MenuAction_End) SetMenuTitle(menu, "Modele dla VIP'ów"); AddMenuItem(menu, "malpa", "Małpa"); AddMenuItem(menu, "mikolaj", "Święty Mikołaj"); AddMenuItem(menu, "h3llknight", "Hellknight"); AddMenuItem(menu, "rayman", "Rayman"); if(GetUserFlagBits(client) & ADMFLAG_CUSTOM6) { DisplayMenu(menu, client, 20); } else { CPrintToChat(client, " [{blue}MO{red}DE{green}LE{default}] {grey}Ta komenda jest tylko dla VIP'ów!"); } } public MenuModel(Handle:menu, MenuAction:action, param1, param2) { new client = GetClientOfUserId(GetEventInt(menu, "userid")); switch (action) { case MenuAction_Select: { new String:item[64]; GetMenuItem(menu, param2, item, sizeof(item)); if (StrEqual(item, "malpa")) { SetEntityModel(client, "models/player/custom_player/kodua/re/eliminator/eelo.mdl"); } else if (StrEqual(item, "mikolaj")) { SetEntityModel(client, "models/player/custom_player/legacy/santa/santa.mdl"); } else if (StrEqual(item, "h3llknight")) { SetEntityModel(client, "models/player/kodua/hellknight_zds/hellknight_zds.mdl"); } else if (StrEqual(item, "rayman")) { SetEntityModel(client, "models/player/custom_player/voikanaa/rayman.mdl"); } } case MenuAction_End: { CloseHandle(menu); } } }
Prosiłbym o pomoc! Pozdrawiam i życzę miłego dnia
Użytkownik cocojambopl edytował ten post 27.06.2016 19:21