- #include <minigames_Manager>
- #include <cstrike>
- #include <sdktools>
- #include <clientprefs>
- // ================================= Preprocesor ==================================
- #define MOD_TAG "\x01\x0B\x0E★ \x07[PGC24.PL -> Modele]\x06 "
- #define BikiniGirl "models/player/custom_player/voikanaa/misc/bikini_girl.mdl"
- #define Tracer "models/player/custom_player/kodua/tracer/tracer.mdl"
- #define Cortana "models/custom_player/voikanaa/halo4/cortana.mdl"
- // ================================= Zmienne ==================================
- new String:ModelCT[MAXPLAYERS+1][80];
- new Handle:Cookies_ModelCT = INVALID_HANDLE;
- new Handle:Handle_OnPlayerChangeModel = INVALID_HANDLE;
- public Plugin:myinfo =
- {
- name = "PGC24 -> Models",
- description = "Autorski plugin PGC24.PL",
- author = "Mesharsky edit Johnny2525",
- version = "1.0",
- url = "http://www.PGC24.PL"
- };
- // ================================= Funkcje Startowe (i PluginEnd) ==================================
- public OnPluginStart()
- {
- Handle_OnPlayerChangeModel = CreateGlobalForward("Models_OnPlayerChangeModel", ET_Ignore, Param_Cell);
- Cookies_ModelCT = RegClientCookie("sm_adept_models_ct", "Ostatnio zapisany model CT", CookieAccess:2);
- RegConsoleCmd("sm_models", CMD_Models);
- RegConsoleCmd("sm_modele", CMD_Models);
- RegConsoleCmd("sm_skiny", CMD_Models);
- RegAdminCmd("sm_modelgracza", CMD_ModelGracza, ADMFLAG_ROOT);
- for(new client = 1; client <= MAXPLAYERS ; client++)
- {
- if (minigames_IsValidClient(client))
- {
- OnClientCookiesCached(client);
- }
- }
- }
- public OnPluginEnd()
- {
- for(new client = 1; client <= MAXPLAYERS ; client++)
- {
- if (minigames_IsValidClient(client))
- {
- OnClientDisconnect(client);
- }
- }
- }
- // ================================= Ciasteczka ==================================
- public OnClientDisconnect(client)
- {
- if (AreClientCookiesCached(client))
- {
- SetClientCookie(client, Cookies_ModelCT, ModelCT[client]);
- }
- }
- public OnClientCookiesCached(client)
- {
- new String:Buffor[80];
- GetClientCookie(client, Cookies_ModelCT, Buffor, 80);
- if(IsEmptyString(Buffor)) Format(ModelCT[client], 80, "BRAK_MODELU");
- ModelCT[client] = Buffor;
- }
- // ================================= Menu ==================================
- public PokazMenuZModelami(client)
- {
- new Handle:H_Menu = CreateMenu(Menu_HandlerRemember);
- switch(GetClientTeam(client))
- {
- // Tutaj masz skiny dla TT
- case CS_TEAM_TT:
- {
- // Tutaj sobie dodajesz skiny
- AddMenuItem(H_Menu, "tracer", "Tracer");
- AddMenuItem(H_Menu, "cortana", "Cortana");
- // Tutaj sobie dodajesz skiny
- }
- // Tu masz skiny dla CT
- case CS_TEAM_CT:
- {
- // Tutaj sobie dodajesz skiny
- AddMenuItem(H_Menu, "bikinigirl", "BikiniGirl");
- }
- }
- AddMenuItem(H_Menu, "BRAK_MODELU", "Chce domyslny model");
- SetMenuTitle(H_Menu, "PGC24 -> Wybierz model !");
- DisplayMenu(H_Menu, client, MENU_TIME_FOREVER);
- return 0;
- }
- public Menu_HandlerRemember(Handle:menu, MenuAction:action, client, itemNum)
- {
- new String:info[32];
- GetMenuItem(menu, itemNum, info, sizeof(info));
- if (!minigames_IsValidClient(client))
- {
- return 0;
- }
- if (IsPlayerAlive(client))
- {
- if (!strcmp(info, "bikinigirl", true))
- {
- if(IsModelPrecached(BikiniGirl))
- SetEntityModel(client, BikiniGirl);
- Format(ModelCT[client], 80, BikiniGirl);
- PrintToChat(client, "%sWybrano model : %sDziewczynka w bikini %s !", MOD_TAG, COLOR_DARKRED, COLOR_DEFAULT);
- }
- else if (!strcmp(info, "tracer", true))
- {
- if(IsModelPrecached(Tracer))
- SetEntityModel(client, Tracer);
- Format(ModelCT[client], 80, Tracer);
- PrintToChat(client, "%sWybrano model : %sTracer%s !", MOD_TAG, COLOR_DARKRED, COLOR_DEFAULT);
- }
- else if (!strcmp(info, "Cortana", true))
- {
- if(IsModelPrecached(Cortana))
- SetEntityModel(client, Cortana);
- Format(ModelCT[client], 80, Cortana);
- PrintToChat(client, "%sWybrano model : %sCortana%s !", MOD_TAG, COLOR_DARKRED, COLOR_DEFAULT);
- }
- else if (!strcmp(info, "BRAK_MODELU", true))
- {
- switch(GetClientTeam(client))
- {
- case CS_TEAM_CT:
- {
- SetRandomCTModel(client, false);
- Format(ModelCT[client], 80, "BRAK_MODELU");
- }
- case CS_TEAM_TT:
- {
- SetRandomCTModel(client, false);
- Format(ModelCT[client], 80, "BRAK_MODELU");
- }
- }
- PrintToChat(client, "%sWybrano model : %sDomyślny%s !", MOD_TAG, COLOR_DARKRED, COLOR_DEFAULT);
- }
- Forward_OnPlayerChangeModel(client);
- }
- else PrintToChat(client, "%sJesteś martwy ! Aby zmienić swój model musisz być żywym !", MOD_TAG);
- return 0;
- }
- // ================================= Komendy ==================================
- public Action:CMD_ModelGracza(client, args)
- {
- decl String:strTarget[32]; GetCmdArg(1, strTarget, sizeof(strTarget));
- decl String:strTargetName[MAX_TARGET_LENGTH];
- decl TargetList[MAXPLAYERS], TargetCount;
- decl bool:TargetTranslate;
- if ((TargetCount = ProcessTargetString(strTarget, client, TargetList, MAXPLAYERS, COMMAND_FILTER_CONNECTED, strTargetName, sizeof(strTargetName), TargetTranslate)) <= 0)
- {
- ReplyToTargetError(client, TargetCount);
- return Plugin_Handled;
- }
- for (new i = 0; i < TargetCount; i++)
- {
- new iClient = TargetList[i];
- if (IsClientInGame(iClient))
- {
- new String:Model[256];
- GetClientModel(iClient, Model, sizeof(Model));
- PrintToChatAll("%sModel gracza %N to -> %s%s", MOD_TAG, iClient, COLOR_GOLD, Model);
- }
- }
- return Plugin_Continue;
- }
- public Action:CMD_Models(client, args)
- {
- if(client == 0) PrintToServer("Komenda dostępna tylko z poziomu gracza !");
- if(minigames_IsPlayerVIP(client))
- {
- PokazMenuZModelami(client);
- return Plugin_Handled;
- }
- else
- {
- PrintToChat(client, "%sModele są dostępne tylko dla %sVIP'a%s !", MOD_TAG, COLOR_DARKRED, COLOR_DEFAULT);
- FakeClientCommand(client, "sm_vip");
- return Plugin_Handled;
- }
- }
- // ================================= Native ==================================
- public APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max)
- {
- CreateNative("Models_SetRandomCTModel", Native_SetRandomCTModel);
- RegPluginLibrary("minigames_Models");
- return APLRes:0;
- }
- stock SetRandomCTModel(client, bool:UseRememberModel)
- {
- if(!minigames_IsValidClient(client)) return false;
- if(!IsPlayerAlive(client)) return false;
- if(!strcmp(ModelCT[client], "BRAK_MODELU", true)) UseRememberModel = false;
- if(!minigames_IsPlayerVIP(client)) UseRememberModel = false;
- if(!UseRememberModel)
- {
- return true;
- }
- else if(UseRememberModel)
- {
- if(IsEmptyString(ModelCT[client]))
- {
- SetRandomCTModel(client, false);
- return true;
- }
- if(IsModelPrecached(ModelCT[client]))
- SetEntityModel(client, ModelCT[client]);
- else
- {
- SetRandomCTModel(client, false);
- PrintToChatAll("%sPrzepraszamy :( Mesharsky pewnie znowu coś zchrzanił i nic nie działa ;_; Napisz do niego ! Dziękuje <3", MOD_TAG);
- PrintToChatAll("%sPrzekaż mu to -> %s", MOD_TAG, ModelCT[client])
- }
- return true;
- }
- else return false;
- }
- public Native_SetRandomCTModel(Handle:plugin, numParams)
- {
- return SetRandomCTModel(GetNativeCell(1), GetNativeCell(2));
- }
- // ================================= Pozostale ==================================
- public Forward_OnPlayerChangeModel(int client)
- {
- Call_StartForward(Handle_OnPlayerChangeModel);
- Call_PushCell(client);
- Call_Finish();
- }
- public OnMapStart()
- {
- PrecacheList();
- DownloadList();
- }
- // ================================= Download List ==================================
- stock DownloadList()
- {
- // BIKINI GIRL PORTED TO CSGO BY VOIKANAA
- // PLAYER
- AddFileToDownloadsTable("models/player/custom_player/voikanaa/misc/bikini_girl.mdl");
- AddFileToDownloadsTable("models/player/custom_player/voikanaa/misc/bikini_girl.phy");
- AddFileToDownloadsTable("models/player/custom_player/voikanaa/misc/bikini_girl.vvd");
- AddFileToDownloadsTable("models/player/custom_player/voikanaa/misc/bikini_girl.dx90.vtx");
- // MATERIALS
- AddFileToDownloadsTable("materials/models/player/voikanaa/misc/bikini_girl/BikiniGirl_Hair_N.vtf");
- AddFileToDownloadsTable("materials/models/player/voikanaa/misc/bikini_girl/BikiniGirl_Head_D.vmt");
- AddFileToDownloadsTable("materials/models/player/voikanaa/misc/bikini_girl/BikiniGirl_Head_D.vtf");
- AddFileToDownloadsTable("materials/models/player/voikanaa/misc/bikini_girl/BikiniGirl_Head_N.vtf");
- AddFileToDownloadsTable("materials/models/player/voikanaa/misc/bikini_girl/BikiniGirl_Body_D.vmt");
- AddFileToDownloadsTable("materials/models/player/voikanaa/misc/bikini_girl/BikiniGirl_Body_D.vtf");
- AddFileToDownloadsTable("materials/models/player/voikanaa/misc/bikini_girl/BikiniGirl_Body_N.vtf");
- AddFileToDownloadsTable("materials/models/player/voikanaa/misc/bikini_girl/BikiniGirl_Eyelash_D.vmt");
- AddFileToDownloadsTable("materials/models/player/voikanaa/misc/bikini_girl/BikiniGirl_Eyelash_D.vtf");
- AddFileToDownloadsTable("materials/models/player/voikanaa/misc/bikini_girl/BikiniGirl_Hair_D.vmt");
- AddFileToDownloadsTable("materials/models/player/voikanaa/misc/bikini_girl/BikiniGirl_Hair_D.vt");
- //Tracer
- //Player model
- AddFileToDownloadsTable("models/player/custom_player/kodua/tracer/tracer.mdl");
- AddFileToDownloadsTable("models/player/custom_player/kodua/tracer/tracer.phy");
- AddFileToDownloadsTable("models/player/custom_player/kodua/tracer/tracer.vvd");
- AddFileToDownloadsTable("models/player/custom_player/kodua/tracer/tracer.dx90.vtx");
- //Arms model
- AddFileToDownloadsTable("models/player/custom_player/kodua/tracer/tracer_arms.mdl");
- AddFileToDownloadsTable("models/player/custom_player/kodua/tracer/tracer_arms.vvd");
- AddFileToDownloadsTable("models/player/custom_player/kodua/tracer/tracer_arms.dx90.vtx");
- //Textures
- AddFileToDownloadsTable("materials/models/player/custom_player/kodua/tracer/visor_diff.vtf");
- AddFileToDownloadsTable("materials/models/player/custom_player/kodua/tracer/tracer_visor.vmt");
- AddFileToDownloadsTable("materials/models/player/custom_player/kodua/tracer/tracer_piercing.vmt");
- AddFileToDownloadsTable("materials/models/player/custom_player/kodua/tracer/tracer_metal.vmt");
- AddFileToDownloadsTable("materials/models/player/custom_player/kodua/tracer/tracer_head.vmt");
- AddFileToDownloadsTable("materials/models/player/custom_player/kodua/tracer/tracer_hair.vmt");
- AddFileToDownloadsTable("materials/models/player/custom_player/kodua/tracer/tracer_glasses.vmt");
- AddFileToDownloadsTable("materials/models/player/custom_player/kodua/tracer/tracer_body.vmt");
- AddFileToDownloadsTable("materials/models/player/custom_player/kodua/tracer/hair_normal.vtf");
- AddFileToDownloadsTable("materials/models/player/custom_player/kodua/tracer/hair_diff.vtf");
- AddFileToDownloadsTable("materials/models/player/custom_player/kodua/tracer/eyeball_r.vmt");
- AddFileToDownloadsTable("materials/models/player/custom_player/kodua/tracer/eyeball_l.vmt");
- AddFileToDownloadsTable("materials/models/player/custom_player/kodua/tracer/eyeball.vtf");
- AddFileToDownloadsTable("materials/models/player/custom_player/kodua/tracer/body_normal.vtf");
- AddFileToDownloadsTable("materials/models/player/custom_player/kodua/tracer/body_diff.vtf");
- AddFileToDownloadsTable("materials/models/player/custom_player/kodua/tracer/base_m_caucasian_wrp.vtf");
- // Cortana
- // PLAYER
- AddFileToDownloadsTable("models/player/custom_player/voikanaa/halo4/cortana.phy");
- AddFileToDownloadsTable("models/player/custom_player/voikanaa/halo4/cortana.mdl");
- AddFileToDownloadsTable("models/player/custom_player/voikanaa/halo4/cortana.dx90.vtx");
- AddFileToDownloadsTable("models/player/custom_player/voikanaa/halo4/cortana.vvd");
- // MATERIALS
- AddFileToDownloadsTable("materials/models/player/voikanaa/halo4/cortana/storm_cortana_default_eye_diff.vmt");
- AddFileToDownloadsTable("materials/models/player/voikanaa/halo4/cortana/storm_cortana_default_hair_diff.vmt");
- AddFileToDownloadsTable("materials/models/player/voikanaa/halo4/cortana/storm_cortana_default_body_diff.vmt");
- AddFileToDownloadsTable("materials/models/player/voikanaa/halo4/cortana/storm_cortana_default_head_diff.vmt");
- AddFileToDownloadsTable("materials/models/player/voikanaa/halo4/cortana/storm_cortana_default_eye_diff.vtf");
- AddFileToDownloadsTable("materials/models/player/voikanaa/halo4/cortana/storm_cortana_default_eye_n.vtf");
- AddFileToDownloadsTable("materials/models/player/voikanaa/halo4/cortana/storm_cortana_default_hair_normal.vtf");
- AddFileToDownloadsTable("materials/models/player/voikanaa/halo4/cortana/holoscanlines.vtf");
- AddFileToDownloadsTable("materials/models/player/voikanaa/halo4/cortana/storm_cortana_default_body_normal.vtf");
- AddFileToDownloadsTable("materials/models/player/voikanaa/halo4/cortana/storm_cortana_default_hair_diff.vtf");
- AddFileToDownloadsTable("materials/models/player/voikanaa/halo4/cortana/storm_cortana_default_head_diff.vtf");
- AddFileToDownloadsTable("materials/models/player/voikanaa/halo4/cortana/storm_cortana_default_head_normal.vtf");
- AddFileToDownloadsTable("materials/models/player/voikanaa/halo4/cortana/storm_cortana_default_body_diff.vtf");
- }
- stock PrecacheList()
- {
- PrecacheModel(BikiniGirl);
- PrecacheModel(Tracer);
- PrecacheModel (Cortana);
- }