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