#include #include #include #include // ================================= 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/mirainikki/gasaiyono.mdl" #define Samus "models/player/samus/samus.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, "gasaiyono", "Gasaiyono"); // 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, "samus", "Samus"); } } 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, "gasaiyono", true)) { if(IsModelPrecached(gasaiyono)) SetEntityModel(client, gasaiyono); Format(ModelCT[client], 80, gasaiyono); PrintToChat(client, "%sWybrano model : %sGasaiyono%s !", MOD_TAG, COLOR_DARKRED, COLOR_DEFAULT); } else if (!strcmp(info, "samus", true)) { if(IsModelPrecached(Samus)) SetEntityModel(client, Samus); Format(ModelCT[client], 80, Samus); PrintToChat(client, "%sWybrano model : %sSamus%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/mirainikki/gasaiyono.phy"); AddFileToDownloadsTable("models/player/custom_player/voikanaa/mirainikki/gasaiyono.mdl"); AddFileToDownloadsTable("models/player/custom_player/voikanaa/mirainikki/gasaiyono.dx90.vtx"); AddFileToDownloadsTable("models/player/custom_player/voikanaa/mirainikki/gasaiyono.vvd"); // MATERIALS AddFileToDownloadsTable("materials/models/player/voikanaa/mirainikki/gasaiyono/1.vmt"); AddFileToDownloadsTable("materials/models/player/voikanaa/mirainikki/gasaiyono/3.vmt"); AddFileToDownloadsTable("materials/models/player/voikanaa/mirainikki/gasaiyono/fa.vmt"); AddFileToDownloadsTable("materials/models/player/voikanaa/mirainikki/gasaiyono/ka.vmt"); AddFileToDownloadsTable("materials/models/player/voikanaa/mirainikki/gasaiyono/ski.vmt"); AddFileToDownloadsTable("materials/models/player/voikanaa/mirainikki/gasaiyono/black.vmt"); AddFileToDownloadsTable("materials/models/player/voikanaa/mirainikki/gasaiyono/imo_shoes28_00.vmt"); AddFileToDownloadsTable("materials/models/player/voikanaa/mirainikki/gasaiyono/5.vmt"); AddFileToDownloadsTable("materials/models/player/voikanaa/mirainikki/gasaiyono/55.vmt"); AddFileToDownloadsTable("materials/models/player/voikanaa/mirainikki/gasaiyono/te.vmt"); AddFileToDownloadsTable("materials/models/player/voikanaa/mirainikki/gasaiyono/me2.vmt"); AddFileToDownloadsTable("materials/models/player/voikanaa/mirainikki/gasaiyono/sha2.vmt"); AddFileToDownloadsTable("materials/models/player/voikanaa/mirainikki/gasaiyono/sha3.vmt"); AddFileToDownloadsTable("materials/models/player/voikanaa/mirainikki/gasaiyono/ska2.vmt"); AddFileToDownloadsTable("materials/models/player/voikanaa/mirainikki/gasaiyono/white.vmt"); AddFileToDownloadsTable("materials/models/player/voikanaa/mirainikki/gasaiyono/me2.vtf"); AddFileToDownloadsTable("materials/models/player/voikanaa/mirainikki/gasaiyono/imo_shoes28_00.vtf"); AddFileToDownloadsTable("materials/models/player/voikanaa/mirainikki/gasaiyono/3.vtf"); AddFileToDownloadsTable("materials/models/player/voikanaa/mirainikki/gasaiyono/bump_flat.vtf"); AddFileToDownloadsTable("materials/models/player/voikanaa/mirainikki/gasaiyono/ska2.vtf"); AddFileToDownloadsTable("materials/models/player/voikanaa/mirainikki/gasaiyono/te.vtf"); AddFileToDownloadsTable("materials/models/player/voikanaa/mirainikki/gasaiyono/white.vtf"); AddFileToDownloadsTable("materials/models/player/voikanaa/mirainikki/gasaiyono/5.vtf"); AddFileToDownloadsTable("materials/models/player/voikanaa/mirainikki/gasaiyono/55.vtf"); AddFileToDownloadsTable("materials/models/player/voikanaa/mirainikki/gasaiyono/ka.vtf"); AddFileToDownloadsTable("materials/models/player/voikanaa/mirainikki/gasaiyono/sha2.vtf"); AddFileToDownloadsTable("materials/models/player/voikanaa/mirainikki/gasaiyono/1.vtf"); AddFileToDownloadsTable("materials/models/player/voikanaa/mirainikki/gasaiyono/black.vtf"); AddFileToDownloadsTable("materials/models/player/voikanaa/mirainikki/gasaiyono/fa.vtf"); AddFileToDownloadsTable("materials/models/player/voikanaa/mirainikki/gasaiyono/ski.vtf"); AddFileToDownloadsTable("materials/models/player/voikanaa/mirainikki/gasaiyono/sha3.vtf"); // Samus // PLAYER AddFileToDownloadsTable("models/player/samus/samus.phy") AddFileToDownloadsTable("models/player/samus/samus.mdl") AddFileToDownloadsTable("models/player/samus/samus.dx90.vtx") AddFileToDownloadsTable("models/player/samus/samus.vvd") // MATERIALS AddFileToDownloadsTable("materials/models/player/samus/eyelash_lower.vmt") AddFileToDownloadsTable("materials/models/player/samus/eyelash_upper.vmt") AddFileToDownloadsTable("materials/models/player/samus/Emissive.vmt") AddFileToDownloadsTable("materials/models/player/samus/eye_diffuse.vmt") AddFileToDownloadsTable("materials/models/player/samus/gun_diffuse.vmt") AddFileToDownloadsTable("materials/models/player/samus/holster.vmt") AddFileToDownloadsTable("materials/models/player/samus/face_diffuse.vmt") AddFileToDownloadsTable("materials/models/player/samus/body_diffuse.vmt") AddFileToDownloadsTable("materials/models/player/samus/hair_diffuse.vmt") AddFileToDownloadsTable("materials/models/player/samus/eyelash_lower.vtf") AddFileToDownloadsTable("materials/models/player/samus/eyelash_upper.vtf") AddFileToDownloadsTable("materials/models/player/samus/eye_diffuse.vtf") AddFileToDownloadsTable("materials/models/player/samus/eye_bump.vtf") AddFileToDownloadsTable("materials/models/player/samus/face_diffuse.vtf") AddFileToDownloadsTable("materials/models/player/samus/holster.vtf") AddFileToDownloadsTable("materials/models/player/samus/Emissive.vtf") AddFileToDownloadsTable("materials/models/player/samus/gun_bump.vtf") AddFileToDownloadsTable("materials/models/player/samus/gun_diffuse.vtf") AddFileToDownloadsTable("materials/models/player/samus/holster_bump.vtf") AddFileToDownloadsTable("materials/models/player/samus/face_bump.vtf") AddFileToDownloadsTable("materials/models/player/samus/hair_bump.vtf") AddFileToDownloadsTable("materials/models/player/samus/hair_diffuse.vtf") AddFileToDownloadsTable("materials/models/player/samus/body_bump.vtf") AddFileToDownloadsTable("materials/models/player/samus/body_diffuse.vtf") } stock PrecacheList() { PrecacheModel(BikiniGirl); PrecacheModel(Tracer); PrecacheModel(Samus); }