Facebook
From Morose Hamster, 7 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 300
  1. #include <minigames_Manager>
  2. #include <cstrike>
  3. #include <sdktools>
  4. #include <clientprefs>
  5. // ================================= Preprocesor ==================================
  6. #define MOD_TAG "\x01\x0B\x0E★ \x07[PGC24.PL -> Modele]\x06 "
  7.  
  8. #define BikiniGirl "models/player/custom_player/voikanaa/misc/bikini_girl.mdl"
  9. #define Tracer "models/player/custom_player/kodua/tracer/tracer.mdl"
  10. #define Cortana "models/custom_player/voikanaa/halo4/cortana.mdl"
  11.  
  12. // ================================= Zmienne ==================================
  13. new String:ModelCT[MAXPLAYERS+1][80];
  14. new Handle:Cookies_ModelCT = INVALID_HANDLE;
  15. new Handle:Handle_OnPlayerChangeModel = INVALID_HANDLE;
  16. public Plugin:myinfo =
  17. {
  18.   name = "PGC24 -> Models",
  19.   description = "Autorski plugin PGC24.PL",
  20.   author = "Mesharsky edit Johnny2525",
  21.   version = "1.0",
  22.   url = "http://www.PGC24.PL"
  23. };
  24. // ================================= Funkcje Startowe (i PluginEnd) ==================================
  25. public OnPluginStart()
  26. {
  27.   Handle_OnPlayerChangeModel = CreateGlobalForward("Models_OnPlayerChangeModel", ET_Ignore, Param_Cell);
  28.   Cookies_ModelCT = RegClientCookie("sm_adept_models_ct", "Ostatnio zapisany model CT", CookieAccess:2);
  29.   RegConsoleCmd("sm_models", CMD_Models);
  30.   RegConsoleCmd("sm_modele", CMD_Models);
  31.   RegConsoleCmd("sm_skiny", CMD_Models);
  32.   RegAdminCmd("sm_modelgracza", CMD_ModelGracza, ADMFLAG_ROOT);
  33.   for(new client = 1; client <= MAXPLAYERS ; client++)
  34.   {
  35.     if (minigames_IsValidClient(client))
  36.     {
  37.       OnClientCookiesCached(client);
  38.     }
  39.   }
  40. }
  41.  
  42. public OnPluginEnd()
  43. {
  44.   for(new client = 1; client <= MAXPLAYERS ; client++)
  45.   {
  46.     if (minigames_IsValidClient(client))
  47.     {
  48.       OnClientDisconnect(client);
  49.     }
  50.   }
  51. }
  52. // ================================= Ciasteczka ==================================
  53. public OnClientDisconnect(client)
  54. {
  55.   if (AreClientCookiesCached(client))
  56.   {
  57.     SetClientCookie(client, Cookies_ModelCT, ModelCT[client]);
  58.   }
  59. }
  60. public OnClientCookiesCached(client)
  61. {
  62.   new String:Buffor[80];
  63.   GetClientCookie(client, Cookies_ModelCT, Buffor, 80);
  64.   if(IsEmptyString(Buffor))     Format(ModelCT[client], 80, "BRAK_MODELU");
  65.   ModelCT[client] = Buffor;
  66. }
  67. // ================================= Menu ==================================
  68. public PokazMenuZModelami(client)
  69. {
  70.   new Handle:H_Menu = CreateMenu(Menu_HandlerRemember);
  71.   switch(GetClientTeam(client))
  72.   {
  73.         // Tutaj masz skiny dla TT
  74.     case CS_TEAM_TT:
  75.     {
  76.                 // Tutaj sobie dodajesz skiny
  77.      AddMenuItem(H_Menu, "tracer", "Tracer");
  78.          AddMenuItem(H_Menu, "cortana", "Cortana");
  79.                 // Tutaj sobie dodajesz skiny
  80.     }
  81.  
  82.         // Tu masz skiny dla CT
  83.         case CS_TEAM_CT:
  84.     {
  85.                 // Tutaj sobie dodajesz skiny
  86.     AddMenuItem(H_Menu, "bikinigirl", "BikiniGirl");
  87.     }
  88.   }
  89.   AddMenuItem(H_Menu, "BRAK_MODELU", "Chce domyslny model");
  90.   SetMenuTitle(H_Menu, "PGC24 -> Wybierz model !");
  91.   DisplayMenu(H_Menu, client, MENU_TIME_FOREVER);
  92.   return 0;
  93. }
  94. public Menu_HandlerRemember(Handle:menu, MenuAction:action, client, itemNum)
  95. {
  96.   new String:info[32];
  97.   GetMenuItem(menu, itemNum, info, sizeof(info));
  98.   if (!minigames_IsValidClient(client))
  99.   {
  100.     return 0;
  101.   }
  102.   if (IsPlayerAlive(client))
  103.   {
  104.     if (!strcmp(info, "bikinigirl", true))
  105.     {
  106.                 if(IsModelPrecached(BikiniGirl))
  107.                 SetEntityModel(client, BikiniGirl);
  108.                 Format(ModelCT[client], 80, BikiniGirl);
  109.                 PrintToChat(client, "%sWybrano model : %sDziewczynka w bikini %s !", MOD_TAG, COLOR_DARKRED, COLOR_DEFAULT);
  110.     }
  111.         else if (!strcmp(info, "tracer", true))
  112.         {
  113.             if(IsModelPrecached(Tracer))
  114.             SetEntityModel(client, Tracer);
  115.             Format(ModelCT[client], 80, Tracer);
  116.                 PrintToChat(client, "%sWybrano model : %sTracer%s !", MOD_TAG, COLOR_DARKRED, COLOR_DEFAULT);
  117.         }
  118.         else if (!strcmp(info, "Cortana", true))
  119.         {
  120.             if(IsModelPrecached(Cortana))
  121.             SetEntityModel(client, Cortana);
  122.             Format(ModelCT[client], 80, Cortana);
  123.                 PrintToChat(client, "%sWybrano model : %sCortana%s !", MOD_TAG, COLOR_DARKRED, COLOR_DEFAULT);
  124.         }
  125.     else if (!strcmp(info, "BRAK_MODELU", true))
  126.     {
  127.       switch(GetClientTeam(client))
  128.       {
  129.         case CS_TEAM_CT:
  130.         {
  131.           SetRandomCTModel(client, false);
  132.           Format(ModelCT[client], 80, "BRAK_MODELU");
  133.         }
  134.                 case CS_TEAM_TT:
  135.         {
  136.           SetRandomCTModel(client, false);
  137.           Format(ModelCT[client], 80, "BRAK_MODELU");
  138.         }
  139.       }
  140.       PrintToChat(client, "%sWybrano model : %sDomyślny%s !", MOD_TAG, COLOR_DARKRED, COLOR_DEFAULT);
  141.     }
  142.     Forward_OnPlayerChangeModel(client);
  143.   }
  144.   else PrintToChat(client, "%sJesteś martwy ! Aby zmienić swój model musisz być żywym !", MOD_TAG);
  145.   return 0;
  146. }
  147. // ================================= Komendy ==================================
  148. public Action:CMD_ModelGracza(client, args)
  149. {
  150.   decl String:strTarget[32]; GetCmdArg(1, strTarget, sizeof(strTarget));
  151.  
  152.  
  153.   decl String:strTargetName[MAX_TARGET_LENGTH];
  154.   decl TargetList[MAXPLAYERS], TargetCount;
  155.   decl bool:TargetTranslate;
  156.  
  157.   if ((TargetCount = ProcessTargetString(strTarget, client, TargetList, MAXPLAYERS, COMMAND_FILTER_CONNECTED, strTargetName, sizeof(strTargetName), TargetTranslate)) <= 0)
  158.   {
  159.     ReplyToTargetError(client, TargetCount);
  160.     return Plugin_Handled;
  161.   }
  162.  
  163.  
  164.   for (new i = 0; i < TargetCount; i++)
  165.   {
  166.     new iClient = TargetList[i];
  167.     if (IsClientInGame(iClient))
  168.     {
  169.       new String:Model[256];
  170.       GetClientModel(iClient, Model, sizeof(Model));
  171.       PrintToChatAll("%sModel gracza %N to -> %s%s", MOD_TAG, iClient, COLOR_GOLD, Model);
  172.     }
  173.   }
  174.  
  175.   return Plugin_Continue;
  176. }
  177. public Action:CMD_Models(client, args)
  178. {
  179.   if(client == 0) PrintToServer("Komenda dostępna tylko z poziomu gracza !");
  180.   if(minigames_IsPlayerVIP(client))
  181.   {
  182.     PokazMenuZModelami(client);
  183.     return Plugin_Handled;
  184.   }
  185.   else
  186.   {
  187.     PrintToChat(client, "%sModele są dostępne tylko dla %sVIP'a%s !", MOD_TAG, COLOR_DARKRED, COLOR_DEFAULT);
  188.     FakeClientCommand(client, "sm_vip");
  189.     return Plugin_Handled;
  190.   }
  191. }
  192. // ================================= Native ==================================
  193. public APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max)
  194. {
  195.   CreateNative("Models_SetRandomCTModel", Native_SetRandomCTModel);
  196.   RegPluginLibrary("minigames_Models");
  197.   return APLRes:0;
  198. }
  199. stock SetRandomCTModel(client, bool:UseRememberModel)
  200. {
  201.   if(!minigames_IsValidClient(client)) return false;
  202.   if(!IsPlayerAlive(client)) return false;
  203.   if(!strcmp(ModelCT[client], "BRAK_MODELU", true)) UseRememberModel = false;
  204.   if(!minigames_IsPlayerVIP(client)) UseRememberModel = false;
  205.   if(!UseRememberModel)
  206.   {
  207.     return true;
  208.   }
  209.   else if(UseRememberModel)
  210.   {
  211.     if(IsEmptyString(ModelCT[client]))
  212.     {
  213.       SetRandomCTModel(client, false);
  214.       return true;
  215.     }
  216.     if(IsModelPrecached(ModelCT[client]))
  217.     SetEntityModel(client, ModelCT[client]);
  218.     else
  219.     {
  220.       SetRandomCTModel(client, false);
  221.       PrintToChatAll("%sPrzepraszamy :( Mesharsky pewnie znowu coś zchrzanił i nic nie działa ;_; Napisz do niego ! Dziękuje <3", MOD_TAG);
  222.       PrintToChatAll("%sPrzekaż mu to -> %s", MOD_TAG, ModelCT[client])
  223.     }
  224.     return true;
  225.   }
  226.   else return false;
  227. }
  228. public Native_SetRandomCTModel(Handle:plugin, numParams)
  229. {
  230.   return SetRandomCTModel(GetNativeCell(1), GetNativeCell(2));
  231. }
  232. // ================================= Pozostale ==================================
  233. public Forward_OnPlayerChangeModel(int client)
  234. {
  235.   Call_StartForward(Handle_OnPlayerChangeModel);
  236.   Call_PushCell(client);
  237.   Call_Finish();
  238. }
  239. public OnMapStart()
  240. {
  241.   PrecacheList();
  242.   DownloadList();
  243. }
  244. // ================================= Download List ==================================
  245. stock DownloadList()
  246. {
  247.  
  248.  
  249. //  BIKINI GIRL PORTED TO CSGO BY VOIKANAA
  250.  
  251. // PLAYER
  252. AddFileToDownloadsTable("models/player/custom_player/voikanaa/misc/bikini_girl.mdl");
  253. AddFileToDownloadsTable("models/player/custom_player/voikanaa/misc/bikini_girl.phy");
  254. AddFileToDownloadsTable("models/player/custom_player/voikanaa/misc/bikini_girl.vvd");
  255. AddFileToDownloadsTable("models/player/custom_player/voikanaa/misc/bikini_girl.dx90.vtx");
  256.  
  257.  
  258.  
  259. // MATERIALS
  260. AddFileToDownloadsTable("materials/models/player/voikanaa/misc/bikini_girl/BikiniGirl_Hair_N.vtf");
  261. AddFileToDownloadsTable("materials/models/player/voikanaa/misc/bikini_girl/BikiniGirl_Head_D.vmt");
  262. AddFileToDownloadsTable("materials/models/player/voikanaa/misc/bikini_girl/BikiniGirl_Head_D.vtf");
  263. AddFileToDownloadsTable("materials/models/player/voikanaa/misc/bikini_girl/BikiniGirl_Head_N.vtf");
  264. AddFileToDownloadsTable("materials/models/player/voikanaa/misc/bikini_girl/BikiniGirl_Body_D.vmt");
  265. AddFileToDownloadsTable("materials/models/player/voikanaa/misc/bikini_girl/BikiniGirl_Body_D.vtf");
  266. AddFileToDownloadsTable("materials/models/player/voikanaa/misc/bikini_girl/BikiniGirl_Body_N.vtf");
  267. AddFileToDownloadsTable("materials/models/player/voikanaa/misc/bikini_girl/BikiniGirl_Eyelash_D.vmt");
  268. AddFileToDownloadsTable("materials/models/player/voikanaa/misc/bikini_girl/BikiniGirl_Eyelash_D.vtf");
  269. AddFileToDownloadsTable("materials/models/player/voikanaa/misc/bikini_girl/BikiniGirl_Hair_D.vmt");
  270. AddFileToDownloadsTable("materials/models/player/voikanaa/misc/bikini_girl/BikiniGirl_Hair_D.vt");
  271.  
  272.  
  273. //Tracer
  274.  
  275. //Player model
  276.  
  277. AddFileToDownloadsTable("models/player/custom_player/kodua/tracer/tracer.mdl");
  278. AddFileToDownloadsTable("models/player/custom_player/kodua/tracer/tracer.phy");
  279. AddFileToDownloadsTable("models/player/custom_player/kodua/tracer/tracer.vvd");
  280. AddFileToDownloadsTable("models/player/custom_player/kodua/tracer/tracer.dx90.vtx");
  281.  
  282. //Arms model
  283.  
  284. AddFileToDownloadsTable("models/player/custom_player/kodua/tracer/tracer_arms.mdl");
  285. AddFileToDownloadsTable("models/player/custom_player/kodua/tracer/tracer_arms.vvd");
  286. AddFileToDownloadsTable("models/player/custom_player/kodua/tracer/tracer_arms.dx90.vtx");
  287.  
  288. //Textures
  289.  
  290. AddFileToDownloadsTable("materials/models/player/custom_player/kodua/tracer/visor_diff.vtf");
  291. AddFileToDownloadsTable("materials/models/player/custom_player/kodua/tracer/tracer_visor.vmt");
  292. AddFileToDownloadsTable("materials/models/player/custom_player/kodua/tracer/tracer_piercing.vmt");
  293. AddFileToDownloadsTable("materials/models/player/custom_player/kodua/tracer/tracer_metal.vmt");
  294. AddFileToDownloadsTable("materials/models/player/custom_player/kodua/tracer/tracer_head.vmt");
  295. AddFileToDownloadsTable("materials/models/player/custom_player/kodua/tracer/tracer_hair.vmt");
  296. AddFileToDownloadsTable("materials/models/player/custom_player/kodua/tracer/tracer_glasses.vmt");
  297. AddFileToDownloadsTable("materials/models/player/custom_player/kodua/tracer/tracer_body.vmt");
  298. AddFileToDownloadsTable("materials/models/player/custom_player/kodua/tracer/hair_normal.vtf");
  299. AddFileToDownloadsTable("materials/models/player/custom_player/kodua/tracer/hair_diff.vtf");
  300. AddFileToDownloadsTable("materials/models/player/custom_player/kodua/tracer/eyeball_r.vmt");
  301. AddFileToDownloadsTable("materials/models/player/custom_player/kodua/tracer/eyeball_l.vmt");
  302. AddFileToDownloadsTable("materials/models/player/custom_player/kodua/tracer/eyeball.vtf");
  303. AddFileToDownloadsTable("materials/models/player/custom_player/kodua/tracer/body_normal.vtf");
  304. AddFileToDownloadsTable("materials/models/player/custom_player/kodua/tracer/body_diff.vtf");
  305. AddFileToDownloadsTable("materials/models/player/custom_player/kodua/tracer/base_m_caucasian_wrp.vtf");
  306.  
  307. //  Cortana
  308.  
  309. // PLAYER
  310. AddFileToDownloadsTable("models/player/custom_player/voikanaa/halo4/cortana.phy");
  311. AddFileToDownloadsTable("models/player/custom_player/voikanaa/halo4/cortana.mdl");
  312. AddFileToDownloadsTable("models/player/custom_player/voikanaa/halo4/cortana.dx90.vtx");
  313. AddFileToDownloadsTable("models/player/custom_player/voikanaa/halo4/cortana.vvd");
  314.  
  315.  
  316.  
  317.  
  318. // MATERIALS
  319. AddFileToDownloadsTable("materials/models/player/voikanaa/halo4/cortana/storm_cortana_default_eye_diff.vmt");
  320. AddFileToDownloadsTable("materials/models/player/voikanaa/halo4/cortana/storm_cortana_default_hair_diff.vmt");
  321. AddFileToDownloadsTable("materials/models/player/voikanaa/halo4/cortana/storm_cortana_default_body_diff.vmt");
  322. AddFileToDownloadsTable("materials/models/player/voikanaa/halo4/cortana/storm_cortana_default_head_diff.vmt");
  323. AddFileToDownloadsTable("materials/models/player/voikanaa/halo4/cortana/storm_cortana_default_eye_diff.vtf");
  324. AddFileToDownloadsTable("materials/models/player/voikanaa/halo4/cortana/storm_cortana_default_eye_n.vtf");
  325. AddFileToDownloadsTable("materials/models/player/voikanaa/halo4/cortana/storm_cortana_default_hair_normal.vtf");
  326. AddFileToDownloadsTable("materials/models/player/voikanaa/halo4/cortana/holoscanlines.vtf");
  327. AddFileToDownloadsTable("materials/models/player/voikanaa/halo4/cortana/storm_cortana_default_body_normal.vtf");
  328. AddFileToDownloadsTable("materials/models/player/voikanaa/halo4/cortana/storm_cortana_default_hair_diff.vtf");
  329. AddFileToDownloadsTable("materials/models/player/voikanaa/halo4/cortana/storm_cortana_default_head_diff.vtf");
  330. AddFileToDownloadsTable("materials/models/player/voikanaa/halo4/cortana/storm_cortana_default_head_normal.vtf");
  331. AddFileToDownloadsTable("materials/models/player/voikanaa/halo4/cortana/storm_cortana_default_body_diff.vtf");
  332.  
  333. }
  334. stock PrecacheList()
  335. {
  336.   PrecacheModel(BikiniGirl);
  337.   PrecacheModel(Tracer);
  338.   PrecacheModel (Cortana);
  339. }
  340.