Advertisement
Guest User

Untitled

a guest
Aug 16th, 2013
5,594
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 433.23 KB | None | 0 0
  1.  
  2. #include<sourcemod>
  3. #include<sdktools>
  4. #include<sdkhooks>
  5. #include<basecomm>
  6. #include<cstrike>
  7. #include<sendproxy_us>
  8. #include<cssspeedmod_us>
  9.  
  10.  
  11. new String:Path[256];
  12. new String:Path2[256];
  13. new String:Path3[256];
  14. //키인식을 위한 변수
  15. new keybuffer[MAXPLAYERS+1];
  16. //헤드샷으로 죽었는지의 여부
  17. new bool:IsHeadShot[MAXPLAYERS+1];
  18. //죽은무기
  19. new String:Weapon[MAXPLAYERS+1][256];
  20. //로드됨?
  21. new bool:DataLoaded[MAXPLAYERS+1][3];
  22. //재밌는거!
  23. new bool:Fun[MAXPLAYERS+1];
  24. new bool:Fun2[MAXPLAYERS+1];
  25. //넉백 어택커
  26. new KnockBackAttacker[MAXPLAYERS+1];
  27. new KnockBackAttackerDelay[MAXPLAYERS+1];
  28. //태우기 어택커
  29. new BurnOwner[MAXPLAYERS+1];
  30. //직업
  31. new Job[MAXPLAYERS+1];
  32. //스프라이트
  33. new Sprites[MAXPLAYERS+1];
  34. //DNA스프라이트
  35. new DNASprites[2048];
  36. //DNA스프라이트의 패런트 info_target
  37. new info_target[2048];
  38. //크레딧
  39. new Credit[MAXPLAYERS+1];
  40. //브금옵션
  41. //new bool:BGM[MAXPLAYERS+1];
  42. //플레이타임
  43. new Float:PlayingTime[MAXPLAYERS+1];
  44. //마지막 저장된 엔진시간
  45. new Float:LastEngineTime[MAXPLAYERS+1];
  46. //챗딜레이
  47. new bool:ChatDelay[MAXPLAYERS+1];
  48. //자동스왑방지
  49. new bool:BlockWeaponUse[MAXPLAYERS+1];
  50. //살때 허용
  51. new bool:BuyAcceptWeapon[MAXPLAYERS+1];
  52. //죽인사람명단
  53. new String:TraitorKillList[MAXPLAYERS+1][256];
  54. //맞은 로그
  55. new String:HitLog[MAXPLAYERS+1][4096];
  56. //전판 맞은 로그
  57. new String:LastHitLog[MAXPLAYERS+1][4096];
  58. //때린 로그
  59. new String:AttackLog[MAXPLAYERS+1][4096];
  60. //전판 때린 로그
  61. new String:LastAttackLog[MAXPLAYERS+1][4096];
  62. //해당사람의 래그돌
  63. new Ragdoll[MAXPLAYERS+1];
  64. //이엔티티는 래그돌인가
  65. new bool:IsRagdoll[2048];
  66. //이엔티티는 밧줄인가
  67. new bool:IsRope[2048];
  68. //이 시체의 설명
  69. new String:TargetDescription[2048][6][256];
  70. //설명할수있으면 bool은 true
  71. new bool:TargetDescription_bool[2048][6]
  72. //라운드가시작됬는가.
  73. new bool:roundstart;
  74. //직업이선택됬는가.
  75. new bool:chosen;
  76. //직업선택되기까지의시간
  77. new GameCount;
  78. //조사된 시체인가
  79. new bool:CheckedBody[2048];
  80. //DNA스캔 타이머
  81. new Handle:DNAScanTimer[MAXPLAYERS+1] = INVALID_HANDLE;
  82. //T-Virus감염여부핸들
  83. new Handle:TVirusTimer[MAXPLAYERS+1] = INVALID_HANDLE;
  84. //크레딧의 양
  85. new RemainCredit[2048];
  86. //DNAì •ë³´
  87. new String:DNAInformation[2048][256];
  88. //DNA샘플
  89. new String:DNASample[MAXPLAYERS+1][2][256];
  90. //DNA샘플창
  91. new String:Sample[MAXPLAYERS+1][5][2][256];
  92. //DNA스캔중
  93. new bool:DNAScanning[MAXPLAYERS+1];
  94. //스캔카운트
  95. new ScanCount[MAXPLAYERS+1];
  96. //DNA스캔카운트
  97. new DNAScanCount[MAXPLAYERS+1];
  98. //메뉴를 보여주는 횟수(0.1초당1번)
  99. new ShowMenuCount[MAXPLAYERS+1];
  100. //메뉴를 보여주는중인가
  101. new bool:IsShowMenu[MAXPLAYERS+1];
  102. //메뉴의 마지막사람
  103. new MenuLastMan[MAXPLAYERS+1];
  104. //치료하는것은 딜레이가 필요하다.
  105. new bool:HealDelay[MAXPLAYERS+1];
  106. new bool:HealSoundDelay[MAXPLAYERS+1];
  107. //모두에게 보이는 기본시간.
  108. new Time1;
  109. //트레에게 보이는 추가시간.
  110. new Time2;
  111. //그사람이 보이는가. 그사람 보는사람
  112. new bool:Visible[MAXPLAYERS+1][MAXPLAYERS+1];
  113. //재밌는 명령어
  114. new FunCommand[MAXPLAYERS+1];
  115. //T-Virus 좀비될때 채팅,보이스막기
  116. new Float:LastFadeTime[MAXPLAYERS+1];
  117. new bool:IsInfect[MAXPLAYERS+1];
  118. //BGM Volume
  119. //new Volume[MAXPLAYERS+1];
  120. //Teleport Handle
  121. new Handle:Teleport[MAXPLAYERS+1] = INVALID_HANDLE;
  122. //Will Timer Handle
  123. new Handle:WillTimer[MAXPLAYERS+1] = INVALID_HANDLE;
  124. //func_useableladder fix
  125. new Float:lastZ[MAXPLAYERS+1];
  126. //Dia count
  127. new DiaCount;
  128. new MaxDiaCount;
  129. //Zombie AI
  130. new bool:IsAttack[2048];
  131. new Float:NextThink[2048];
  132. //Last Attacker
  133. new LastAttacker;
  134.  
  135. //크레딧샵~~~!@~!@~!@~@~!@1
  136. new bool:SpeedBoots[MAXPLAYERS+1];
  137. new bool:IronShoes[MAXPLAYERS+1];
  138. new bool:GoldenGun[2048];
  139. new bool:BuyGoldenGun[MAXPLAYERS+1];
  140. new bool:HealthStation[2048];
  141. new bool:IsHealthBox[2048];
  142. new HealthBox[2048];
  143. new bool:IsVIPHealthBox[2048];
  144. new bool:IsDetectorHealthBox[2048];
  145. new bool:IsFakeHealthBox[2048];
  146. new FakeHealthBoxOwner[2048];
  147. new bool:Jihad[2048];
  148. new bool:IsJihad[MAXPLAYERS+1];
  149. new JihadSpark[MAXPLAYERS+1];
  150. new bool:RPG[2048];
  151. new bool:BuyRPG[MAXPLAYERS+1];
  152. new RPGFOV[MAXPLAYERS+1];
  153. new bool:BuySG552[MAXPLAYERS+1];
  154. new bool:BuyDagger[MAXPLAYERS+1];
  155. new bool:Dagger[MAXPLAYERS+1];
  156. new bool:SuperCrowbar[MAXPLAYERS+1];
  157. new bool:Disguise[MAXPLAYERS+1];
  158. new bool:IsDisguise[MAXPLAYERS+1];
  159. new bool:DNASignalJammer[2048];
  160. new JammerEntity[MAXPLAYERS+1];
  161. new bool:Radar[MAXPLAYERS+1];
  162. new RadarCount[MAXPLAYERS+1];
  163. new bool:BuyTVirus[MAXPLAYERS+1];
  164. new bool:TVirus[2048];
  165. new bool:BuyTeleporter[MAXPLAYERS+1];
  166. new bool:Teleporter[2048];
  167. new bool:TeleporterDelay[MAXPLAYERS+1];
  168. new bool:TeleporterSavedPosition[MAXPLAYERS+1];
  169. new bool:TeleportSuccess[MAXPLAYERS+1];
  170. new TeleportCount[2048];
  171. new Float:TeleporterPosition[MAXPLAYERS+1][3];
  172. new Float:TeleporterAngle[MAXPLAYERS+1][3];
  173. new bool:Crossbow[2048];
  174. new bool:BuyCrossbow[MAXPLAYERS+1];
  175. new AttackDelay[MAXPLAYERS+1]; //0=Attacking, 1=able shoot, 2=reload
  176. new ReloadCount[MAXPLAYERS+1];
  177. new bool:BuyUMP[MAXPLAYERS+1];
  178. new bool:UMP[2048];
  179. new bool:Silenced_Sniper_Rifle[2048];
  180.  
  181. new Handle:databasehandle = INVALID_HANDLE;
  182.  
  183. #define SkinType 1
  184. #define VMSkinType 2
  185. #define MaxType 2
  186. new String:TypeName[MaxType+1][2][256] = {
  187. {"아이템종류", "데이터베이스이름"},
  188. {"player skin", "skin"},
  189. {"crowbar skin", "vmskin"}
  190. };
  191.  
  192. //Karma
  193. new Karma[MAXPLAYERS+1];
  194. #define Karma_Max 2000
  195. #define Karma_Effect 1800
  196. #define Karma_KillTraitor 200
  197. #define Karma_TeamKill 100
  198.  
  199. //포인트샵~~~!@~!@~!@~@~!@1
  200. #define GetPoint_Duration 600
  201. #define GetPoint_Value 5
  202. new Float:PointDelay[MAXPLAYERS+1];
  203. new VIP[MAXPLAYERS+1];
  204. new VIP_Trails_RotatingEntity[MAXPLAYERS+1];
  205. new TagColor[MAXPLAYERS+1];
  206. new Point[MAXPLAYERS+1];
  207. new SellPoint[MAXPLAYERS+1];
  208. #define MAX_ITEMS 3+1
  209. new String:ItemName[MAX_ITEMS][256];
  210. new ItemType[MAX_ITEMS];
  211. new String:ItemPath[MAX_ITEMS][256];
  212. new ItemPrice[MAX_ITEMS];
  213. new ItemID[MAXPLAYERS+1][MaxType+1];
  214. new bool:ItemExist[MAXPLAYERS+1][MaxType+1];
  215. new bool:ItemOn[MAXPLAYERS+1][MaxType+1];
  216. new bool:IsVIPItem[MAX_ITEMS];
  217. new bool:IsRestrictItem[MAX_ITEMS];
  218. new bool:RestrictItem[MAXPLAYERS+1][MAX_ITEMS];
  219.  
  220. new String:LastSteamID[MAXPLAYERS+1][256];
  221.  
  222. //맵스타트 여부
  223. new bool:FirstRound;
  224. //크레딧 받았는지의 여부
  225. new bool:ReceiveCredit;
  226. //직업이 골라진후 들어왔는지의 여부
  227. new bool:ChosenJoin[MAXPLAYERS+1];
  228.  
  229. //펀치뷰
  230. new offsPunchAngle;
  231. //레이더
  232. new g_flFlashDuration;
  233. new g_flFlashMaxAlpha;
  234. //총속도
  235. new g_NextPrimaryAttack;
  236. new Process[MAXPLAYERS+1];
  237. //ammo
  238. new Ammo;
  239. new AmmoType;
  240. //노블럭
  241. new CollOff;
  242. //인질의 리더
  243. new gLeaderOffset;
  244.  
  245. new CrowbarModel;
  246. new CrowbarModelW;
  247. new DaggerModel;
  248. new DaggerModelW;
  249. new GoldenGunModel;
  250. new GoldenGunModelW;
  251. new StunStickModel;
  252. new StunStickModelW;
  253. new IgnitionGunModel;
  254. new IgnitionGunModelW;
  255. new RPGModel;
  256. new RPGModelW;
  257. new TVirusModel;
  258. new TVirusModelW;
  259. new TeleporterModel;
  260. new TeleporterModelW;
  261. new CrossbowModel;
  262. new CrossbowModelW;
  263. new JihadModel;
  264. new JihadModelW;
  265. new HealthStationModel;
  266. new SilencedSniperRifleModel;
  267. new SilencedSniperRifleModelW;
  268.  
  269. new bool:SpawnCheck[MAXPLAYERS+1];
  270. new ClientVM[MAXPLAYERS+1][2];
  271. new bool:IsCustom[MAXPLAYERS+1];
  272. #define EF_NODRAW 32
  273.  
  274. new Wire[4096][4][3];
  275.  
  276. new Bot;
  277. #define BotName "Welcome To TTT Server"
  278.  
  279. new AliveJobCount[4];
  280. #define innocent 1
  281. #define detector 2
  282. #define traitor 3
  283.  
  284. new String:JobName[4][256] = {
  285. "select",
  286. "Innocent",
  287. "detective",
  288. "traitor"
  289. };
  290.  
  291. #define MAX_WEAPON 13
  292. new String:WeaponDelay[MAX_WEAPON][2][256] = {
  293. {"weapon_ak47", "0.15"},
  294. {"weapon_m4a1", "0.15"},
  295. {"weapon_m3", "1.0"},
  296. {"weapon_xm1014", "0.8"},
  297. {"weapon_mac10", "0.15"},
  298. {"weapon_tmp", "0.15"},
  299. {"weapon_m249", "0.1"},
  300. {"weapon_sg552", "0.16"},
  301. {"weapon_deagle", "0.6"},
  302. {"weapon_fiveseven", "0.22"},
  303. {"weapon_elite", "0.2"},
  304. {"weapon_usp", "0.25"},
  305. {"weapon_c4", "1.0"}
  306. };
  307. /*
  308. new SoundNumber;
  309. new SoundCount
  310. #define MAX_MUSIC 11
  311. new String:SoundData[MAX_MUSIC][2][256] = {
  312. {"Fuan.mp3", "114"},
  313. {"kuroi_light.mp3", "110"},
  314. {"puzzle_snd_fix.mp3", "152"},
  315. {"suspicion.mp3", "118"},
  316. {"Camp.mp3", "168"},
  317. {"07_The_Plot_Thickens2.mp3", "121"},
  318. {"fa2.mp3", "62"},
  319. {"HORROR2.mp3", "190"},
  320. {"L2.mp3", "180"},
  321. {"tension.mp3", "70"},
  322. {"supposition2.mp3", "105"}
  323.  
  324. {"carol/tree.mp3", "185"},
  325. {"carol/csonline.mp3", "99"},
  326. {"carol/Feliz_Navidad.mp3", "131"},
  327. {"carol/Carol_of_the_Bells.mp3", "186"},
  328. {"carol/Fall_Out_Boy_Yule_Shoot_Your_Eye_Out.mp3", "224"},
  329. {"carol/talesweaver_carol_theme.mp3", "76"},
  330. {"carol/Train_01_Shake_Up_Christmas_192k.mp3", "234"}
  331. }
  332. */
  333.  
  334. #define DEFAULT_VIP_POINT_HOUR 100
  335.  
  336. #define Server_Master_SteamID "STEAM_0:1:37724744"
  337. #define Server_SubMaster_SteamID "STEAM_0:0:34728756"
  338. #define BJ_SteamID "STEAM_0:1:47746273"
  339.  
  340. /*****Dev*****/
  341. new Float:StartPos[3];
  342. new Handle:Zone_Timer[MAXPLAYERS+1] = INVALID_HANDLE;
  343. /**************/
  344.  
  345. /****************************자석막대 인클루드****************************/
  346. #include"ttt_us/GravityGun"
  347. /****************************************************************************/
  348.  
  349. #define PointEvent 1
  350.  
  351. public OnPluginStart()
  352. {
  353. HookEvent("player_death", EventDeath, EventHookMode_Pre);
  354. HookEvent("player_spawn", EventSpawn);
  355. HookEvent("weapon_fire", EventFire);
  356. HookEvent("round_start", RoundStart);
  357. HookEvent("round_end", RoundEnd);
  358. HookEvent("player_changename", OnChangeName);
  359. HookEvent("player_hurt", EventHurt);
  360. HookEvent("bullet_impact", EventBullet);
  361. HookEvent("round_freeze_end", roundfreezeend_event);
  362. HookEvent("hostage_hurt", OnHostageBlocking, EventHookMode_Pre);
  363. HookEvent("hostage_follows", OnHostageBlocking, EventHookMode_Pre);
  364. HookEvent("hostage_stops_following", OnHostageBlocking, EventHookMode_Pre);
  365. HookEvent("hostage_killed", OnHostageBlocking, EventHookMode_Pre);
  366.  
  367. RegConsoleCmd("say_team", SayHook);
  368. RegConsoleCmd("say", SayHook_RecognizeCommand);
  369. RegConsoleCmd("nightvision", NightVision);
  370. RegConsoleCmd("jointeam", JoinTeam);
  371. RegConsoleCmd("joinclass", JoinClass);
  372. RegConsoleCmd("sm_shop", Command_Shop);
  373. RegConsoleCmd("last_damage_report", LastDamageReport);
  374. RegConsoleCmd("last_attack_report", LastAttackReport);
  375. RegConsoleCmd("sm_ldr", LastDamageReport);
  376. RegConsoleCmd("sm_lar", LastAttackReport);
  377. RegConsoleCmd("kill", BlockSuicide);
  378. RegAdminCmd("sm_weaponmenu", Command_WeaponMenu, ADMFLAG_ROOT, "맵에 무기를 생성시키는 메뉴");
  379. RegAdminCmd("sm_weaponlist", Command_WeaponList, ADMFLAG_ROOT, "맵의 무기를 구해주는 커맨드");
  380. RegAdminCmd("sm_weapondelete", Command_WeaponDelete, ADMFLAG_ROOT, "맵의 무기를 없애주는 커맨드");
  381. RegAdminCmd("sm_createspawn", Command_CreateSpawn, ADMFLAG_ROOT, "맵에 스폰지점을 생성시키는 메뉴");
  382. RegAdminCmd("sm_spawnlist", Command_SpawnList, ADMFLAG_ROOT, "맵의 스폰지점을 구해주는 커맨드");
  383. RegAdminCmd("sm_spawndelete", Command_SpawnDelete, ADMFLAG_ROOT, "맵의 스폰지점을 없애주는 커맨드");
  384. RegAdminCmd("sm_createladder", Command_CreateLadder, ADMFLAG_ROOT, "맵에 사다리를 생성시키는 메뉴");
  385. RegAdminCmd("sm_ladderlist", Command_LadderList, ADMFLAG_ROOT, "맵의 사다리를 구해주는 커맨드");
  386. RegAdminCmd("sm_ladderdelete", Command_LadderDelete, ADMFLAG_ROOT, "맵의 사다리를 없애주는 커맨드");
  387. RegAdminCmd("sm_job", Command_Job, ADMFLAG_ROOT, "직업 강제 설정 커맨드");
  388. RegAdminCmd("sm_spec", Command_Spectator, ADMFLAG_ROOT, "관전으로 보내는 명령어");
  389. RegAdminCmd("sm_point", Command_Point, ADMFLAG_ROOT, "포인트 추가 커맨드");
  390. RegAdminCmd("sm_item", Command_Item, ADMFLAG_ROOT, "아이템 추가 커맨드");
  391. RegAdminCmd("sm_setplayingtime", Command_PlayingTime, ADMFLAG_ROOT, "플레이 타임 설정 커맨드");
  392. RegAdminCmd("sm_query", Command_Query, ADMFLAG_ROOT, "쿼리 커맨드");
  393. RegAdminCmd("sm_searchvip", Command_SearchVIP, ADMFLAG_ROOT, "쿼리 커맨드");
  394. RegAdminCmd("sm_findinventorytosteamid", Command_FindInventoryToSteamID, ADMFLAG_ROOT, "쿼리 커맨드");
  395. RegAdminCmd("sm_shoplog", Command_ShopLog, ADMFLAG_ROOT, "쿼리 커맨드");
  396. RegAdminCmd("sm_addvip", Command_VIP, ADMFLAG_ROOT, "VIP 추가 커맨드");
  397. RegAdminCmd("sm_credit", Command_Credit, ADMFLAG_ROOT, "크레딧 추가 커맨드");
  398. RegAdminCmd("sm_fun", Command_Fun, ADMFLAG_ROOT, "재밌는 커맨드");
  399. RegAdminCmd("sm_fun2", Command_Fun2, ADMFLAG_ROOT, "재밌는 커맨드");
  400. RegAdminCmd("sm_fun3", Command_Fun3, ADMFLAG_ROOT, "재밌는 커맨드");
  401. RegAdminCmd("sm_fun4", Command_Fun4, ADMFLAG_ROOT, "재밌는 커맨드");
  402. RegAdminCmd("sm_disguise", Command_Disguise, ADMFLAG_ROOT, "재밌는 커맨드");
  403. RegAdminCmd("sm_armor", Command_Armor, ADMFLAG_ROOT, "재밌는 커맨드");
  404. RegAdminCmd("sm_tvirus", Command_TVirus, ADMFLAG_ROOT, "재밌는 커맨드");
  405. RegAdminCmd("sm_receive_cheat", Command_Receive_Cheat, ADMFLAG_ROOT, "재밌는 커맨드");
  406. RegAdminCmd("sm_dia", Command_Diamond, ADMFLAG_ROOT, "특별한 커맨드");
  407.  
  408. HookUserMessage(GetUserMessageId("TextMsg"), TextMsg, true);
  409. HookUserMessage(GetUserMessageId("SayText2"), SayText2, true);
  410. HookUserMessage(GetUserMessageId("RadioText"), hookRadioText, true);
  411. offsPunchAngle = FindSendPropInfo("CBasePlayer", "m_vecPunchAngle");
  412. g_flFlashDuration = FindSendPropOffs("CCSPlayer", "m_flFlashDuration");
  413. g_flFlashMaxAlpha = FindSendPropOffs("CCSPlayer", "m_flFlashMaxAlpha");
  414. g_NextPrimaryAttack = FindSendPropOffs("CBaseCombatWeapon","m_flNextPrimaryAttack");
  415. CollOff = FindSendPropOffs("CBaseEntity", "m_CollisionGroup");
  416. Ammo = FindSendPropOffs("CCSPlayer", "m_iAmmo");
  417. AmmoType = FindSendPropOffs("CBaseCombatWeapon", "m_iPrimaryAmmoType");
  418. gLeaderOffset = FindSendPropOffs("CHostage", "m_leader");
  419.  
  420. ServerCommand("mp_friendlyfire 1");
  421. ServerCommand("mp_ignore_round_win_conditions 1");
  422. ServerCommand("sv_hudhint_sound 0");
  423. ServerCommand("ammo_338mag_max 1");
  424.  
  425. AddTempEntHook("Shotgun Shot", TE_Hook_ShotgunShot);
  426.  
  427. AddNormalSoundHook(SoundCallBackHook);
  428.  
  429. AddCommandListener(autobuy, "autobuy");
  430. AddCommandListener(rebuy, "rebuy");
  431. AddCommandListener(cheer, "cheer");
  432. AddCommandListener(commandmenu, "commandmenu");
  433.  
  434. LoadTranslations("ttt.phrases");
  435.  
  436. BuildPath(Path_SM, Path, 256, "data/map_weapon_list.txt");
  437. BuildPath(Path_SM, Path2, 256, "data/map_spawn_list.txt");
  438. BuildPath(Path_SM, Path3, 256, "data/map_ladder_list.txt");
  439.  
  440. for(new client = 1; client <= MaxClients; client++)
  441. {
  442. if(IsClientInGame(client))
  443. {
  444. SDKHook(client, SDKHook_PostThinkPost, OnPostThinkPost);
  445.  
  446. //find both of the clients viewmodels
  447. ClientVM[client][0] = GetEntPropEnt(client, Prop_Send, "m_hViewModel");
  448.  
  449. new PVM = -1;
  450. while ((PVM = FindEntityByClassname(PVM, "predicted_viewmodel")) != -1)
  451. {
  452. if (GetEntPropEnt(PVM, Prop_Send, "m_hOwner") == client)
  453. {
  454. if (GetEntProp(PVM, Prop_Send, "m_nViewModelIndex") == 1)
  455. {
  456. ClientVM[client][1] = PVM;
  457. break;
  458. }
  459. }
  460. }
  461. }
  462. }
  463.  
  464. CreateItem(1, "Predator", 1, "models/player/techknow/predator_v2/predator.mdl", 2000, false);
  465. CreateItem(2, "ichigo", 1, "models/player/hhp227/mitch/ichigo_bankai_fixed.mdl", 2000, false);
  466. CreateItem(3, "sepiroth", 1, "models/mapeadores/kaem/sephiroth3/sephiroth.mdl", 2000, true);
  467. GravityGunPluginStart();
  468. }
  469.  
  470. stock CreateItem(ItemNumber, String:Item_Name[256], Item_Type, String:Paths[256], price, bool:onlyVIP, bool:Restrict=false)
  471. {
  472. ItemName[ItemNumber] = Item_Name;
  473. ItemType[ItemNumber] = Item_Type;
  474. ItemPath[ItemNumber] = Paths;
  475. ItemPrice[ItemNumber] = price;
  476. IsVIPItem[ItemNumber] = onlyVIP;
  477. IsRestrictItem[ItemNumber] = Restrict;
  478. }
  479.  
  480. public Action:LastDamageReport(Client, args)
  481. {
  482. if(!IsPlayerAlive(Client))
  483. {
  484. new String:Formatting[4096], count, bool:check;
  485. Formatting = HitLog[Client];
  486. while(StrContains(Formatting, "�") != -1)
  487. {
  488. ReplaceStringEx(Formatting, 4096, "�", "");
  489. count++;
  490. check = true;
  491. }
  492. if(check)
  493. {
  494. Formatting = HitLog[Client];
  495. new String:Formatting2[count+1][64];
  496. ExplodeString(Formatting, "�", Formatting2, count+1, 64);
  497. new Handle:menuhandle = CreateMenu(NULL_CallBack);
  498. SetMenuTitle(menuhandle, "-----데미지로그-----");
  499. for(new i=1; i<=count; i++)
  500. {
  501. AddMenuItem(menuhandle, "", Formatting2[i], ITEMDRAW_DISABLED);
  502. }
  503. SetMenuExitButton(menuhandle, true);
  504. DisplayMenu(menuhandle, Client, 10);
  505. }
  506. }
  507. else
  508. {
  509. new String:Formatting3[4096], count2, bool:check2;
  510. Formatting3 = LastHitLog[Client];
  511. while(StrContains(Formatting3, "�") != -1)
  512. {
  513. ReplaceStringEx(Formatting3, 4096, "�", "");
  514. count2++;
  515. check2 = true;
  516. }
  517. if(check2)
  518. {
  519. Formatting3 = LastHitLog[Client];
  520. new String:Formatting4[count2+1][64];
  521. ExplodeString(Formatting3, "�", Formatting4, count2+1, 64);
  522. new Handle:menuhandle = CreateMenu(NULL_CallBack);
  523. SetMenuTitle(menuhandle, "-----데미지로그-----");
  524. for(new i=1; i<=count2; i++)
  525. {
  526. AddMenuItem(menuhandle, "", Formatting4[i], ITEMDRAW_DISABLED);
  527. }
  528. SetMenuExitButton(menuhandle, true);
  529. DisplayMenu(menuhandle, Client, 10);
  530. }
  531. }
  532. return Plugin_Handled;
  533. }
  534.  
  535. public Action:LastAttackReport(Client, args)
  536. {
  537. if(!IsPlayerAlive(Client))
  538. {
  539. new String:Formatting[4096], count, bool:check;
  540. Formatting = AttackLog[Client];
  541. while(StrContains(Formatting, "�") != -1)
  542. {
  543. ReplaceStringEx(Formatting, 4096, "�", "");
  544. count++;
  545. check = true;
  546. }
  547. if(check)
  548. {
  549. Formatting = AttackLog[Client];
  550. new String:Formatting2[count+1][64];
  551. ExplodeString(Formatting, "�", Formatting2, count+1, 64);
  552. new Handle:menuhandle = CreateMenu(NULL_CallBack);
  553. SetMenuTitle(menuhandle, "-----데미지로그-----");
  554. for(new i=1; i<=count; i++)
  555. {
  556. AddMenuItem(menuhandle, "", Formatting2[i], ITEMDRAW_DISABLED);
  557. }
  558. SetMenuExitButton(menuhandle, true);
  559. DisplayMenu(menuhandle, Client, 10);
  560. }
  561. }
  562. else
  563. {
  564. new String:Formatting3[4096], count2, bool:check2;
  565. Formatting3 = LastAttackLog[Client];
  566. while(StrContains(Formatting3, "�") != -1)
  567. {
  568. ReplaceStringEx(Formatting3, 4096, "�", "");
  569. count2++;
  570. check2 = true;
  571. }
  572. if(check2)
  573. {
  574. Formatting3 = LastAttackLog[Client];
  575. new String:Formatting4[count2+1][64];
  576. ExplodeString(Formatting3, "�", Formatting4, count2+1, 64);
  577. new Handle:menuhandle = CreateMenu(NULL_CallBack);
  578. SetMenuTitle(menuhandle, "-----데미지로그-----");
  579. for(new i=1; i<=count2; i++)
  580. {
  581. AddMenuItem(menuhandle, "", Formatting4[i], ITEMDRAW_DISABLED);
  582. }
  583. SetMenuExitButton(menuhandle, true);
  584. DisplayMenu(menuhandle, Client, 10);
  585. }
  586. }
  587. return Plugin_Handled;
  588. }
  589.  
  590. public Action:BlockSuicide(Client, args)
  591. {
  592. if(TVirusTimer[Client] != INVALID_HANDLE)
  593. {
  594. return Plugin_Handled;
  595. }
  596. return Plugin_Continue;
  597. }
  598.  
  599. public Action:Command_Shop(Client, args)
  600. {
  601. MainShop(Client);
  602. return Plugin_Handled;
  603. }
  604.  
  605. public Action:Command_Point(Client, Args)
  606. {
  607. new String:AuthString[256];
  608. GetClientAuthString(Client, AuthString, 256);
  609. if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
  610. {
  611. PrintChat(Client, "Block");
  612. return Plugin_Handled;
  613. }
  614. new String:Player_Name[32], Target = -1, String:SMoney[256], count;
  615. GetCmdArg(1, Player_Name, sizeof(Player_Name));
  616. GetCmdArg(2, SMoney, 256);
  617.  
  618. for(new i=1; i <= MaxClients; i++)
  619. {
  620. if(JoinCheck(i))
  621. {
  622. new String:Other[32];
  623. GetClientName(i, Other, sizeof(Other));
  624. if(StrContains(Other, Player_Name, false) != -1)
  625. {
  626. Target = i;
  627. count++;
  628. }
  629. }
  630. }
  631.  
  632. if(Target == -1)
  633. {
  634. PrintChat(Client, "%s님을 찾을수 없습니다.", Player_Name);
  635. return Plugin_Handled;
  636. }
  637. if(count > 1)
  638. {
  639. PrintChat(Client, "%s라는 이름을 소유한 사람이 %i명입니다.", Player_Name, count);
  640. return Plugin_Handled;
  641. }
  642.  
  643. Point[Target] += StringToInt(SMoney);
  644. SavePoint(Target);
  645.  
  646. PrintChat(Client, "\x05%N님에게 %i포인트를 주었습니다.", Target, StringToInt(SMoney));
  647. PrintChat(Target, "\x05당신은 어드민에게 %i포인트를 받았습니다.", StringToInt(SMoney));
  648.  
  649. return Plugin_Handled;
  650. }
  651.  
  652. public Action:Command_Item(Client, Args)
  653. {
  654. new String:AuthString[256];
  655. GetClientAuthString(Client, AuthString, 256);
  656. if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
  657. {
  658. PrintChat(Client, "Block");
  659. return Plugin_Handled;
  660. }
  661. new String:Player_Name[32], Target = -1, String:SNumber[256], count;
  662. GetCmdArg(1, Player_Name, sizeof(Player_Name));
  663. GetCmdArg(2, SNumber, 256);
  664.  
  665. for(new i=1; i <= MaxClients; i++)
  666. {
  667. if(JoinCheck(i))
  668. {
  669. new String:Other[32];
  670. GetClientName(i, Other, sizeof(Other));
  671. if(StrContains(Other, Player_Name, false) != -1)
  672. {
  673. Target = i;
  674. count++;
  675. }
  676. }
  677. }
  678.  
  679. if(Target == -1)
  680. {
  681. PrintChat(Client, "%s님을 찾을수 없습니다.", Player_Name);
  682. return Plugin_Handled;
  683. }
  684. if(count > 1)
  685. {
  686. PrintChat(Client, "%s라는 이름을 소유한 사람이 %i명입니다.", Player_Name, count);
  687. return Plugin_Handled;
  688. }
  689.  
  690. new String:TargetSteamID[256], String:query[512];
  691. GetClientAuthString(Target, TargetSteamID, 256);
  692. Format(query, 512, "INSERT INTO inventory(steamid, idx, type) values ('%s', '%d', '%d');", TargetSteamID, StringToInt(SNumber), ItemType[StringToInt(SNumber)]);
  693. SQL_TQuery(databasehandle, save_info, query);
  694.  
  695. PrintChat(Client, "\x05%N님에게 %s를 주었습니다.", Target, ItemName[StringToInt(SNumber)]);
  696. PrintChat(Target, "\x05당신은 어드민에게 %s를 받았습니다.", ItemName[StringToInt(SNumber)]);
  697.  
  698. return Plugin_Handled;
  699. }
  700.  
  701. public Action:Command_PlayingTime(Client, Args)
  702. {
  703. new String:AuthString[256];
  704. GetClientAuthString(Client, AuthString, 256);
  705. if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
  706. {
  707. PrintChat(Client, "Block");
  708. return Plugin_Handled;
  709. }
  710. new String:Player_Name[32], Target = -1, String:SMoney[256], count;
  711. GetCmdArg(1, Player_Name, sizeof(Player_Name));
  712. GetCmdArg(2, SMoney, 256);
  713.  
  714. for(new i=1; i <= MaxClients; i++)
  715. {
  716. if(JoinCheck(i))
  717. {
  718. new String:Other[32];
  719. GetClientName(i, Other, sizeof(Other));
  720. if(StrContains(Other, Player_Name, false) != -1)
  721. {
  722. Target = i;
  723. count++;
  724. }
  725. }
  726. }
  727.  
  728. if(Target == -1)
  729. {
  730. PrintChat(Client, "%s님을 찾을수 없습니다.", Player_Name);
  731. return Plugin_Handled;
  732. }
  733. if(count > 1)
  734. {
  735. PrintChat(Client, "%s라는 이름을 소유한 사람이 %i명입니다.", Player_Name, count);
  736. return Plugin_Handled;
  737. }
  738.  
  739. PlayingTime[Target] = StringToFloat(SMoney);
  740.  
  741. return Plugin_Handled;
  742. }
  743.  
  744. public Action:Command_Query(Client, Args)
  745. {
  746. new String:AuthString[256];
  747. GetClientAuthString(Client, AuthString, 256);
  748. if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
  749. {
  750. PrintChat(Client, "Block");
  751. return Plugin_Handled;
  752. }
  753. new String:query[256];
  754. GetCmdArg(1, query, 256);
  755. SQL_TQuery(databasehandle, check_query, query, Client);
  756. return Plugin_Handled;
  757. }
  758.  
  759. public Action:Command_SearchVIP(Client, Args)
  760. {
  761. new String:AuthString[256];
  762. GetClientAuthString(Client, AuthString, 256);
  763. if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
  764. {
  765. PrintChat(Client, "Block");
  766. return Plugin_Handled;
  767. }
  768. SQL_TQuery(databasehandle, searchvip, "SELECT * FROM info WHERE vip = '1';", Client);
  769. return Plugin_Handled;
  770. }
  771.  
  772. public searchvip(Handle:owner, Handle:handle, const String:error[], any:Client)
  773. {
  774. new String:SteamID[256], String:Nick[256];
  775. if(handle == INVALID_HANDLE)
  776. {
  777. LogError("infocheck ERROR: %s", error);
  778. }
  779. else if(SQL_GetRowCount(handle))
  780. {
  781. new counted = SQL_GetRowCount(handle);
  782. if(counted > 0)
  783. {
  784. if(SQL_HasResultSet(handle))
  785. {
  786. while(SQL_FetchRow(handle))
  787. {
  788. SQL_FetchString(handle, 1, SteamID, 256);
  789. SQL_FetchString(handle, 2, Nick, 256);
  790. PrintChat(Client, "%s %s", SteamID, Nick);
  791. }
  792. }
  793. }
  794. }
  795. }
  796.  
  797. public Action:Command_FindInventoryToSteamID(Client, Args)
  798. {
  799. new String:AuthString[256];
  800. GetClientAuthString(Client, AuthString, 256);
  801. if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
  802. {
  803. PrintChat(Client, "Block");
  804. return Plugin_Handled;
  805. }
  806. new String:query[512], String:SteamID[256];
  807. GetCmdArg(1, SteamID, 256);
  808. Format(query, 512, "SELECT * FROM inventory WHERE steamid = '%s';", SteamID);
  809. SQL_TQuery(databasehandle, findinventory, query, Client);
  810. return Plugin_Handled;
  811. }
  812.  
  813. public Action:Command_ShopLog(Client, Args)
  814. {
  815. new String:AuthString[256];
  816. GetClientAuthString(Client, AuthString, 256);
  817. if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
  818. {
  819. PrintChat(Client, "Block");
  820. return Plugin_Handled;
  821. }
  822. GetCmdArg(1, LastSteamID[Client], 256);
  823. ShopLog_Year(Client, true);
  824. return Plugin_Handled;
  825. }
  826.  
  827. public findinventory(Handle:owner, Handle:hndl, const String:error[], any:Client)
  828. {
  829. if(hndl == INVALID_HANDLE)
  830. {
  831. PrintChat(Client, "\x03아무런 아이템을 가지고 있지 않으십니다.");
  832. return;
  833. }
  834. new count[MAX_ITEMS];
  835. new counted = SQL_GetRowCount(hndl);
  836. if(counted > 0)
  837. {
  838. if(SQL_HasResultSet(hndl))
  839. {
  840. while(SQL_FetchRow(hndl))
  841. {
  842. count[SQL_FetchInt(hndl, 2)] += 1;
  843. }
  844. }
  845. }
  846. for(new i; i < MAX_ITEMS; i++)
  847. {
  848. if(count[i] > 0)
  849. {
  850. PrintChat(Client, "%s(%i) - %i", ItemName[i], i, count[i]);
  851. }
  852. }
  853. }
  854.  
  855. public Action:Command_VIP(Client, Args)
  856. {
  857. if(Client)
  858. {
  859. new String:AuthString[256];
  860. GetClientAuthString(Client, AuthString, 256);
  861. if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
  862. {
  863. PrintChat(Client, "Block");
  864. return Plugin_Handled;
  865. }
  866. }
  867. new String:Player_Name[32], Target = -1, count, String:BuyHour[16];
  868. GetCmdArg(1, Player_Name, sizeof(Player_Name));
  869. GetCmdArg(2, BuyHour, sizeof(BuyHour));
  870.  
  871. for(new i=1; i <= MaxClients; i++)
  872. {
  873. if(JoinCheck(i))
  874. {
  875. new String:Other[32];
  876. GetClientName(i, Other, sizeof(Other));
  877. if(StrContains(Other, Player_Name, false) != -1)
  878. {
  879. Target = i;
  880. count++;
  881. }
  882. }
  883. }
  884.  
  885. if(Target == -1)
  886. {
  887. PrintChat(Client, "%s님을 찾을수 없습니다.", Player_Name);
  888. return Plugin_Handled;
  889. }
  890. if(count > 1)
  891. {
  892. PrintChat(Client, "%s라는 이름을 소유한 사람이 %i명입니다.", Player_Name, count);
  893. return Plugin_Handled;
  894. }
  895.  
  896. new String:sName[32], String:SteamID[256], String:query[512];
  897. GetClientName(Target, sName, 32);
  898. GetClientAuthString(Target, SteamID, 256);
  899.  
  900. if(!VIP[Target])
  901. {
  902. Format(query, 512, "UPDATE info SET vip = '1' WHERE steamid = '%s';", SteamID);
  903. SQL_TQuery(databasehandle, save_info, query, Target);
  904.  
  905. VIP[Target] = 1;
  906. new String:Time_Year[4], String:Time_Month[4], String:Time_Day[4], String:Time_Hour[4], String:Time_Minute[4], year, month, day, hour;
  907. FormatTime(Time_Year, 30, "%Y", GetTime());
  908. FormatTime(Time_Month, 30, "%m", GetTime());
  909. FormatTime(Time_Day, 30, "%d", GetTime());
  910. FormatTime(Time_Hour, 30, "%H", GetTime());
  911. FormatTime(Time_Minute, 30, "%M", GetTime());
  912. CalculateHour(StringToInt(Time_Year), StringToInt(Time_Month), StringToInt(Time_Day), StringToInt(Time_Hour), StringToInt(BuyHour), year, month, day, hour);
  913. VIP[Target] = 1;
  914.  
  915. Format(query, 512, "INSERT INTO vip(steamid, year, month, day, hour, minute) values ('%s', '%d', '%d', '%d', '%d', '%d');", SteamID, year, month, day, hour, StringToInt(Time_Minute));
  916. SQL_TQuery(databasehandle, save_info, query, Target);
  917.  
  918. Format(query, 512, "SELECT * FROM viptag WHERE steamid = '%s';", SteamID);
  919. SQL_TQuery(databasehandle, viptag_check, query, Target);
  920.  
  921. PrintChat(Target, "\x07FFFFFFYou become a VIP for %i hour \x07FF4040[until %i-%i-%i/%i:%i]", StringToInt(BuyHour), year, month, day, hour, StringToInt(Time_Minute));
  922.  
  923. ReplyToCommand(Client, "%s님에게 VIP를 줬습니다.", sName);
  924.  
  925. new String:steamid[256];
  926. GetClientAuthString(Target, steamid, 256);
  927. Format(query, 512, "SELECT * FROM viptag WHERE steamid = '%s';", steamid);
  928. SQL_TQuery(databasehandle, viptag_check, query, Target);
  929. }
  930. else
  931. {
  932. Format(query, 512, "UPDATE info SET vip = '0' WHERE steamid = '%s';", SteamID);
  933. SQL_TQuery(databasehandle, save_info, query, Target);
  934.  
  935. Format(query, 512, "DELETE FROM vip WHERE steamid = '%s';", SteamID);
  936. SQL_TQuery(databasehandle, save_info, query, Target);
  937. if(VIP[Target]) VIP[Target] = 0;
  938.  
  939. ReplyToCommand(Client, "%s님의 VIP를 뺏었습니다.", sName);
  940. PrintChat(Target, "Your VIP took away.");
  941.  
  942. Format(query, 512, "SELECT * FROM vip WHERE steamid = '%s';", SteamID);
  943. SQL_TQuery(databasehandle, vip_check, query, Target);
  944. }
  945.  
  946. return Plugin_Handled;
  947. }
  948.  
  949. public Action:Command_Credit(Client, Args)
  950. {
  951. new String:AuthString[256];
  952. GetClientAuthString(Client, AuthString, 256);
  953. if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
  954. {
  955. PrintChat(Client, "Block");
  956. return Plugin_Handled;
  957. }
  958. new String:Player_Name[32], Target = -1, count, String:Amount[256];
  959. GetCmdArg(1, Player_Name, 32);
  960. GetCmdArg(2, Amount, 256);
  961.  
  962. for(new i=1; i <= MaxClients; i++)
  963. {
  964. if(JoinCheck(i))
  965. {
  966. new String:Other[32];
  967. GetClientName(i, Other, sizeof(Other));
  968. if(StrContains(Other, Player_Name, false) != -1)
  969. {
  970. Target = i;
  971. count++;
  972. }
  973. }
  974. }
  975.  
  976. if(Target == -1)
  977. {
  978. PrintChat(Client, "%s님을 찾을수 없습니다.", Player_Name);
  979. return Plugin_Handled;
  980. }
  981. if(count > 1)
  982. {
  983. PrintChat(Client, "%s라는 이름을 소유한 사람이 %i명입니다.", Player_Name, count);
  984. return Plugin_Handled;
  985. }
  986. Credit[Target] += StringToInt(Amount);
  987. PrintChat(Client, "\x03%N님에게 %s만큼의 크레딧을 주었습니다.", Target, Amount);
  988. return Plugin_Handled;
  989. }
  990.  
  991. public Action:Command_Fun(Client, Args)
  992. {
  993. new String:AuthString[256];
  994. GetClientAuthString(Client, AuthString, 256);
  995. if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
  996. {
  997. PrintChat(Client, "Block");
  998. return Plugin_Handled;
  999. }
  1000. new String:Player_Name[32], Target = -1, count, String:Amount[256];
  1001. GetCmdArg(1, Player_Name, 32);
  1002. GetCmdArg(2, Amount, 256);
  1003.  
  1004. for(new i=1; i <= MaxClients; i++)
  1005. {
  1006. if(JoinCheck(i))
  1007. {
  1008. new String:Other[32];
  1009. GetClientName(i, Other, sizeof(Other));
  1010. if(StrContains(Other, Player_Name, false) != -1)
  1011. {
  1012. Target = i;
  1013. count++;
  1014. }
  1015. }
  1016. }
  1017.  
  1018. if(Target == -1)
  1019. {
  1020. PrintChat(Client, "%s님을 찾을수 없습니다.", Player_Name);
  1021. return Plugin_Handled;
  1022. }
  1023. if(count > 1)
  1024. {
  1025. PrintChat(Client, "%s라는 이름을 소유한 사람이 %i명입니다.", Player_Name, count);
  1026. return Plugin_Handled;
  1027. }
  1028. Fun[Target] = !Fun[Target];
  1029. return Plugin_Handled;
  1030. }
  1031.  
  1032. public Action:Command_Fun2(Client, Args)
  1033. {
  1034. new String:AuthString[256];
  1035. GetClientAuthString(Client, AuthString, 256);
  1036. if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
  1037. {
  1038. PrintChat(Client, "Block");
  1039. return Plugin_Handled;
  1040. }
  1041. new String:Player_Name[32], Target = -1, count, String:Amount[256];
  1042. GetCmdArg(1, Player_Name, 32);
  1043. GetCmdArg(2, Amount, 256);
  1044.  
  1045. for(new i=1; i <= MaxClients; i++)
  1046. {
  1047. if(JoinCheck(i))
  1048. {
  1049. new String:Other[32];
  1050. GetClientName(i, Other, sizeof(Other));
  1051. if(StrContains(Other, Player_Name, false) != -1)
  1052. {
  1053. Target = i;
  1054. count++;
  1055. }
  1056. }
  1057. }
  1058.  
  1059. if(Target == -1)
  1060. {
  1061. PrintChat(Client, "%s님을 찾을수 없습니다.", Player_Name);
  1062. return Plugin_Handled;
  1063. }
  1064. if(count > 1)
  1065. {
  1066. PrintChat(Client, "%s라는 이름을 소유한 사람이 %i명입니다.", Player_Name, count);
  1067. return Plugin_Handled;
  1068. }
  1069. Fun2[Target] = !Fun2[Target];
  1070. if(!Fun2[Target] && GetEntProp(Target, Prop_Send, "m_iFOV") < 90 && GetEntProp(Target, Prop_Send, "m_iFOV") > 0) ClientCommand(Target, "r_screenoverlay \"%s\"", "Effects/combine_binocoverlay.vmt");
  1071. else if(!Fun2[Target]) ClientCommand(Target, "r_screenoverlay \"\"");
  1072. return Plugin_Handled;
  1073. }
  1074.  
  1075. public Action:Command_Fun3(Client, Args)
  1076. {
  1077. new String:AuthString[256];
  1078. GetClientAuthString(Client, AuthString, 256);
  1079. if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
  1080. {
  1081. PrintChat(Client, "Block");
  1082. return Plugin_Handled;
  1083. }
  1084. new String:Player_Name[32], Target = -1, count, String:Amount[256];
  1085. GetCmdArg(1, Player_Name, 32);
  1086. GetCmdArg(2, Amount, 256);
  1087.  
  1088. for(new i=1; i <= MaxClients; i++)
  1089. {
  1090. if(JoinCheck(i))
  1091. {
  1092. new String:Other[32];
  1093. GetClientName(i, Other, sizeof(Other));
  1094. if(StrContains(Other, Player_Name, false) != -1)
  1095. {
  1096. Target = i;
  1097. count++;
  1098. }
  1099. }
  1100. }
  1101.  
  1102. if(Target == -1)
  1103. {
  1104. PrintChat(Client, "%s님을 찾을수 없습니다.", Player_Name);
  1105. return Plugin_Handled;
  1106. }
  1107. if(count > 1)
  1108. {
  1109. PrintChat(Client, "%s라는 이름을 소유한 사람이 %i명입니다.", Player_Name, count);
  1110. return Plugin_Handled;
  1111. }
  1112. EmitSoundToClient(Target, "tttmusic/fun3_fix.mp3");
  1113. return Plugin_Handled;
  1114. }
  1115.  
  1116. public Action:Command_Fun4(Client, Args)
  1117. {
  1118. new String:AuthString[256];
  1119. GetClientAuthString(Client, AuthString, 256);
  1120. if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
  1121. {
  1122. PrintChat(Client, "Block");
  1123. return Plugin_Handled;
  1124. }
  1125. new String:Player_Name[32], Target = -1, count, String:Amount[256];
  1126. GetCmdArg(1, Player_Name, 32);
  1127. GetCmdArg(2, Amount, 256);
  1128.  
  1129. for(new i=1; i <= MaxClients; i++)
  1130. {
  1131. if(JoinCheck(i))
  1132. {
  1133. new String:Other[32];
  1134. GetClientName(i, Other, sizeof(Other));
  1135. if(StrContains(Other, Player_Name, false) != -1)
  1136. {
  1137. Target = i;
  1138. count++;
  1139. }
  1140. }
  1141. }
  1142.  
  1143. if(Target == -1)
  1144. {
  1145. PrintChat(Client, "%s님을 찾을수 없습니다.", Player_Name);
  1146. return Plugin_Handled;
  1147. }
  1148. if(count > 1)
  1149. {
  1150. PrintChat(Client, "%s라는 이름을 소유한 사람이 %i명입니다.", Player_Name, count);
  1151. return Plugin_Handled;
  1152. }
  1153. Fun2[Target] = !Fun2[Target];
  1154. if(!Fun2[Target] && GetEntProp(Target, Prop_Send, "m_iFOV") < 90 && GetEntProp(Target, Prop_Send, "m_iFOV") > 0) ClientCommand(Target, "r_screenoverlay \"%s\"", "Effects/combine_binocoverlay.vmt");
  1155. else if(!Fun2[Target]) ClientCommand(Target, "r_screenoverlay \"\"");
  1156. if(Fun2[Target]) EmitSoundToClient(Target, "tttmusic/fun3_fix.mp3");
  1157. else StopSound(Target, SNDCHAN_AUTO, "tttmusic/fun3_fix.mp3");
  1158. return Plugin_Handled;
  1159. }
  1160.  
  1161. public Action:Command_Disguise(Client, Args)
  1162. {
  1163. new String:AuthString[256];
  1164. GetClientAuthString(Client, AuthString, 256);
  1165. if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
  1166. {
  1167. PrintChat(Client, "Block");
  1168. return Plugin_Handled;
  1169. }
  1170. new String:Player_Name[32], Target = -1, count, String:Amount[256];
  1171. GetCmdArg(1, Player_Name, 32);
  1172. GetCmdArg(2, Amount, 256);
  1173.  
  1174. for(new i=1; i <= MaxClients; i++)
  1175. {
  1176. if(JoinCheck(i))
  1177. {
  1178. new String:Other[32];
  1179. GetClientName(i, Other, sizeof(Other));
  1180. if(StrContains(Other, Player_Name, false) != -1)
  1181. {
  1182. Target = i;
  1183. count++;
  1184. }
  1185. }
  1186. }
  1187.  
  1188. if(Target == -1)
  1189. {
  1190. PrintChat(Client, "%s님을 찾을수 없습니다.", Player_Name);
  1191. return Plugin_Handled;
  1192. }
  1193. if(count > 1)
  1194. {
  1195. PrintChat(Client, "%s라는 이름을 소유한 사람이 %i명입니다.", Player_Name, count);
  1196. return Plugin_Handled;
  1197. }
  1198. IsDisguise[Target] = !IsDisguise[Target];
  1199. return Plugin_Handled;
  1200. }
  1201.  
  1202. public Action:Command_Armor(Client, Args)
  1203. {
  1204. new String:AuthString[256];
  1205. GetClientAuthString(Client, AuthString, 256);
  1206. if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
  1207. {
  1208. PrintChat(Client, "Block");
  1209. return Plugin_Handled;
  1210. }
  1211. new String:Player_Name[32], Target = -1, count, String:Amount[256];
  1212. GetCmdArg(1, Player_Name, 32);
  1213. GetCmdArg(2, Amount, 256);
  1214.  
  1215. for(new i=1; i <= MaxClients; i++)
  1216. {
  1217. if(JoinCheck(i))
  1218. {
  1219. new String:Other[32];
  1220. GetClientName(i, Other, sizeof(Other));
  1221. if(StrContains(Other, Player_Name, false) != -1)
  1222. {
  1223. Target = i;
  1224. count++;
  1225. }
  1226. }
  1227. }
  1228.  
  1229. if(Target == -1)
  1230. {
  1231. PrintChat(Client, "%s님을 찾을수 없습니다.", Player_Name);
  1232. return Plugin_Handled;
  1233. }
  1234. if(count > 1)
  1235. {
  1236. PrintChat(Client, "%s라는 이름을 소유한 사람이 %i명입니다.", Player_Name, count);
  1237. return Plugin_Handled;
  1238. }
  1239. SetEntProp(Target, Prop_Data, "m_ArmorValue", 9999);
  1240. return Plugin_Handled;
  1241. }
  1242.  
  1243. public Action:Command_TVirus(Client, Args)
  1244. {
  1245. new String:AuthString[256];
  1246. GetClientAuthString(Client, AuthString, 256);
  1247. if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
  1248. {
  1249. PrintChat(Client, "Block");
  1250. return Plugin_Handled;
  1251. }
  1252. new String:Player_Name[32], Target = -1, count, String:Amount[256];
  1253. GetCmdArg(1, Player_Name, 32);
  1254. GetCmdArg(2, Amount, 256);
  1255.  
  1256. for(new i=1; i <= MaxClients; i++)
  1257. {
  1258. if(JoinCheck(i))
  1259. {
  1260. new String:Other[32];
  1261. GetClientName(i, Other, sizeof(Other));
  1262. if(StrContains(Other, Player_Name, false) != -1)
  1263. {
  1264. Target = i;
  1265. count++;
  1266. }
  1267. }
  1268. }
  1269.  
  1270. if(Target == -1)
  1271. {
  1272. PrintChat(Client, "%s님을 찾을수 없습니다.", Player_Name);
  1273. return Plugin_Handled;
  1274. }
  1275. if(count > 1)
  1276. {
  1277. PrintChat(Client, "%s라는 이름을 소유한 사람이 %i명입니다.", Player_Name, count);
  1278. return Plugin_Handled;
  1279. }
  1280. if(TVirusTimer[Target] == INVALID_HANDLE)
  1281. {
  1282. CreateTimer(20.0, GreenFade, Target);
  1283. new Handle:pack = CreateDataPack();
  1284. WritePackCell(pack, Target);
  1285. WritePackCell(pack, Client);
  1286. TVirusTimer[Target] = CreateTimer(25.0, YouAreZombie, pack, TIMER_DATA_HNDL_CLOSE);
  1287. }
  1288. return Plugin_Handled;
  1289. }
  1290.  
  1291. public Action:Command_Receive_Cheat(Client, Args)
  1292. {
  1293. new String:AuthString[256];
  1294. GetClientAuthString(Client, AuthString, 256);
  1295. if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
  1296. {
  1297. PrintChat(Client, "Block");
  1298. return Plugin_Handled;
  1299. }
  1300. SendConVarValue(Client, FindConVar("sv_cheats"), "1");
  1301. return Plugin_Handled;
  1302. }
  1303.  
  1304. public Action:Command_Diamond(Client, args)
  1305. {
  1306. new String:AuthString[256], String:CurrentMap[128];
  1307. GetClientAuthString(Client, AuthString, 256);
  1308. GetCurrentMap(CurrentMap, 128);
  1309. if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
  1310. {
  1311. PrintChat(Client, "Block");
  1312. return Plugin_Handled;
  1313. }
  1314. decl Float:pos[3], Float:angle[3];
  1315. GetClientEyePosition(Client, pos);
  1316. GetClientEyeAngles(Client, angle);
  1317.  
  1318. new Handle:traceresulthandle = INVALID_HANDLE;
  1319. if(!IsPlayerAlive(Client) && GetEntProp(Client, Prop_Send, "m_iObserverMode")==4) traceresulthandle = TR_TraceRayFilterEx(pos, angle, MASK_SOLID, RayType_Infinite, tracerayfilterdefault, GetEntPropEnt(Client, Prop_Send, "m_hObserverTarget"));
  1320. else traceresulthandle = TR_TraceRayFilterEx(pos, angle, MASK_SOLID, RayType_Infinite, tracerayfilterdefault, Client);
  1321.  
  1322. new Float:resultposition[3], count;
  1323. if(TR_DidHit(traceresulthandle) == true)
  1324. {
  1325. TR_GetEndPosition(resultposition, traceresulthandle);
  1326. for(new i; i < GetMaxEntities(); i++)
  1327. {
  1328. if(IsValidEdict(i))
  1329. {
  1330. if(IsValidEntity(i))
  1331. {
  1332. new String:iName[256], String:ClassName[32];
  1333. GetEntPropString(i, Prop_Data, "m_iName", iName, 256);
  1334. GetEdictClassname(i, ClassName, 32);
  1335. if(StrEqual(CurrentMap, "ttt_mine_craft_b4"))
  1336. {
  1337. if(!StrContains(iName, "DiaOre_"))
  1338. {
  1339. count++;
  1340. PrintChatAll("%i.%s", count, iName);
  1341. TeleportEntity(i, resultposition, NULL_VECTOR, NULL_VECTOR);
  1342. }
  1343. }
  1344. /*
  1345. else
  1346. {
  1347. if(!StrContains(ClassName, "prop") && count < 30)
  1348. {
  1349. count++;
  1350. TeleportEntity(i, resultposition, NULL_VECTOR, NULL_VECTOR);
  1351. }
  1352. }
  1353. */
  1354. }
  1355. }
  1356. }
  1357. }
  1358. CloseHandle(traceresulthandle);
  1359. return Plugin_Handled;
  1360. }
  1361.  
  1362. public Action:Command_WeaponMenu(Client, args)
  1363. {
  1364. WeaponMenu(Client);
  1365. return Plugin_Handled;
  1366. }
  1367.  
  1368. public Action:Command_WeaponList(Client, args)
  1369. {
  1370. new String:CurrentMap[256], String:weaponname[256], String:buffer[256], Float:spawnposition[3];
  1371. GetCurrentMap(CurrentMap, 256);
  1372. new Handle:kv = CreateKeyValues("TTTWeapons");
  1373. FileToKeyValues(kv, Path);
  1374. KvGotoFirstSubKey(kv);
  1375. do
  1376. {
  1377. KvGetSectionName(kv, buffer, sizeof(buffer));
  1378. if(StrEqual(buffer, CurrentMap, false))
  1379. {
  1380. KvJumpToKey(kv, CurrentMap, false);
  1381. KvGotoFirstSubKey(kv);
  1382. do
  1383. {
  1384. KvGetSectionName(kv, buffer, sizeof(buffer));
  1385. KvGetString(kv, "weapon2", weaponname, 256, "NULL");
  1386. KvGetVector(kv, "weapon", spawnposition);
  1387. if(!StrEqual(weaponname, "NULL", false))
  1388. {
  1389. ReplaceStringEx(buffer, 256, CurrentMap, "");
  1390. PrintChat(Client, "\x05%s. %s : %.1f %.1f %.1f", buffer, weaponname, spawnposition[0], spawnposition[1], spawnposition[2]);
  1391. }
  1392. }while(KvGotoNextKey(kv));
  1393. break;
  1394. }
  1395. }while(KvGotoNextKey(kv));
  1396. KvRewind(kv);
  1397. CloseHandle(kv);
  1398. }
  1399.  
  1400. public Action:Command_WeaponDelete(Client, args)
  1401. {
  1402. new String:CurrentMap[256], String:buffer[256], String:WeaponNumber[256], String:Formatting[256];
  1403. GetCurrentMap(CurrentMap, 256);
  1404. GetCmdArg(1, WeaponNumber, sizeof(WeaponNumber));
  1405. new Handle:kv = CreateKeyValues("TTTWeapons");
  1406. FileToKeyValues(kv, Path);
  1407. KvGotoFirstSubKey(kv);
  1408. do
  1409. {
  1410. KvGetSectionName(kv, buffer, sizeof(buffer));
  1411. if(StrEqual(buffer, CurrentMap, false))
  1412. {
  1413. KvJumpToKey(kv, CurrentMap, false);
  1414. KvGotoFirstSubKey(kv);
  1415. do
  1416. {
  1417. KvGetSectionName(kv, buffer, sizeof(buffer));
  1418. if(StrEqual(buffer, WeaponNumber, false))
  1419. {
  1420. KvJumpToKey(kv, buffer, false);
  1421. KvDeleteKey(kv, "weapon");
  1422. KvDeleteKey(kv, "weapon2");
  1423. KvRewind(kv);
  1424. KvDeleteKey(kv, Formatting);
  1425. break;
  1426. }
  1427. }while(KvGotoNextKey(kv));
  1428. break;
  1429. }
  1430. }while(KvGotoNextKey(kv));
  1431. KvRewind(kv);
  1432. KeyValuesToFile(kv, Path);
  1433. CloseHandle(kv);
  1434. }
  1435.  
  1436. public Action:Command_Job(Client, Arguments)
  1437. {
  1438. new String:Player_Name[32], String:JobNumber[32], Target = -1;
  1439. GetCmdArg(1, Player_Name, sizeof(Player_Name));
  1440. GetCmdArg(2, JobNumber, sizeof(JobNumber));
  1441.  
  1442. for(new i=1; i <= MaxClients; i++)
  1443. {
  1444. if(JoinCheck(i))
  1445. {
  1446. new String:Other[32];
  1447. GetClientName(i, Other, sizeof(Other));
  1448. if(StrContains(Other, Player_Name, false) != -1)
  1449. {
  1450. Target = i;
  1451. }
  1452. }
  1453. }
  1454.  
  1455. if(Target == -1)
  1456. {
  1457. return Plugin_Handled;
  1458. }
  1459.  
  1460. Job[Target] = StringToInt(JobNumber);
  1461. return Plugin_Handled;
  1462. }
  1463.  
  1464. public Action:Command_Spectator(Client, Arguments)
  1465. {
  1466. new String:Player_Name[32], String:JobNumber[32], Target = -1, count;
  1467. GetCmdArg(1, Player_Name, sizeof(Player_Name));
  1468. GetCmdArg(2, JobNumber, sizeof(JobNumber));
  1469.  
  1470. new String:Client_Name[32], String:Client_Number[3];
  1471. new Handle:menuhandle = INVALID_HANDLE;
  1472. for(new i=1; i <= MaxClients; i++)
  1473. {
  1474. if(JoinCheck(i))
  1475. {
  1476. new String:Other[32];
  1477. GetClientName(i, Other, sizeof(Other));
  1478. if(StrContains(Other, Player_Name, false) != -1)
  1479. {
  1480. if(count == 1)
  1481. {
  1482. menuhandle = CreateMenu(SendSpectator_CallBack);
  1483. SetMenuTitle(menuhandle, "Send Spectator");
  1484. IntToString(Target, Client_Number, sizeof(Client_Number));
  1485. GetClientName(Target, Client_Name, sizeof(Client_Name));
  1486. AddMenuItem(menuhandle, Client_Number, Client_Name);
  1487. }
  1488. if(count >= 1)
  1489. {
  1490. IntToString(i, Client_Number, sizeof(Client_Number));
  1491. GetClientName(i, Client_Name, sizeof(Client_Name));
  1492. AddMenuItem(menuhandle, Client_Number, Client_Name);
  1493. }
  1494. Target = i;
  1495. count++;
  1496. }
  1497. }
  1498. }
  1499. if(menuhandle != INVALID_HANDLE)
  1500. {
  1501. SetMenuExitButton(menuhandle, true);
  1502. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  1503. }
  1504.  
  1505. if(!count) PrintChat(Client, "[관전으로 보내기]일치하는 대상이 없습니다,");
  1506. else if(count == 1)
  1507. {
  1508. makeDamage(Target, Target, 999, (1<<17), 1.0, NULL_VECTOR, "");
  1509. ChangeClientTeam(Target, 1);
  1510. }
  1511. if(count == 2) PrintChat(Client, "[관전으로 보내기]대상을 골라주세요.,");
  1512. return Plugin_Handled;
  1513. }
  1514.  
  1515. public SendSpectator_CallBack(Handle:menu, MenuAction:action, Client, select)
  1516. {
  1517. if(action == MenuAction_Select)
  1518. {
  1519. new String:stringnumber[3];
  1520. GetMenuItem(menu, select, stringnumber, sizeof(stringnumber));
  1521. if(JoinCheck(StringToInt(stringnumber)))
  1522. {
  1523. if(IsPlayerAlive(StringToInt(stringnumber))) makeDamage(StringToInt(stringnumber), StringToInt(stringnumber), 999, (1<<17), 1.0, NULL_VECTOR, "");
  1524. ChangeClientTeam(StringToInt(stringnumber), 1);
  1525. }
  1526. }
  1527. if(action == MenuAction_End)
  1528. {
  1529. CloseHandle(menu);
  1530. }
  1531. }
  1532.  
  1533. public Action:Command_CreateSpawn(Client,args)
  1534. {
  1535. new String:AuthString[256];
  1536. GetClientAuthString(Client, AuthString, 256);
  1537. if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
  1538. {
  1539. PrintChat(Client, "Block");
  1540. return Plugin_Handled;
  1541. }
  1542.  
  1543. new String:Position1[32], String:Position2[32], String:Position3[32], Float:Vector[3];
  1544. GetCmdArg(1, Position1, 32);
  1545. GetCmdArg(2, Position2, 32);
  1546. GetCmdArg(3, Position3, 32);
  1547. Vector[0] = StringToFloat(Position1);
  1548. Vector[1] = StringToFloat(Position2);
  1549. Vector[2] = StringToFloat(Position3);
  1550.  
  1551. new String:CurrentMap[256];
  1552. GetCurrentMap(CurrentMap, 256);
  1553. new Handle:kv= CreateKeyValues("TTTSpawns");
  1554. if(FileExists(Path2))
  1555. {
  1556. FileToKeyValues(kv, Path2);
  1557. }
  1558. new String:LastBuffer[256];
  1559. KvGotoFirstSubKey(kv);
  1560. do
  1561. {
  1562. new String:buffer[256];
  1563. KvGetSectionName(kv, buffer, sizeof(buffer));
  1564. if(StrEqual(buffer, CurrentMap, false))
  1565. {
  1566. KvJumpToKey(kv, CurrentMap, false);
  1567. KvGotoFirstSubKey(kv);
  1568. do
  1569. {
  1570. KvGetSectionName(kv, buffer, sizeof(buffer));
  1571. LastBuffer = buffer;
  1572. }
  1573. while(KvGotoNextKey(kv));
  1574. break;
  1575. }
  1576. }while(KvGotoNextKey(kv));
  1577. KvRewind(kv);
  1578. KvJumpToKey(kv, CurrentMap, true);
  1579. ReplaceStringEx(LastBuffer, 256, CurrentMap, "");
  1580. new Count = StringToInt(LastBuffer);
  1581. Format(LastBuffer, 256, "%i", Count+1);
  1582. KvJumpToKey(kv, LastBuffer, true);
  1583. KvSetVector(kv, "position", Vector);
  1584. KvSetString(kv, "info", "info_player_terrorist");
  1585. KvRewind(kv);
  1586. KeyValuesToFile(kv, Path2);
  1587. CloseHandle(kv);
  1588. return Plugin_Handled;
  1589. }
  1590.  
  1591. public Action:Command_SpawnList(Client, args)
  1592. {
  1593. new String:CurrentMap[256], String:buffer[256], String:classname[32], Float:spawnposition[3];
  1594. GetCurrentMap(CurrentMap, 256);
  1595. new Handle:kv = CreateKeyValues("TTTSpawns");
  1596. FileToKeyValues(kv, Path2);
  1597. KvGotoFirstSubKey(kv);
  1598. do
  1599. {
  1600. KvGetSectionName(kv, buffer, sizeof(buffer));
  1601. if(StrEqual(buffer, CurrentMap, false))
  1602. {
  1603. KvJumpToKey(kv, CurrentMap, false);
  1604. KvGotoFirstSubKey(kv);
  1605. do
  1606. {
  1607. KvGetSectionName(kv, buffer, sizeof(buffer));
  1608. KvGetString(kv, "info", classname, 256, "NULL");
  1609. KvGetVector(kv, "position", spawnposition);
  1610. if(!StrEqual(classname, "NULL", false))
  1611. {
  1612. ReplaceStringEx(buffer, 256, CurrentMap, "");
  1613. PrintChat(Client, "\x05%s. %.1f %.1f %.1f", buffer, spawnposition[0], spawnposition[1], spawnposition[2]);
  1614. }
  1615. }while(KvGotoNextKey(kv));
  1616. break;
  1617. }
  1618. }while(KvGotoNextKey(kv));
  1619. KvRewind(kv);
  1620. CloseHandle(kv);
  1621. }
  1622.  
  1623. public Action:Command_SpawnDelete(Client, args)
  1624. {
  1625. new String:CurrentMap[256], String:buffer[256], String:StringNumber[256];
  1626. GetCurrentMap(CurrentMap, 256);
  1627. GetCmdArg(1, StringNumber, 256);
  1628. new Handle:kv = CreateKeyValues("TTTSpawns");
  1629. FileToKeyValues(kv, Path2);
  1630. KvGotoFirstSubKey(kv);
  1631. do
  1632. {
  1633. KvGetSectionName(kv, buffer, sizeof(buffer));
  1634. if(StrEqual(buffer, CurrentMap, false))
  1635. {
  1636. KvJumpToKey(kv, CurrentMap, false);
  1637. KvGotoFirstSubKey(kv);
  1638. do
  1639. {
  1640. KvGetSectionName(kv, buffer, sizeof(buffer));
  1641. if(StrEqual(buffer, StringNumber, false))
  1642. {
  1643. KvJumpToKey(kv, buffer, false);
  1644. KvDeleteKey(kv, "info");
  1645. KvDeleteKey(kv, "position");
  1646. KvRewind(kv);
  1647. break;
  1648. }
  1649. }while(KvGotoNextKey(kv));
  1650. break;
  1651. }
  1652. }while(KvGotoNextKey(kv));
  1653. KvRewind(kv);
  1654. KeyValuesToFile(kv, Path2);
  1655. CloseHandle(kv);
  1656. }
  1657.  
  1658. public Action:Command_CreateLadder(Client, args)
  1659. {
  1660. new String:AuthString[256];
  1661. GetClientAuthString(Client, AuthString, 256);
  1662. if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
  1663. {
  1664. PrintChat(Client, "Block");
  1665. return Plugin_Handled;
  1666. }
  1667. LadderMake(Client);
  1668. GetClientAbsOrigin(Client, StartPos);
  1669. Zone_Timer[Client] = CreateTimer(0.1, DrawZone, Client, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
  1670. return Plugin_Handled;
  1671. }
  1672.  
  1673. public LadderMake(Client)
  1674. {
  1675. new Handle:menuhandle = CreateMenu(LadderMake_CallBack);
  1676. SetMenuTitle(menuhandle, "make ladder here?");
  1677. AddMenuItem(menuhandle, "", "Yes");
  1678. AddMenuItem(menuhandle, "", "No");
  1679. SetMenuExitButton(menuhandle, false);
  1680. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  1681. }
  1682.  
  1683. public LadderMake_CallBack(Handle:menu, MenuAction:action, Client, select)
  1684. {
  1685. if(action == MenuAction_Select)
  1686. {
  1687. if(select)
  1688. {
  1689. KillTimer(Zone_Timer[Client]);
  1690. PrintChat(Client, "Canceled");
  1691. }
  1692. else
  1693. {
  1694. new Float:EndPos[3];
  1695. GetClientAbsOrigin(Client, EndPos);
  1696. CreateLadder(Client, StartPos, EndPos);
  1697. KillTimer(Zone_Timer[Client]);
  1698. PrintChat(Client, "Complete to make");
  1699. }
  1700. }
  1701. if(action == MenuAction_End)
  1702. {
  1703. CloseHandle(menu);
  1704. }
  1705. }
  1706.  
  1707. public CreateLadder(Client, Float:Vector[3], Float:Vector2[3])
  1708. {
  1709. new String:CurrentMap[256];
  1710. GetCurrentMap(CurrentMap, 256);
  1711. new Handle:kv= CreateKeyValues("TTTLadders");
  1712. if(FileExists(Path3))
  1713. {
  1714. FileToKeyValues(kv, Path3);
  1715. }
  1716. new String:LastBuffer[256];
  1717. KvGotoFirstSubKey(kv);
  1718. do
  1719. {
  1720. new String:buffer[256];
  1721. KvGetSectionName(kv, buffer, sizeof(buffer));
  1722. if(StrEqual(buffer, CurrentMap, false))
  1723. {
  1724. KvJumpToKey(kv, CurrentMap, false);
  1725. KvGotoFirstSubKey(kv);
  1726. do
  1727. {
  1728. KvGetSectionName(kv, buffer, sizeof(buffer));
  1729. LastBuffer = buffer;
  1730. }
  1731. while(KvGotoNextKey(kv));
  1732. break;
  1733. }
  1734. }while(KvGotoNextKey(kv));
  1735. KvRewind(kv);
  1736. KvJumpToKey(kv, CurrentMap, true);
  1737. ReplaceStringEx(LastBuffer, 256, CurrentMap, "");
  1738. new Count = StringToInt(LastBuffer);
  1739. Format(LastBuffer, 256, "%i", Count+1);
  1740. KvJumpToKey(kv, LastBuffer, true);
  1741. KvSetVector(kv, "position", Vector);
  1742. KvSetVector(kv, "position2", Vector2);
  1743. KvSetString(kv, "info", "ladder");
  1744. KvRewind(kv);
  1745. KeyValuesToFile(kv, Path3);
  1746. CloseHandle(kv);
  1747.  
  1748. new Float:origin[3], Float:mins[3], Float:maxs[3];
  1749. origin[0] = (Vector[0]+Vector2[0])/2.0;
  1750. origin[1] = (Vector[1]+Vector2[1])/2.0;
  1751. origin[2] = (Vector[2]+Vector2[2])/2.0;
  1752. maxs[0] = FloatAbs(Vector[0]-Vector2[0])/2.0;
  1753. maxs[1] = FloatAbs(Vector[1]-Vector2[1])/2.0;
  1754. maxs[2] = FloatAbs(Vector[2]-Vector2[2])/2.0;
  1755. mins[0] = -maxs[0];
  1756. mins[1] = -maxs[1];
  1757. mins[2] = -maxs[2];
  1758.  
  1759. new entity = CreateEntityByName("trigger_multiple");
  1760. DispatchKeyValue(entity, "spawnflags", "1");
  1761. DispatchKeyValue(entity, "targetname", "ladder");
  1762. DispatchSpawn(entity);
  1763. ActivateEntity(entity);
  1764. TeleportEntity(entity, origin, NULL_VECTOR, NULL_VECTOR);
  1765.  
  1766. //PrecacheModel("models/props/cs_office/vending_machine.mdl", true);
  1767. //SetEntityModel(entity, "models/props/cs_office/vending_machine.mdl");
  1768. SetEntityModel(entity, "models/props/cs_italy/orange.mdl");
  1769.  
  1770. SetEntPropVector(entity, Prop_Send, "m_vecMins", mins);
  1771. SetEntPropVector(entity, Prop_Send, "m_vecMaxs", maxs);
  1772.  
  1773. //노블럭
  1774. SetEntProp(entity, Prop_Send, "m_nSolidType", 2);
  1775. }
  1776.  
  1777. public Action:Command_LadderList(Client, args)
  1778. {
  1779. new String:CurrentMap[256], String:buffer[256], String:classname[32], Float:spawnposition[3], Float:spawnposition2[3];
  1780. GetCurrentMap(CurrentMap, 256);
  1781. new Handle:kv = CreateKeyValues("TTTLadders");
  1782. FileToKeyValues(kv, Path3);
  1783. KvGotoFirstSubKey(kv);
  1784. do
  1785. {
  1786. KvGetSectionName(kv, buffer, sizeof(buffer));
  1787. if(StrEqual(buffer, CurrentMap, false))
  1788. {
  1789. KvJumpToKey(kv, CurrentMap, false);
  1790. KvGotoFirstSubKey(kv);
  1791. do
  1792. {
  1793. KvGetSectionName(kv, buffer, sizeof(buffer));
  1794. KvGetString(kv, "info", classname, 256, "NULL");
  1795. KvGetVector(kv, "position", spawnposition);
  1796. KvGetVector(kv, "position2", spawnposition2);
  1797. if(!StrEqual(classname, "NULL", false))
  1798. {
  1799. ReplaceStringEx(buffer, 256, CurrentMap, "");
  1800. PrintChat(Client, "\x05%s. %.1f %.1f %.1f - %.1f %.1f %.1f", buffer, spawnposition[0], spawnposition[1], spawnposition[2], spawnposition2[0], spawnposition2[1], spawnposition2[2]);
  1801. }
  1802. }while(KvGotoNextKey(kv));
  1803. break;
  1804. }
  1805. }while(KvGotoNextKey(kv));
  1806. KvRewind(kv);
  1807. CloseHandle(kv);
  1808. }
  1809.  
  1810. public Action:Command_LadderDelete(Client, args)
  1811. {
  1812. new String:CurrentMap[256], String:buffer[256], String:StringNumber[256];
  1813. GetCurrentMap(CurrentMap, 256);
  1814. GetCmdArg(1, StringNumber, 256);
  1815. new Handle:kv = CreateKeyValues("TTTLadders");
  1816. FileToKeyValues(kv, Path3);
  1817. KvGotoFirstSubKey(kv);
  1818. do
  1819. {
  1820. KvGetSectionName(kv, buffer, sizeof(buffer));
  1821. if(StrEqual(buffer, CurrentMap, false))
  1822. {
  1823. KvJumpToKey(kv, CurrentMap, false);
  1824. KvGotoFirstSubKey(kv);
  1825. do
  1826. {
  1827. KvGetSectionName(kv, buffer, sizeof(buffer));
  1828. if(StrEqual(buffer, StringNumber, false))
  1829. {
  1830. KvJumpToKey(kv, buffer, false);
  1831. KvDeleteKey(kv, "info");
  1832. KvDeleteKey(kv, "position");
  1833. KvDeleteKey(kv, "position2");
  1834. KvRewind(kv);
  1835. break;
  1836. }
  1837. }while(KvGotoNextKey(kv));
  1838. break;
  1839. }
  1840. }while(KvGotoNextKey(kv));
  1841. KvRewind(kv);
  1842. KeyValuesToFile(kv, Path3);
  1843. CloseHandle(kv);
  1844. }
  1845.  
  1846. public Action:NightVision(Client, args)
  1847. {
  1848. if(IsPlayerAlive(Client))
  1849. {
  1850. CreditShop(Client);
  1851. }
  1852. }
  1853.  
  1854. public Action:autobuy(Client, const String:command[], arg)
  1855. {
  1856. MainMenu(Client);
  1857. }
  1858.  
  1859. public Action:rebuy(Client, const String:command[], arg)
  1860. {
  1861. MainShop(Client);
  1862. }
  1863.  
  1864. public Action:commandmenu(Client, const String:command[], arg)
  1865. {
  1866. if(Disguise[Client])
  1867. {
  1868. if(!IsDisguise[Client])
  1869. {
  1870. IsDisguise[Client] = true;
  1871. PrintChat(Client, "\x073A3AC5%T %T", "Disguise", Client, "on", Client);
  1872. }
  1873. else
  1874. {
  1875. IsDisguise[Client] = false;
  1876. PrintChat(Client, "\x073A3AC5%T %T", "Disguise", Client, "off", Client);
  1877. }
  1878. }
  1879. }
  1880.  
  1881. public Action:cheer(Client, const String:command[], arg)
  1882. {
  1883. decl Float:pos[3], Float:angle[3];
  1884. GetClientEyePosition(Client, pos);
  1885. GetClientEyeAngles(Client, angle);
  1886.  
  1887. new Handle:traceresulthandle = INVALID_HANDLE;
  1888. traceresulthandle = TR_TraceRayFilterEx(pos, angle, MASK_SOLID, RayType_Infinite, tracerayfilternoplayer, Client);
  1889.  
  1890. if(TR_DidHit(traceresulthandle) == true)
  1891. {
  1892. new Entity = TR_GetEntityIndex(traceresulthandle);
  1893. new Float:entityposition[3], String:TargetName[256], String:classname[256];
  1894. GetEntPropVector(Entity, Prop_Send, "m_vecOrigin", entityposition);
  1895. GetEntPropString(Entity, Prop_Data, "m_iName", TargetName, 256);
  1896. GetEdictClassname(Entity, classname, 256);
  1897. entityposition[2] += 60.0;
  1898. if((IsPlayerAlive(Client) &&GetVectorDistance(pos, entityposition) <= 200.0) || !IsPlayerAlive(Client))
  1899. {
  1900. if(StrEqual(classname, "prop_ragdoll", false))
  1901. {
  1902. CheckDeadBody(Client, Entity, 0);
  1903. }
  1904. }
  1905. }
  1906. CloseHandle(traceresulthandle);
  1907. return Plugin_Handled;
  1908. }
  1909.  
  1910. public Action:SetTransmit_CallBack(entity, viewer)
  1911. {
  1912. if(viewer > 0 && viewer <= MaxClients)
  1913. {
  1914. new owner = GetEntPropEnt(entity, Prop_Send, "m_hOwnerEntity");
  1915. new weapons = GetEntPropEnt(viewer, Prop_Send, "m_hActiveWeapon");
  1916. if(owner == viewer && weapons == GetPlayerWeaponSlot(viewer, 2))
  1917. return Plugin_Handled;
  1918. }
  1919. return Plugin_Continue;
  1920. }
  1921.  
  1922. public FastChat(Client)
  1923. {
  1924. new Handle:panel = CreatePanel(), String:Translate_Formatting[256], String:TargetName[256];
  1925. SetPanelKeys(panel, (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9));
  1926. Format(Translate_Formatting, 256, "%T", "Quickchat keys", Client);
  1927. SetPanelTitle(panel, Translate_Formatting);
  1928. Format(Translate_Formatting, 256, "\"%T\"", "Yes", Client);
  1929. DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
  1930. Format(Translate_Formatting, 256, "\"%T\"", "No", Client);
  1931. DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
  1932. Format(Translate_Formatting, 256, "\"%T\"", "Help", Client);
  1933. DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
  1934.  
  1935. if(JoinCheck(MenuLastMan[Client]))
  1936. {
  1937. GetClientName(MenuLastMan[Client], TargetName, 256);
  1938. Format(Translate_Formatting, 256, "\"%T\"", "I'm with person", Client, TargetName);
  1939. DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
  1940. Format(Translate_Formatting, 256, "\"%T\"", "person is a Traitor", Client, TargetName);
  1941. DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
  1942. Format(Translate_Formatting, 256, "\"%T\"", "person acts suspicious", Client, TargetName);
  1943. DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
  1944. }
  1945. else
  1946. {
  1947. Format(Translate_Formatting, 256, "\"%T\"", "I'm with someone", Client);
  1948. DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
  1949. Format(Translate_Formatting, 256, "\"%T\"", "someone is a Traitor", Client);
  1950. DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
  1951. Format(Translate_Formatting, 256, "\"%T\"", "someone acts suspicious", Client);
  1952. DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
  1953. }
  1954. Format(Translate_Formatting, 256, "\"%T\"", "Anyone still alive", Client);
  1955. DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
  1956. Format(Translate_Formatting, 256, "\"%T\"", "I got something", Client);
  1957. DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
  1958. Format(Translate_Formatting, 256, "\"%T\"", "I bought something", Client);
  1959. DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
  1960. DrawPanelItem(panel, "종료", ITEMDRAW_CONTROL);
  1961. SendPanelToClient(panel, Client, FastChat_CallBack, 1);
  1962. CloseHandle(panel);
  1963. CreateTimer(0.1, MenuRemove, Client);
  1964. }
  1965.  
  1966. public FastChat_CallBack(Handle:menu, MenuAction:action, Client, select)
  1967. {
  1968. if(action == MenuAction_Select)
  1969. {
  1970. if(select != 10) EmitSoundToClient(Client, "buttons/button14.wav");
  1971. else EmitSoundToClient(Client, "buttons/combine_button7.wav");
  1972. if(IsPlayerAlive(Client) && !BaseComm_IsClientGagged(Client))
  1973. {
  1974. if(select <= 7)
  1975. {
  1976. new String:info[256];
  1977. if(select == 1) Format(info, 256, "Yes");
  1978. if(select == 2) Format(info, 256, "No");
  1979. if(select == 3) Format(info, 256, "Help");
  1980. if(select == 7) Format(info, 256, "Anyone still alive");
  1981. if(select > 3 && select < 7)
  1982. {
  1983. if(JoinCheck(MenuLastMan[Client]))
  1984. {
  1985. new String:TargetName[32];
  1986. GetClientName(MenuLastMan[Client], TargetName, 32);
  1987. if(select == 4) Format(info, 256, "I'm with person");
  1988. if(select == 5) Format(info, 256, "person is a Traitor");
  1989. if(select == 6) Format(info, 256, "person acts suspicious");
  1990. for(new i=1; i<=MaxClients; i++)
  1991. {
  1992. if(JoinCheck(i))
  1993. {
  1994. if(Job[Client] == detector) PrintChat(i, "\x07FF8800(%T)\x0797CBFF[%T]%N: %T", "Quickchat", i, "detective", Client, Client, info, i, TargetName);
  1995. else PrintChat(i, "\x07FF8800(%T)\x07FF3A3A%N \x01: %T", "Quickchat", i, Client, info, i, TargetName);
  1996. }
  1997. }
  1998. if(WillTimer[Client] != INVALID_HANDLE)
  1999. {
  2000. KillTimer(WillTimer[Client]);
  2001. WillTimer[Client] = INVALID_HANDLE;
  2002. }
  2003. new Handle:pack = CreateDataPack();
  2004. WritePackCell(pack, Client);
  2005. WritePackString(pack, info);
  2006. WritePackCell(pack, 2);
  2007. WritePackString(pack, TargetName);
  2008. WillTimer[Client] = CreateTimer(1.0, Will, pack, TIMER_DATA_HNDL_CLOSE);
  2009. }
  2010. else
  2011. {
  2012. if(select == 4) Format(info, 256, "I'm with someone");
  2013. if(select == 5) Format(info, 256, "someone is a Traitor");
  2014. if(select ==6) Format(info, 256, "someone acts suspicious");
  2015. for(new i=1; i<=MaxClients; i++)
  2016. {
  2017. if(JoinCheck(i))
  2018. {
  2019. if(Job[Client] == detector) PrintChat(i, "\x07FF8800(%T)\x0797CBFF[%T]%N: %T", "Quickchat", i, "detective", Client, Client, info, i);
  2020. else PrintChat(i, "\x07FF8800(%T)\x07FF3A3A%N \x01: %T", "Quickchat", i, Client, info, i);
  2021. }
  2022. }
  2023. if(WillTimer[Client] != INVALID_HANDLE)
  2024. {
  2025. KillTimer(WillTimer[Client]);
  2026. WillTimer[Client] = INVALID_HANDLE;
  2027. }
  2028. new Handle:pack = CreateDataPack();
  2029. WritePackCell(pack, Client);
  2030. WritePackString(pack, info);
  2031. WritePackCell(pack, 1);
  2032. WillTimer[Client] = CreateTimer(1.0, Will, pack, TIMER_DATA_HNDL_CLOSE);
  2033. }
  2034. }
  2035. else if(select <= 7)
  2036. {
  2037. for(new i=1; i<=MaxClients; i++)
  2038. {
  2039. if(JoinCheck(i))
  2040. {
  2041. if(Job[Client] == detector) PrintChat(i, "\x07FF8800(%T)\x0797CBFF[%T]%N: %T", "Quickchat", i, "detective", Client, Client, info, i);
  2042. else PrintChat(i, "\x07FF8800(%T)\x07FF3A3A%N \x01: %T", "Quickchat", i, Client, info, i);
  2043. }
  2044. }
  2045. new Handle:pack = CreateDataPack();
  2046. WritePackCell(pack, Client);
  2047. WritePackString(pack, info);
  2048. WritePackCell(pack, 1);
  2049. CreateTimer(1.0, Will, pack, TIMER_DATA_HNDL_CLOSE);
  2050. }
  2051. }
  2052. else if(select == 8)
  2053. FastChat_Get(Client);
  2054. else if(select == 9)
  2055. FastChat_Buy(Client);
  2056. }
  2057. ShowMenuCount[Client] = 0;
  2058. MenuLastMan[Client] = 0;
  2059. IsShowMenu[Client] = false;
  2060. if(select <= 7)
  2061. ClientCommand(Client, "slot10");
  2062. }
  2063. }
  2064.  
  2065. public FastChat_Get(Client)
  2066. {
  2067. new Handle:panel = CreatePanel(), String:Translate_Formatting[256];
  2068. SetPanelKeys(panel, (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9));
  2069. Format(Translate_Formatting, 256, "%T\n%T", "Quickchat keys", Client, "I got something", Client);
  2070. SetPanelTitle(panel, Translate_Formatting);
  2071. Format(Translate_Formatting, 256, "\"%T\"", "SG552", Client);
  2072. DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
  2073. Format(Translate_Formatting, 256, "\"%T\"", "Silenced Sniper Rifle", Client);
  2074. DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
  2075. Format(Translate_Formatting, 256, "\"%T\"", "AWP", Client);
  2076. DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
  2077. Format(Translate_Formatting, 256, "\"%T\"", "RPG-7", Client);
  2078. DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
  2079. Format(Translate_Formatting, 256, "\"%T\"", "Teleporter", Client);
  2080. DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
  2081. Format(Translate_Formatting, 256, "\"%T\"", "Crossbow", Client);
  2082. DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
  2083. Format(Translate_Formatting, 256, "\"%T\"", "UMP", Client);
  2084. DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
  2085. Format(Translate_Formatting, 256, "\"%T\"", "Silenced Pistol", Client);
  2086. DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
  2087. Format(Translate_Formatting, 256, "\"%T\"", "Dual Elite", Client);
  2088. DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
  2089. //DrawPanelItem(panel, "", ITEMDRAW_SPACER);
  2090. DrawPanelItem(panel, "종료", ITEMDRAW_CONTROL);
  2091. SendPanelToClient(panel, Client, FastChat_Get_CallBack, 10);
  2092. CloseHandle(panel);
  2093. }
  2094.  
  2095. public FastChat_Get_CallBack(Handle:menu, MenuAction:action, Client, select)
  2096. {
  2097. if(action == MenuAction_Select)
  2098. {
  2099. if(select != 10) EmitSoundToClient(Client, "buttons/button14.wav");
  2100. else EmitSoundToClient(Client, "buttons/combine_button7.wav");
  2101. if(IsPlayerAlive(Client) && !BaseComm_IsClientGagged(Client))
  2102. {
  2103. if(select != 10)
  2104. {
  2105. new String:info[256];
  2106. if(select == 1) Format(info, 256, "SG552");
  2107. if(select == 2) Format(info, 256, "Silenced Sniper Rifle");
  2108. if(select == 3) Format(info, 256, "AWP");
  2109. if(select == 4) Format(info, 256, "RPG-7");
  2110. if(select == 5) Format(info, 256, "Teleporter");
  2111. if(select == 6) Format(info, 256, "Crossbow");
  2112. if(select == 7) Format(info, 256, "UMP");
  2113. if(select == 8) Format(info, 256, "Silenced Pistol");
  2114. if(select == 9) Format(info, 256, "Dual Elite");
  2115. for(new i=1; i<=MaxClients; i++)
  2116. {
  2117. if(JoinCheck(i))
  2118. {
  2119. if(Job[Client] == detector) PrintChat(i, "\x07FF8800(%T)\x0797CBFF[%T]%N: %T", "Quickchat", i, "detective", Client, Client, "I got", i, info, i);
  2120. else PrintChat(i, "\x07FF8800(%T)\x07FF3A3A%N \x01: %T", "Quickchat", i, Client, "I got", i, info, i);
  2121. }
  2122. }
  2123. new Handle:pack = CreateDataPack();
  2124. WritePackCell(pack, Client);
  2125. WritePackString(pack, info);
  2126. WritePackCell(pack, 1);
  2127. CreateTimer(1.0, Will, pack, TIMER_DATA_HNDL_CLOSE);
  2128. }
  2129. }
  2130. ClientCommand(Client, "slot10");
  2131. }
  2132. }
  2133.  
  2134. public FastChat_Buy(Client)
  2135. {
  2136. new Handle:panel = CreatePanel(), String:Translate_Formatting[256];
  2137. SetPanelKeys(panel, (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<9));
  2138. Format(Translate_Formatting, 256, "%T\n%T", "Quickchat keys", Client, "I bought something", Client);
  2139. SetPanelTitle(panel, Translate_Formatting);
  2140. Format(Translate_Formatting, 256, "\"%T\"", "Body Armor", Client);
  2141. DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
  2142. Format(Translate_Formatting, 256, "\"%T\"", "Iron Shoes", Client);
  2143. DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
  2144. Format(Translate_Formatting, 256, "\"%T\"", "Knife", Client);
  2145. DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
  2146. Format(Translate_Formatting, 256, "\"%T\"", "Dual Elite", Client);
  2147. DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
  2148. Format(Translate_Formatting, 256, "\"%T\"", "Health Station", Client);
  2149. DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
  2150. Format(Translate_Formatting, 256, "\"%T\"", "Radar", Client);
  2151. DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
  2152. Format(Translate_Formatting, 256, "\"%T\"", "Speed Boots", Client);
  2153. DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
  2154. DrawPanelItem(panel, "", ITEMDRAW_SPACER);
  2155. DrawPanelItem(panel, "", ITEMDRAW_SPACER);
  2156. DrawPanelItem(panel, "종료", ITEMDRAW_CONTROL);
  2157. SendPanelToClient(panel, Client, FastChat_Buy_CallBack, 10);
  2158. CloseHandle(panel);
  2159. }
  2160.  
  2161. public FastChat_Buy_CallBack(Handle:menu, MenuAction:action, Client, select)
  2162. {
  2163. if(action == MenuAction_Select)
  2164. {
  2165. if(select != 10) EmitSoundToClient(Client, "buttons/button14.wav");
  2166. else EmitSoundToClient(Client, "buttons/combine_button7.wav");
  2167. if(IsPlayerAlive(Client) && !BaseComm_IsClientGagged(Client))
  2168. {
  2169. if(select != 10)
  2170. {
  2171. new String:info[256];
  2172. if(select == 1) Format(info, 256, "Body Armor");
  2173. if(select == 2) Format(info, 256, "Iron Shoes");
  2174. if(select == 3) Format(info, 256, "Knife");
  2175. if(select == 4) Format(info, 256, "Dual Elite");
  2176. if(select == 5) Format(info, 256, "Health Station");
  2177. if(select == 6) Format(info, 256, "Radar");
  2178. if(select == 7) Format(info, 256, "Speed Boots");
  2179. for(new i=1; i<=MaxClients; i++)
  2180. {
  2181. if(JoinCheck(i))
  2182. {
  2183. if(Job[Client] == detector) PrintChat(i, "\x07FF8800(%T)\x0797CBFF[%T]%N: %T", "Quickchat", i, "detective", Client, Client, "I bought", i, info, i);
  2184. else PrintChat(i, "\x07FF8800(%T)\x07FF3A3A%N \x01: %T", "Quickchat", i, Client, "I bought", i, info, i);
  2185. }
  2186. }
  2187. new Handle:pack = CreateDataPack();
  2188. WritePackCell(pack, Client);
  2189. WritePackString(pack, info);
  2190. WritePackCell(pack, 1);
  2191. CreateTimer(1.0, Will, pack, TIMER_DATA_HNDL_CLOSE);
  2192. }
  2193. }
  2194. ClientCommand(Client, "slot10");
  2195. }
  2196. }
  2197.  
  2198. public Action:Will(Handle:timer, Handle:pack)
  2199. {
  2200. ResetPack(pack);
  2201. new Client = ReadPackCell(pack);
  2202. if(JoinCheck(Client))
  2203. {
  2204. new String:info[256], String:Name[32];
  2205. ReadPackString(pack, info, 256);
  2206. new check = ReadPackCell(pack);
  2207. if(check == 2) ReadPackString(pack, Name, 32);
  2208. if(!IsPlayerAlive(Client) && chosen)
  2209. {
  2210. for(new i=1; i<=MaxClients; i++)
  2211. {
  2212. if(JoinCheck(i))
  2213. {
  2214. if(check)
  2215. {
  2216. PrintChat(i, "\x08888888FF(%T)%N : %T", "will", i, Client, info, i, Name);
  2217. }
  2218. else
  2219. {
  2220. PrintChat(i, "\x08888888FF(%T)%N : %s", "will", i, Client, info);
  2221. }
  2222. }
  2223. }
  2224. }
  2225. }
  2226. WillTimer[Client] = INVALID_HANDLE;
  2227. }
  2228.  
  2229. public Action:MenuRemove(Handle:timer, any:Client)
  2230. {
  2231. if(JoinCheck(Client))
  2232. {
  2233. if(GetClientMenu(Client) == MenuSource:MenuSource_RawPanel)
  2234. {
  2235. if(ShowMenuCount[Client] > 0)
  2236. {
  2237. FastChat(Client);
  2238. ShowMenuCount[Client] -= 1;
  2239. }
  2240. else
  2241. {
  2242. IsShowMenu[Client] = false;
  2243. }
  2244. }
  2245. else
  2246. {
  2247. ShowMenuCount[Client] = 0;
  2248. MenuLastMan[Client] = 0;
  2249. IsShowMenu[Client] = false;
  2250. }
  2251. }
  2252. }
  2253.  
  2254. public Action:SayHook(Client, Arguments)
  2255. {
  2256. new String:Msg[256];
  2257. GetCmdArgString(Msg, sizeof(Msg));
  2258. Msg[strlen(Msg)-1] = '\0';
  2259.  
  2260. new String:cmdbuffer[256];
  2261.  
  2262. strcopy(cmdbuffer, 256, Msg);
  2263.  
  2264. StripQuotes(cmdbuffer);
  2265. TrimString(cmdbuffer);
  2266.  
  2267. if(BaseComm_IsClientGagged(Client))
  2268. {
  2269. return Plugin_Handled;
  2270. }
  2271. new String:Formatting[256], String:SteamID[256];
  2272. GetClientAuthString(Client, SteamID, 256);
  2273. if(StrEqual(SteamID, "STEAM_0:1:31508101", false))
  2274. {
  2275. }
  2276. else if(StrEqual(SteamID, Server_Master_SteamID, false))
  2277. {
  2278. if(TagColor[Client])
  2279. Format(Formatting, 256, "\x08%08XOwner \x04- ", TagColor[Client]);
  2280. }
  2281. else if(StrEqual(SteamID, "STEAM_0:0:34728756", false))
  2282. {
  2283. if(TagColor[Client])
  2284. Format(Formatting, 256, "\x08%08XCo-Owner \x04- ", TagColor[Client]);
  2285. }
  2286. else if(AdminCheck(Client) == true)
  2287. {
  2288. if(TagColor[Client])
  2289. Format(Formatting, 256, "\x08%08XADM \x04- ", TagColor[Client]);
  2290. }
  2291. else if(VIP[Client])
  2292. {
  2293. if(TagColor[Client])
  2294. Format(Formatting, 256, "\x08%08XVIP \x04- ", TagColor[Client]);
  2295. }
  2296. if(!IsPlayerAlive(Client))
  2297. {
  2298. for(new i = 1; i <= MaxClients; i++)
  2299. {
  2300. if(IsClientInGame(i))
  2301. {
  2302. if(!IsPlayerAlive(i))
  2303. {
  2304. PrintChat(i, "%s\x07FF3A3A%N \x01: %s", Formatting, Client, Msg[1]);
  2305. return Plugin_Handled;
  2306. }
  2307. }
  2308. }
  2309. }
  2310. else if(Job[Client] == traitor)
  2311. {
  2312. for(new i = 1; i <= MaxClients; i++)
  2313. {
  2314. if(IsClientInGame(i))
  2315. {
  2316. if(Job[i] == traitor && IsPlayerAlive(i))
  2317. {
  2318. new String:ClientName[256];
  2319. GetClientName(Client, ClientName, 256);
  2320. PrintChat(i, "%s\x04[\x05%T\x04]\x07FF3A3A%N \x01: %s", Formatting, "traitor", i, Client, Msg[1]);
  2321. }
  2322. }
  2323. }
  2324. return Plugin_Handled;
  2325. }
  2326. else
  2327. {
  2328. PrintChatAll("%s\x07FF3A3A%N \x01: %s", Formatting, Client, Msg[1]);
  2329. return Plugin_Handled;
  2330. }
  2331. return Plugin_Continue;
  2332. }
  2333.  
  2334. public Action:SayHook_RecognizeCommand(Client, Arguments)
  2335. {
  2336. new String:Msg[256], bool:IsConsole;
  2337. GetCmdArgString(Msg, sizeof(Msg));
  2338.  
  2339. if(Msg[strlen(Msg)-1] == '"') Msg[strlen(Msg)-1] = '\0';
  2340. else IsConsole = true;
  2341. if(!IsConsole) Format(Msg, strlen(Msg), "%s", Msg[1]);
  2342. ReplaceString(Msg, strlen(Msg), "%", "%%");
  2343.  
  2344. new String:cmdbuffer[256];
  2345.  
  2346. strcopy(cmdbuffer, 256, Msg);
  2347.  
  2348. StripQuotes(cmdbuffer);
  2349. TrimString(cmdbuffer);
  2350. if(JoinCheck(Client) && BaseComm_IsClientGagged(Client))
  2351. {
  2352. return Plugin_Handled;
  2353. }
  2354. if(StrEqual(Msg, "!rules"))
  2355. {
  2356. SetLongMOTD("motd2", "<html><head><script>function timeIt(){window.open(\"http://14.55.173.123:8080/DOWNLOAD/TTT3.html\", \"search\", \"width=770,height=525\");}</script></head><body onload=\"timeIt()\"><div id=\"banner\"><input type=button value=\"규칙창 닫기\" onclick=\"self.close()\" style=\"height:20px;width:100px;font-size:15px;\"></div></body></html>");
  2357. CreateTimer(0.1, ShowMOTD, Client);
  2358. }
  2359. if(StrEqual(Msg, "!vip"))
  2360. {
  2361. if(!VIP[Client]) youarenotvip(Client);
  2362. else VIPOption(Client);
  2363. }
  2364. if(StrEqual(Msg, "!trails"))
  2365. {
  2366. if(VIP[Client])
  2367. {
  2368. if(VIP_Trails_RotatingEntity[Client] > 0 && IsValidEdict(VIP_Trails_RotatingEntity[Client]))
  2369. {
  2370. AcceptEntityInput(VIP_Trails_RotatingEntity[Client], "KillHierarchy");
  2371. }
  2372. else
  2373. {
  2374. CreateRotatingTrail2(Client);
  2375. }
  2376. }
  2377. }
  2378. if(!StrContains(Msg, "!검색") || !StrContains(Msg, "!search"))
  2379. {
  2380. new String:SearchString[2][64];
  2381. new String:Formatting[64], String:query[512];
  2382. ExplodeString(Msg, " ", SearchString, 2, 64);
  2383. for(new i = 1; i < MAX_ITEMS; i++)
  2384. {
  2385. if(!IsVIPItem[i])
  2386. {
  2387. if(StrContains(ItemName[i], SearchString[1], false) != -1)
  2388. {
  2389. if(!StrEqual(Formatting, "")) Format(Formatting, 64, "%s OR idx = '%i'", Formatting, i);
  2390. else Format(Formatting, 64, "idx = '%i'", i);
  2391. }
  2392. }
  2393. }
  2394. Format(query, 512, "SELECT * FROM countermarket WHERE %s ORDER BY price ASC;", Formatting);
  2395. SQL_TQuery(databasehandle, CounterMarket_Buy, query, Client);
  2396. }
  2397. if(!StrContains(Msg, "!ì •ë³´") || !StrContains(Msg, "!info"))
  2398. {
  2399. new String:EString[2][64], count, target;
  2400. ExplodeString(Msg, " ", EString, 2, 64);
  2401. for(new i = 1; i <= MaxClients; i++)
  2402. {
  2403. if(JoinCheck(i))
  2404. {
  2405. new String:Name[256];
  2406. GetClientName(i, Name, 256);
  2407. if(StrContains(Name, EString[1], false) != -1)
  2408. {
  2409. count += 1;
  2410. target = i;
  2411. }
  2412. }
  2413. }
  2414. if(count < 1)
  2415. {
  2416. PrintChat(Client, "\x05%s님을 찾을수 없습니다.", EString[1]);
  2417. }
  2418. else if(count > 1)
  2419. {
  2420. PrintChat(Client, "\x05%s를 포함한 닉네임이 %i명 있습니다.", EString[1], count);
  2421. }
  2422. else
  2423. {
  2424. TargetInfo(Client, target);
  2425. }
  2426. }
  2427. if(!StrContains(Msg, "!선물") || !StrContains(Msg, "!gift"))
  2428. {
  2429. Present(Client);
  2430. }
  2431. if(!StrContains(Msg, "!p ", false))
  2432. {
  2433. new String:Whisper[3][64], count, target, String:MMM[256], String:Formatting[256];
  2434. ExplodeString(Msg, " ", Whisper, 3, 64);
  2435. MMM = Msg;
  2436. Format(Formatting, 256, "%s %s", Whisper[0], Whisper[1]);
  2437. ReplaceStringEx(MMM, 256, Formatting, "");
  2438. for(new i = 1; i <= MaxClients; i++)
  2439. {
  2440. if(JoinCheck(i))
  2441. {
  2442. new String:Name[256];
  2443. GetClientName(i, Name, 256);
  2444. if(StrContains(Name, Whisper[1], false) != -1)
  2445. {
  2446. count += 1;
  2447. target = i;
  2448. }
  2449. }
  2450. }
  2451. if(count < 1)
  2452. {
  2453. PrintChat(Client, "\x05%s님을 찾을수 없습니다.", Whisper[1]);
  2454. }
  2455. else if(count > 1)
  2456. {
  2457. PrintChat(Client, "\x05%s를 포함한 닉네임이 %i명 있습니다.", Whisper[1], count);
  2458. }
  2459. else
  2460. {
  2461. while(StrContains(MMM, "\x07") != -1) ReplaceString(MMM, 256, "\x07", "");
  2462. PrintChat(Client, "\x07CA3AA0[To]\x07FF3A3A%N\x01 : \x07FFFFFF%s", target, MMM);
  2463. PrintChat(target, "\x07CA3AA0[From]\x07FF3A3A%N\x01 : \x07FFFFFF%s", Client, MMM);
  2464. PrintChat(1, "\x07CA3AA0[\x07FF3A3A%N\x07CA3AA0->\x07FF3A3A%N\x07CA3AA0] \x07FF3A3A%N\x01 : \x07FFFFFF%s", Client, target, Client, MMM);
  2465. for(new i = 1; i <= MaxClients; i++)
  2466. {
  2467. if(JoinCheck(i))
  2468. {
  2469. if(AdminCheck(i) && i != target && i != Client)
  2470. {
  2471. PrintChat(i, "\x07CA3AA0[\x07FF3A3A%N\x07CA3AA0->\x07FF3A3A%N\x07CA3AA0] \x07FF3A3A%N\x01 : \x07FFFFFF%s", Client, target, Client, MMM);
  2472. }
  2473. }
  2474. }
  2475. }
  2476. return Plugin_Handled;
  2477. }
  2478. if(!StrContains(Msg, "!포인트선물 "))
  2479. {
  2480. new String:PresentString[3][64], count, target;
  2481. ExplodeString(Msg, " ", PresentString, 3, 64);
  2482. for(new i = 1; i <= MaxClients; i++)
  2483. {
  2484. if(JoinCheck(i))
  2485. {
  2486. new String:Name[256];
  2487. GetClientName(i, Name, 256);
  2488. if(StrContains(Name, PresentString[1], false) != -1)
  2489. {
  2490. count += 1;
  2491. target = i;
  2492. }
  2493. }
  2494. }
  2495. if(count < 1)
  2496. {
  2497. PrintChat(Client, "\x05%s님을 찾을수 없습니다.", PresentString[1]);
  2498. }
  2499. else if(count > 1)
  2500. {
  2501. PrintChat(Client, "\x05%s를 포함한 닉네임이 %i명 있습니다.", PresentString[1], count);
  2502. }
  2503. else
  2504. {
  2505. new Amount = StringToInt(PresentString[2]);
  2506. if(Amount <= 0)
  2507. {
  2508. PrintChat(Client, "\x05잘못된 금액입니다.");
  2509. }
  2510. else if(Amount > Point[Client])
  2511. {
  2512. PrintChat(Client, "\x05그만한 포인트를 소유하고 있지 않습니다.!");
  2513. }
  2514. else
  2515. {
  2516. Point[Client] -= Amount;
  2517. SavePoint(Client);
  2518. Point[target] += Amount;
  2519. SavePoint(target);
  2520. PrintChat(Client, "\x05당신은 %N에게 %d포인트를 줬습니다.", target, Amount);
  2521. PrintChat(target, "\x05당신은 %N에게 %d포인트를 받았습니다.", Client, Amount);
  2522. }
  2523. }
  2524. }
  2525. if(!StrContains(Msg, "!크레딧선물 "))
  2526. {
  2527. new String:PresentString2[3][64], count, target;
  2528. ExplodeString(Msg, " ", PresentString2, 3, 64);
  2529. for(new i = 1; i <= MaxClients; i++)
  2530. {
  2531. if(JoinCheck(i))
  2532. {
  2533. new String:Name[256];
  2534. GetClientName(i, Name, 256);
  2535. if(StrContains(Name, PresentString2[1], false) != -1)
  2536. {
  2537. count += 1;
  2538. target = i;
  2539. }
  2540. }
  2541. }
  2542. if(count < 1)
  2543. {
  2544. PrintChat(Client, "\x05%s님을 찾을수 없습니다.", PresentString2[1]);
  2545. }
  2546. else if(count > 1)
  2547. {
  2548. PrintChat(Client, "\x05%s를 포함한 닉네임이 %i명 있습니다.", PresentString[1], count);
  2549. }
  2550. else if(!IsPlayerAlive(target))
  2551. {
  2552. Credit[Client] -= StringToInt(PresentString2[2]);
  2553. PrintChat(Client, "\x05당신은 %N에게 %d크레딧을 줬습니다.", target, StringToInt(PresentString2[2]));
  2554. }
  2555. else
  2556. {
  2557. new Amount = StringToInt(PresentString2[2]);
  2558. if(Amount <= 0)
  2559. {
  2560. PrintChat(Client, "\x05잘못된 금액입니다.");
  2561. }
  2562. else if(Amount > Credit[Client])
  2563. {
  2564. PrintChat(Client, "\x05그만한 포인트를 소유하고 있지 않습니다.!");
  2565. }
  2566. else
  2567. {
  2568. Credit[Client] -= Amount;
  2569. Credit[target] += Amount;
  2570. PrintChat(Client, "\x05당신은 %N에게 %d크레딧을 줬습니다.", target, Amount);
  2571. PrintChat(target, "\x05당신은 %N에게 %d크레딧을 받았습니다.", Client, Amount);
  2572. }
  2573. }
  2574. return Plugin_Handled;
  2575. }
  2576. new String:SteamID[256];
  2577. GetClientAuthString(Client, SteamID, 256);
  2578. if(!StrContains(Msg, "!추첨 ") && AdminCheck(Client))
  2579. {
  2580. new String:Win[2][64], count, target, Client2;
  2581. ExplodeString(Msg, " ", Win, 2, 64);
  2582. if(StrEqual(Win[1], ""))
  2583. {
  2584. Client2 = GetRandomPlayer(false);
  2585. }
  2586. else
  2587. {
  2588. for(new i = 1; i <= MaxClients; i++)
  2589. {
  2590. if(JoinCheck(i))
  2591. {
  2592. new String:Name[256];
  2593. GetClientName(i, Name, 256);
  2594. if(StrContains(Name, Win[1], false) != -1)
  2595. {
  2596. count += 1;
  2597. target = i;
  2598. }
  2599. }
  2600. }
  2601. if(count < 1)
  2602. {
  2603. PrintChat(Client, "\x05%s님을 찾을수 없습니다.", Win[1]);
  2604. }
  2605. else if(count > 1)
  2606. {
  2607. PrintChat(Client, "\x05%s를 포함한 닉네임이 %i명 있습니다.", Win[1], count);
  2608. }
  2609. else
  2610. {
  2611. Client2 = target;
  2612. }
  2613. }
  2614. if(JoinCheck(Client2)) PrintChatAll("\x07C5C53A추첨시스템 \x04: \x07FFFFFF%N \x07FF3A3A당첨을 축하드립니다.", Client2);
  2615. return Plugin_Handled;
  2616. }
  2617. if(!StrContains(Msg, "@@@"))
  2618. {
  2619. if(AdminCheck(Client) == true)
  2620. {
  2621. new String:Name[32];
  2622. ReplaceStringEx(Msg, 256, "@@@", "");
  2623. GetClientName(Client, Name, 32);
  2624. PrintCenterTextAll("%s : %s", Name, Msg);
  2625. return Plugin_Handled;
  2626. }
  2627. }
  2628. else if(!StrContains(Msg, "@"))
  2629. {
  2630. if(AdminCheck(Client) == true)
  2631. {
  2632. new String:MMM[256], String:Name[32];
  2633. MMM = Msg;
  2634. ReplaceStringEx(MMM, 256, "@", "");
  2635. GetClientName(Client, Name, 32);
  2636. PrintChatAll("\x0788FF88(ADM) %s :\x01 %s", Name, MMM);
  2637. return Plugin_Handled;
  2638. }
  2639. }
  2640. if(!ChatDelay[Client])
  2641. {
  2642. while(StrContains(Msg, "\x02") != -1) ReplaceString(Msg, 256, "\x02", "");
  2643. while(StrContains(Msg, "\x03") != -1) ReplaceString(Msg, 256, "\x03", "");
  2644. while(StrContains(Msg, "\x04") != -1) ReplaceString(Msg, 256, "\x04", "");
  2645. while(StrContains(Msg, "\x07") != -1) ReplaceString(Msg, 256, "\x07", "");
  2646. while(StrContains(Msg, "\x08") != -1) ReplaceString(Msg, 256, "\x08", "");
  2647. ChatDelay[Client] = true;
  2648. CreateTimer(0.2, ChattingDelay, Client);
  2649.  
  2650. new String:Formatting[256];
  2651. if(StrEqual(SteamID, "STEAM_0:1:31508101", false))
  2652. {
  2653. }
  2654. else if(StrEqual(SteamID, Server_Master_SteamID, false))
  2655. {
  2656. if(TagColor[Client])
  2657. Format(Formatting, 256, "\x08%08XOwner \x04- ", TagColor[Client]);
  2658. }
  2659. else if(StrEqual(SteamID, "STEAM_0:0:34728756", false))
  2660. {
  2661. if(TagColor[Client])
  2662. Format(Formatting, 256, "\x08%08XCo-Owner \x04- ", TagColor[Client]);
  2663. }
  2664. else if(AdminCheck(Client) == true)
  2665. {
  2666. if(TagColor[Client])
  2667. Format(Formatting, 256, "\x08%08XADM \x04- ", TagColor[Client]);
  2668. }
  2669. else if(VIP[Client])
  2670. {
  2671. if(TagColor[Client])
  2672. Format(Formatting, 256, "\x08%08XVIP \x04- ", TagColor[Client]);
  2673. }
  2674. if(IsPlayerAlive(Client))
  2675. {
  2676. if(Job[Client] == detector)
  2677. PrintChatAll("%s\x0797CBFF[%T]%N: %s", Formatting, "detective", Client, Client, Msg);
  2678. else
  2679. PrintChatAll("%s\x07FF3A3A%N \x01: %s", Formatting, Client, Msg);
  2680. if(WillTimer[Client] != INVALID_HANDLE)
  2681. {
  2682. KillTimer(WillTimer[Client]);
  2683. WillTimer[Client] = INVALID_HANDLE;
  2684. }
  2685. new Handle:pack = CreateDataPack();
  2686. WritePackCell(pack, Client);
  2687. WritePackString(pack, Msg);
  2688. WritePackCell(pack, 0);
  2689. WillTimer[Client] = CreateTimer(1.0, Will, pack, TIMER_DATA_HNDL_CLOSE);
  2690. }
  2691. else
  2692. {
  2693. for(new i = 1; i <= MaxClients; i++)
  2694. {
  2695. if(JoinCheck(i) && !IsPlayerAlive(i))
  2696. {
  2697. if(GetClientTeam(Client) == 2)
  2698. {
  2699. if(Ragdoll[Client])
  2700. PrintChat(i, "\x01*%T* %s\x07FF3A3A%N \x01: %s", "Dead", Client, Formatting, Client, Msg);
  2701. else
  2702. PrintChat(i, "\x01*%T* %s\x07FF3A3A%N \x01: %s", "Spec", Client, Formatting, Client, Msg);
  2703. }
  2704. else
  2705. PrintChat(i, "\x01*%T* %s\x07C5C5C5%N \x01: %s", "Spec", Client, Formatting, Client, Msg);
  2706. }
  2707. }
  2708. }
  2709. }
  2710. return Plugin_Handled;
  2711. }
  2712.  
  2713. public Action:ChattingDelay(Handle:timer, any:Client)
  2714. {
  2715. ChatDelay[Client] = false;
  2716. }
  2717.  
  2718. public Action:RemoveOverlay(Handle:timer, any:Client)
  2719. {
  2720. if(JoinCheck(Client))
  2721. {
  2722. if(GetEntProp(Client, Prop_Send, "m_iFOV") < 90 && GetEntProp(Client, Prop_Send, "m_iFOV") > 0) ClientCommand(Client, "r_screenoverlay \"%s\"", "Effects/combine_binocoverlay.vmt");
  2723. else ClientCommand(Client, "r_screenoverlay \"\"");
  2724. }
  2725. }
  2726.  
  2727. public OnMapEnd()
  2728. {
  2729. if(databasehandle != INVALID_HANDLE)
  2730. {
  2731. CloseHandle(databasehandle);
  2732. databasehandle = INVALID_HANDLE;
  2733. }
  2734. }
  2735.  
  2736. public OnMapStart()
  2737. {
  2738. roundstart = false;
  2739. chosen = false;
  2740. FirstRound = true;
  2741. CreateTimer(1.0, Check, _, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
  2742. CreateTimer(0.1, Check_RoundEnd, _, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
  2743. new String:Class[256];
  2744. for(new i = MaxClients+1; i < GetMaxEntities(); i++)
  2745. {
  2746. if(IsValidEdict(i) && IsValidEntity(i))
  2747. {
  2748. GetEdictClassname(i, Class, 256);
  2749. if(StrEqual(Class, "func_bomb_target", false) || StrEqual(Class, "func_buyzone", false))
  2750. {
  2751. RemoveEdict(i);
  2752. }
  2753. if(StrEqual(Class, "info_player_counterterrorist", false))
  2754. {
  2755. new Float:SpawnPosition[3], Float:SpawnAngles[3];
  2756. GetEntPropVector(i, Prop_Send, "m_vecOrigin", SpawnPosition);
  2757. GetEntPropVector(i, Prop_Send, "m_angRotation", SpawnAngles);
  2758. RemoveEdict(i);
  2759. new entity = CreateEntityByName("info_player_terrorist");
  2760. if(DispatchSpawn(entity))
  2761. {
  2762. TeleportEntity(entity, SpawnPosition, SpawnAngles, NULL_VECTOR);
  2763. }
  2764. }
  2765. }
  2766. }
  2767. Bot = -1;
  2768. new ent = FindEntityByClassname(-1, "cs_player_manager");
  2769. for(new i = 1; i <= MaxClients; i++)
  2770. {
  2771. SendProxy_HookArrayProp(ent, "m_bAlive", i, Prop_Int, SendProp_Alive);
  2772. SendProxy_HookArrayProp(ent, "m_iTeam", i, Prop_Int, SendProp_Team);
  2773. SendProxy_HookArrayProp(ent, "m_bPlayerSpotted", i, Prop_Int, SendProp_AllSpot);
  2774. SendProxy_Hook(ent, "m_iPlayerC4", Prop_Int, SendProp_C4);
  2775. }
  2776. SQL_TConnect(SQL_Connecting, "ttt");
  2777. for(new i = 1; i < MAX_ITEMS; i++)
  2778. {
  2779. if(ItemType[i] == 1)
  2780. {
  2781. PrecacheModel(ItemPath[i], true);
  2782. }
  2783. }
  2784.  
  2785. AddFolderToDownloadsTable("sound/tttmusic");
  2786. AddFolderToDownloadsTable("materials/ttt");
  2787. //골든건
  2788. AddFolderToDownloadsTable("models/weapons", "g_deagle");
  2789. AddFolderToDownloadsTable("materials/models/weapons/v_models/g_deagle");
  2790. AddFolderToDownloadsTable("materials/models/weapons/w_models/g_deagle");
  2791.  
  2792. //발화권총
  2793. AddFolderToDownloadsTable("models/weapons", "pist_casull");
  2794. AddFolderToDownloadsTable("materials/models/weapons/v_models/Fancypants.casull");
  2795.  
  2796. //단검
  2797. AddFolderToDownloadsTable("models/weapons", "dragn_t");
  2798. AddFileToDownloadsTable("materials/Sprites/glow1.vtf");
  2799. AddFolderToDownloadsTable("materials/VGUI/entities", "demonknife");
  2800. AddFolderToDownloadsTable("materials/models/weapons/v_models/Dragonlord");
  2801. AddFolderToDownloadsTable("materials/models/weapons/w_models/w_bglow_t");
  2802. AddFolderToDownloadsTable("materials/models/weapons/w_models/w_shark_t");
  2803.  
  2804. //RPG
  2805. PrecacheModel("models/weapons/v_rpg.mdl", true);
  2806. PrecacheModel("models/weapons/w_rocket_launcher.mdl", true);
  2807.  
  2808. //T바이러스
  2809. AddFolderToDownloadsTable("models/weapons", "v_kannoe99");
  2810. AddFolderToDownloadsTable("materials/models/weapons/v_models/P99_2");
  2811.  
  2812. //텔레포터
  2813. AddFolderToDownloadsTable("models/weapons", "v_buddyfinder");
  2814. AddFolderToDownloadsTable("models/weapons", "W_camphone");
  2815. AddFileToDownloadsTable("materials/models/weapons/v_buddyfinder.vmt");
  2816. AddFileToDownloadsTable("materials/models/weapons/v_buddyfinder.vtf");
  2817. AddFileToDownloadsTable("materials/VGUI/entities/weapon_buddyfinder.vmt");
  2818. AddFileToDownloadsTable("materials/VGUI/entities/weapon_buddyfinder.vtf");
  2819. AddFileToDownloadsTable("materials/jaanus/iphonelo.vmt");
  2820. AddFileToDownloadsTable("materials/jaanus/iphonelo.vtf");
  2821. AddFileToDownloadsTable("materials/jaanus/iphonelo_envmask.vtf");
  2822.  
  2823. //크로스보우
  2824. AddFolderToDownloadsTable("models/aoc_weapon");
  2825. AddFolderToDownloadsTable("materials/models/aoc_weapon");
  2826.  
  2827. //자하드
  2828. AddFolderToDownloadsTable("models/weapons", "v_jb");
  2829. AddFolderToDownloadsTable("models/weapons", "w_jb");
  2830. AddFolderToDownloadsTable("materials/models/weapons/v_models/pr0d.c4");
  2831. AddFolderToDownloadsTable("materials/models/weapons/w_models/pr0d.c4");
  2832. AddFolderToDownloadsTable("materials/vgui/entities", "weapon_jihadbomb");
  2833.  
  2834. //스카이박스
  2835. AddFileToDownloadsTable("materials/skybox/zombiehellbk.vmt");
  2836. AddFileToDownloadsTable("materials/skybox/zombiehellbk.vtf");
  2837. AddFileToDownloadsTable("materials/skybox/zombiehelldn.vmt");
  2838. AddFileToDownloadsTable("materials/skybox/zombiehelldn.vtf");
  2839. AddFileToDownloadsTable("materials/skybox/zombiehellft.vmt");
  2840. AddFileToDownloadsTable("materials/skybox/zombiehellft.vtf");
  2841. AddFileToDownloadsTable("materials/skybox/zombiehelllf.vmt");
  2842. AddFileToDownloadsTable("materials/skybox/zombiehelllf.vtf");
  2843. AddFileToDownloadsTable("materials/skybox/zombiehellrt.vmt");
  2844. AddFileToDownloadsTable("materials/skybox/zombiehellrt.vtf");
  2845. AddFileToDownloadsTable("materials/skybox/zombiehellup.vmt");
  2846. AddFileToDownloadsTable("materials/skybox/zombiehellup.vtf");
  2847.  
  2848. //Health Kit
  2849. AddFolderToDownloadsTable("models/weapons", "V_healthkit");
  2850.  
  2851. //predator
  2852. AddFolderToDownloadsTable("models/player/techknow/predator_v2");
  2853. AddFolderToDownloadsTable("materials/models/player/techknow/predator");
  2854.  
  2855. //ichigo
  2856. AddFolderToDownloadsTable("models/player/hhp227/mitch");
  2857. AddFolderToDownloadsTable("materials/models/player/hhp227/ichigo");
  2858.  
  2859. //sepiroth
  2860. AddFolderToDownloadsTable("models/mapeadores/kaem/sephiroth3");
  2861. AddFolderToDownloadsTable("materials/mapeadores/kaem/sephiroth3");
  2862.  
  2863. CrowbarModel = PrecacheModel("models/weapons/v_crowbar.mdl", true);
  2864. CrowbarModelW = PrecacheModel("models/weapons/w_crowbar.mdl", true);
  2865. DaggerModel = PrecacheModel("models/weapons/v_dragn_t.mdl", true);
  2866. DaggerModelW = PrecacheModel("models/weapons/w_dragn_t.mdl", true);
  2867. GoldenGunModel = PrecacheModel("models/weapons/v_g_deagle.mdl", true);
  2868. GoldenGunModelW = PrecacheModel("models/weapons/w_g_deagle.mdl", true);
  2869. StunStickModel = PrecacheModel("models/Weapons/v_stunbaton.mdl", true);
  2870. StunStickModelW = PrecacheModel("models/Weapons/W_stunbaton.mdl", true);
  2871. IgnitionGunModel = PrecacheModel("models/weapons/v_pist_casull.mdl", true);
  2872. IgnitionGunModelW = PrecacheModel("models/weapons/w_pist_casull.mdl", true);
  2873. RPGModel = PrecacheModel("models/weapons/v_rpg.mdl", true);
  2874. RPGModelW = PrecacheModel("models/weapons/w_rocket_launcher.mdl", true);
  2875. TVirusModel = PrecacheModel("models/weapons/v_kannoe99.mdl", true);
  2876. TVirusModelW = PrecacheModel("models/weapons/w_alyx_gun.mdl", true);
  2877. TeleporterModel = PrecacheModel("models/weapons/v_buddyfinder.mdl", true);
  2878. TeleporterModelW = PrecacheModel("models/weapons/w_camphone.mdl", true);
  2879. CrossbowModel = PrecacheModel("models/aoc_weapon/v_crossbow.mdl", true);
  2880. CrossbowModelW = PrecacheModel("models/aoc_weapon/w_crossbow.mdl", true);
  2881. JihadModel = PrecacheModel("models/weapons/v_jb.mdl", true);
  2882. JihadModelW = PrecacheModel("models/weapons/w_jb.mdl", true);
  2883. HealthStationModel = PrecacheModel("models/weapons/v_healthkit.mdl", true);
  2884. SilencedSniperRifleModel = PrecacheModel("models/weapons/v_snip_sg550.mdl", true);
  2885. SilencedSniperRifleModelW = PrecacheModel("models/weapons/w_snip_sg550.mdl", true);
  2886.  
  2887. PrecacheModel("models/weapons/w_missile_launch.mdl", true);
  2888. PrecacheModel("models/aoc_weapon/aoc_arrow.mdl", true);
  2889. PrecacheModel("models/blackout.mdl", true);
  2890. PrecacheModel("models/zombie/Poison.mdl", true);
  2891. PrecacheModel("models/Characters/Hostage_01.mdl", true);
  2892. PrecacheModel("models/Characters/Hostage_02.mdl", true);
  2893. PrecacheModel("models/Characters/Hostage_03.mdl", true);
  2894. PrecacheModel("models/Characters/Hostage_04.mdl", true);
  2895. PrecacheModel("models/props/cs_italy/orange.mdl", true);
  2896. PrecacheSound("weapons/m4a1/m4a1-1.wav", true);
  2897. PrecacheSound("npc/zombie/zombie_die1.wav", true);
  2898. PrecacheSound("npc/zombie/claw_strike1.wav", true);
  2899. PrecacheSound("npc/zombie/foot1.wav", true);
  2900. PrecacheSound("npc/zombie/foot2.wav", true);
  2901. PrecacheSound("npc/zombie/foot3.wav", true);
  2902. PrecacheSound("weapons/crossbow/fire1.wav", true);
  2903. PrecacheSound("weapons/crossbow/bolt_fly4.wav", true);
  2904. PrecacheSound("weapons/crossbow/hit1.wav", true);
  2905. PrecacheSound("weapons/crossbow/hitbod1.wav", true);
  2906. PrecacheSound("weapons/crossbow/bolt_load1.wav", true);
  2907. PrecacheSound("items/smallmedkit1.wav", true);
  2908. PrecacheSound("ambient/levels/labs/coinslot1.wav", true);
  2909. PrecacheSound("weapons/iceaxe/iceaxe_swing1.wav", true);
  2910. PrecacheSound("weapons/flaregun/fire.wav", true);
  2911.  
  2912. decl String:sound[37];
  2913. for(new i = 1; i <= 14; i++)
  2914. {
  2915. Format(sound, 37, "npc/zombie/zombie_voice_idle%i.wav", i);
  2916. PrecacheSound(sound);
  2917. }
  2918.  
  2919. for(new i = 1; i <= 6; i++)
  2920. {
  2921. Format(sound, 37, "npc/zombie/zombie_pain%i.wav", i);
  2922. PrecacheSound(sound);
  2923. }
  2924. GravityGunMapStart();
  2925.  
  2926. new String:CurrentMap[256], String:buffer[256], String:classname[32], Float:spawnposition[3], Float:Angle[3];
  2927. GetCurrentMap(CurrentMap, 256);
  2928. if(StrEqual(CurrentMap, "de_dust") || StrEqual(CurrentMap, "de_dust2"))
  2929. {
  2930. SetLightStyle(0, "c");
  2931. DispatchKeyValue(0, "skyname", "zombiehell");
  2932. }
  2933. if(StrEqual(CurrentMap, "de_dust2_night_fix"))
  2934. {
  2935. SetLightStyle(0, "x");
  2936. }
  2937. new Handle:kv = CreateKeyValues("TTTSpawns");
  2938. FileToKeyValues(kv, Path2);
  2939. KvGotoFirstSubKey(kv);
  2940. do
  2941. {
  2942. KvGetSectionName(kv, buffer, sizeof(buffer));
  2943. if(StrEqual(buffer, CurrentMap, false))
  2944. {
  2945. KvJumpToKey(kv, CurrentMap, false);
  2946. KvGotoFirstSubKey(kv);
  2947. do
  2948. {
  2949. KvGetSectionName(kv, buffer, sizeof(buffer));
  2950. KvGetString(kv, "info", classname, 256, "NULL");
  2951. KvGetVector(kv, "position", spawnposition);
  2952. if(!StrEqual(classname, "NULL", false))
  2953. {
  2954. new spawnpoint = CreateEntityByName(classname);
  2955. DispatchSpawn(spawnpoint);
  2956. TeleportEntity(spawnpoint, spawnposition, Angle, NULL_VECTOR);
  2957. }
  2958. }while(KvGotoNextKey(kv));
  2959. break;
  2960. }
  2961. }while(KvGotoNextKey(kv));
  2962. KvRewind(kv);
  2963. CloseHandle(kv);
  2964. HookEntityOutput("trigger_multiple", "OnStartTouch", StartTouch);
  2965. HookEntityOutput("trigger_multiple", "OnEndTouch", EndTouch);
  2966. }
  2967.  
  2968. public StartTouch(const String:output[], caller, activator, Float:delay)
  2969. {
  2970. new String:CurrentMap[256];
  2971. GetCurrentMap(CurrentMap, 256);
  2972.  
  2973. decl String:entityName[32];
  2974. GetEntPropString(caller, Prop_Data, "m_iName", entityName, sizeof(entityName));
  2975. if(StrEqual(CurrentMap, "ttt_minecraft_b4", false))
  2976. {
  2977. new Float:pos[3];
  2978. GetEntPropVector(caller, Prop_Send, "m_vecOrigin", pos);
  2979. if(RoundToNearest(pos[0]) == -952 && RoundToNearest(pos[1]) == -270 && RoundToNearest(pos[2]) == 72)
  2980. {
  2981. if(Job[activator] != traitor)
  2982. {
  2983. makeDamage(activator, activator, 999, (1<<17), 1.0, pos, "");
  2984. }
  2985. }
  2986.  
  2987. if(StrEqual(entityName, "Furnace_Trigger"))
  2988. {
  2989. DiaCount++;
  2990. if(MaxDiaCount != DiaCount) PrintChatAll("\x04[Furnace]\x07FFFFFFYou have placed %i In the furnace You need %i more.", DiaCount, MaxDiaCount-DiaCount);
  2991. if(MaxDiaCount == DiaCount) PrintChatAll("\x04[Furnace]\x07FFFFFFDiamond is made");
  2992. }
  2993.  
  2994. if(RoundToNearest(pos[0]) == -1808 && RoundToNearest(pos[1]) == 592 && RoundToNearest(pos[2]) == 738)
  2995. {
  2996. roundstart = false;
  2997. CS_TerminateRound(10.0, CSRoundEnd_TargetSaved);
  2998. }
  2999. }
  3000.  
  3001. if(StrContains(entityName, "ladder") != -1) {
  3002. // Occasionally I get 2 StartTouchTrigger events before an EndTouchTrigger when
  3003. // 2 ladders are placed close together. The onLadder accumulator works around this.
  3004. //LogMessage("Client %i: StartTouch %i", activator, onLadder[activator]);
  3005. MountLadder(activator);
  3006. }
  3007. }
  3008.  
  3009. public EndTouch(const String:output[], caller, activator, Float:delay)
  3010. {
  3011. decl String:entityName[32];
  3012. GetEntPropString(caller, Prop_Data, "m_iName", entityName, sizeof(entityName));
  3013.  
  3014. if(StrContains(entityName, "ladder") != -1) {
  3015. // Occasionally I get 2 StartTouchTrigger events before an EndTouchTrigger when
  3016. // 2 ladders are placed close together. The onLadder accumulator works around this.
  3017. //LogMessage("Client %i: EndTouch %i", activator, onLadder[activator]);
  3018. DismountLadder(activator);
  3019. }
  3020. }
  3021.  
  3022. public Action:Check(Handle:timer)
  3023. {
  3024. if(roundstart)
  3025. {
  3026. if(Time1 >= 1)
  3027. {
  3028. Time1 -= 1;
  3029. }
  3030. if(Time1 == 1)
  3031. {
  3032. if(chosen)
  3033. {
  3034. for(new i = 1; i <= MaxClients; i++)
  3035. {
  3036. if(IsClientInGame(i) && IsPlayerAlive(i))
  3037. {
  3038. if(!ReceiveCredit)
  3039. {
  3040. Credit[i] += 1;
  3041. PrintChat(i, "\x05You survived for a long time ,so you got 1 credit.");
  3042. }
  3043. }
  3044. }
  3045. ReceiveCredit = true;
  3046. }
  3047. }
  3048. if(Time2 >= 1)
  3049. {
  3050. Time2 -= 1;
  3051. }
  3052. else
  3053. {
  3054. for(new i=1; i<=MaxClients; i++)
  3055. {
  3056. if(JoinCheck(i))
  3057. {
  3058. PrintCenterText(i, "%T", "Innocent Win", i);
  3059. }
  3060. }
  3061. roundstart = false;
  3062. CS_TerminateRound(10.0, CSRoundEnd_TargetSaved);
  3063. }
  3064. }
  3065. }
  3066.  
  3067. public Action:Check_RoundEnd(Handle:timer)
  3068. {
  3069. if(roundstart && chosen)
  3070. {
  3071. for(new i; i<4; i++)
  3072. {
  3073. AliveJobCount[i] = 0;
  3074. }
  3075. for(new Client = 1; Client <= MaxClients; Client++)
  3076. {
  3077. if(IsClientInGame(Client))
  3078. {
  3079. if(IsPlayerAlive(Client) && Client != Bot)
  3080. {
  3081. AliveJobCount[Job[Client]] += 1;
  3082. }
  3083. }
  3084. }
  3085. if(AliveJobCount[detector] + AliveJobCount[innocent] <= 0 && AliveJobCount[traitor] <= 0)
  3086. {
  3087. if(JoinCheck(LastAttacker))
  3088. {
  3089. if(Job[LastAttacker] == traitor)
  3090. {
  3091. for(new i=1; i<=MaxClients; i++)
  3092. {
  3093. if(JoinCheck(i))
  3094. {
  3095. PrintCenterText(i, "%T", "Traitor Win", i);
  3096. }
  3097. }
  3098. CS_TerminateRound(10.0, CSRoundEnd_TargetBombed);
  3099. }
  3100. else
  3101. {
  3102. for(new i=1; i<=MaxClients; i++)
  3103. {
  3104. if(JoinCheck(i))
  3105. {
  3106. PrintCenterText(i, "%T", "Innocent Win", i);
  3107. }
  3108. }
  3109. CS_TerminateRound(10.0, CSRoundEnd_TargetSaved);
  3110. }
  3111. roundstart = false;
  3112. }
  3113. }
  3114. else if(AliveJobCount[detector] + AliveJobCount[innocent] <= 0)
  3115. {
  3116. for(new i=1; i<=MaxClients; i++)
  3117. {
  3118. if(JoinCheck(i))
  3119. {
  3120. PrintCenterText(i, "%T", "Traitor Win", i);
  3121. }
  3122. }
  3123. roundstart = false;
  3124. CS_TerminateRound(10.0, CSRoundEnd_TargetBombed);
  3125. }
  3126. else if(AliveJobCount[traitor] <= 0)
  3127. {
  3128. for(new i=1; i<=MaxClients; i++)
  3129. {
  3130. if(JoinCheck(i))
  3131. {
  3132. PrintCenterText(i, "%T", "Innocent Win", i);
  3133. }
  3134. }
  3135. roundstart = false;
  3136. CS_TerminateRound(10.0, CSRoundEnd_TargetSaved);
  3137. }
  3138. }
  3139. }
  3140.  
  3141. public OnClientPutInServer(Client)
  3142. {
  3143. for(new i = 1; i < MaxType+1; i++)
  3144. {
  3145. ItemID[Client][i] = 0;
  3146. ItemExist[Client][i] = false;
  3147. ItemOn[Client][i] = false;
  3148. }
  3149. for(new i=1; i<MAX_ITEMS; i++)
  3150. {
  3151. RestrictItem[Client][i] = false;
  3152. }
  3153. LastEngineTime[Client] = GetEngineTime();
  3154. PlayingTime[Client] = 0.0;
  3155. Point[Client] = 0;
  3156. FunCommand[Client] = 0;
  3157. VIP[Client] = 0;
  3158. TagColor[Client] = 0;
  3159. ChatDelay[Client] = false;
  3160. LastHitLog[Client] = "";
  3161. LastAttackLog[Client] = "";
  3162. DataLoaded[Client][0] = false;
  3163. DataLoaded[Client][1] = false;
  3164. DataLoaded[Client][2] = false;
  3165. Fun2[Client] = false;
  3166. PointDelay[Client] = GetEngineTime();
  3167. ResetData_Player(Client);
  3168. if(!IsFakeClient(Client))
  3169. {
  3170. CreateTimer(10.0, PlusPlayingTime, Client, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
  3171. new String:query[512], String:SteamID[256];
  3172. GetClientAuthString(Client, SteamID, 256);
  3173. if(!StrEqual(SteamID, ""))
  3174. {
  3175. Format(query, 512, "SELECT * FROM info WHERE steamid = '%s';", SteamID);
  3176. SQL_TQuery(databasehandle, info_check, query, Client);
  3177. Format(query, 512, "SELECT * FROM vip WHERE steamid = '%s';", SteamID);
  3178. SQL_TQuery(databasehandle, vip_check, query, Client);
  3179. Format(query, 512, "SELECT * FROM skin WHERE steamid = '%s';", SteamID);
  3180. SQL_TQuery(databasehandle, skin_check, query, Client);
  3181. Format(query, 512, "SELECT * FROM vmskin WHERE steamid = '%s';", SteamID);
  3182. SQL_TQuery(databasehandle, vmskin_check, query, Client);
  3183. Format(query, 512, "SELECT * FROM restrictitem WHERE steamid = '%s';", SteamID);
  3184. SQL_TQuery(databasehandle, restrict_check, query, Client);
  3185.  
  3186. SDKHook(Client, SDKHook_OnTakeDamage, OnTakeDamageHook);
  3187. SDKHook(Client, SDKHook_PostThinkPost, OnPostThinkPost);
  3188. SDKHook(Client, SDKHook_PostThink, OnPostThink);
  3189. SDKHook(Client, SDKHook_WeaponDrop, WeaponDrop);
  3190. SDKHook(Client, SDKHook_WeaponCanUse, WeaponCanUse);
  3191. SDKHook(Client, SDKHook_TraceAttack, OnTraceAttack);
  3192. SDKHook(Client, SDKHook_SetTransmit, Hook_SetTransmit4);
  3193. SDKHook(Client, SDKHook_WeaponEquip, Hook_OnWeaponEquip);
  3194. CreateTimer(0.2, Check_Player, Client, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
  3195. CreateTimer(0.1, Recognize_Player ,Client, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
  3196. CreateTimer(1.0, Recognize_Player2 ,Client, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
  3197. CreateTimer(0.1, RadarPlayer, Client, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
  3198.  
  3199. GravityGunPutInServer(Client);
  3200. }
  3201. else
  3202. {
  3203. PrintChat(Client, "\x04데이터 로드 실패. 10초후 데이터로드를 재시도합니다.");
  3204. CreateTimer(10.0, putinserver, Client);
  3205. }
  3206. }
  3207. else if(Client == 1)
  3208. {
  3209. Point[Client] = 7777777;
  3210. PlayingTime[Client] = 1601084.0;
  3211. }
  3212. }
  3213.  
  3214. public Action:putinserver(Handle:timer, any:Client)
  3215. {
  3216. if(JoinCheck(Client))
  3217. OnClientPutInServer(Client);
  3218. }
  3219.  
  3220. public Action:WeaponDrop(Client, weapons)
  3221. {
  3222. if(IsValidEntity(weapons) && IsValidEdict(weapons))
  3223. {
  3224. new String:classname[256];
  3225. GetEdictClassname(weapons, classname, 256);
  3226. if(StrEqual(classname, "weapon_c4", false))
  3227. {
  3228. return Plugin_Handled;
  3229. }
  3230. if(StrEqual(classname, "weapon_smokegrenade", false) && IsJihad[Client])
  3231. {
  3232. return Plugin_Handled;
  3233. }
  3234. CreateTimer(0.0, AcceptWeaponUse, Client);
  3235. BlockWeaponUse[Client] = true;
  3236. }
  3237. return Plugin_Continue;
  3238. }
  3239.  
  3240. public Action:WeaponCanUse(Client, weapons)
  3241. {
  3242. static Float:Differ[MAXPLAYERS+1];
  3243. if(IsValidEntity(weapons) && IsValidEdict(weapons))
  3244. {
  3245. new String:classname[32];
  3246. GetEdictClassname(weapons, classname, 32);
  3247. if(StrEqual(classname, "weapon_awp", false) || StrEqual(classname, "weapon_aug", false) || StrEqual(classname, "weapon_tmp", false) || StrEqual(classname, "weapon_sg552", false) || StrEqual(classname, "weapon_ump45", false))
  3248. {
  3249. new buttons = GetClientButtons(Client);
  3250. if(!(buttons & IN_USE) && GetPlayerWeaponSlot(Client, 0) == -1 && !BuyAcceptWeapon[Client])
  3251. {
  3252. new firstcolor[4] = {255, ...};
  3253. firstcolor[1] = 0;
  3254. firstcolor[2] = 0;
  3255. HudMsg(Client, 5, -1.0, 0.4, firstcolor, firstcolor, 1, 0.0, 0.0, 0.5, 0.0, "Press E to pick up weapon.");
  3256. if(FloatSub(GetEngineTime(), Differ[Client]) > 0.02)
  3257. {
  3258. PrintHintText(Client, "Press E to pick up weapon.");
  3259. Differ[Client] = GetEngineTime();
  3260. }
  3261. return Plugin_Handled;
  3262. }
  3263. else if(GetPlayerWeaponSlot(Client, 0) == -1)
  3264. {
  3265. BlockWeaponUse[Client] = true;
  3266. CreateTimer(0.0, AcceptWeaponUse, Client);
  3267. }
  3268. }
  3269. BuyAcceptWeapon[Client] = false;
  3270. }
  3271. return Plugin_Continue;
  3272. }
  3273.  
  3274. public Action:AcceptWeaponUse(Handle:timer, any:Client)
  3275. {
  3276. if(JoinCheck(Client))
  3277. {
  3278. BlockWeaponUse[Client] = false;
  3279. }
  3280. }
  3281.  
  3282. public OnPostThink(client)
  3283. {
  3284. if(JoinCheck(GetClientAimTarget(client)) && IsPlayerAlive(GetClientAimTarget(client)) && !IsDisguise[GetClientAimTarget(client)])
  3285. {
  3286. decl Float:pos[3], Float:angle[3];
  3287. GetClientEyePosition(client, pos);
  3288. GetClientEyeAngles(client, angle);
  3289.  
  3290. new Handle:traceresulthandle = INVALID_HANDLE;
  3291. if(!IsPlayerAlive(client) && GetEntProp(client, Prop_Send, "m_iObserverMode")==4) traceresulthandle = TR_TraceRayFilterEx(pos, angle, MASK_SOLID, RayType_Infinite, tracerayfilterdefault, GetEntPropEnt(client, Prop_Send, "m_hObserverTarget"));
  3292. else traceresulthandle = TR_TraceRayFilterEx(pos, angle, MASK_SOLID, RayType_Infinite, tracerayfilterdefault, client);
  3293.  
  3294. new Float:resultposition[3];
  3295. if(TR_DidHit(traceresulthandle) == true)
  3296. {
  3297. TR_GetEndPosition(resultposition, traceresulthandle);
  3298. new Float:vecmin[3] = {-4.0, -4.0, -8.0}, Float:vecmax[3] = {4.0, 4.0, 0.0};
  3299. new Handle:traceresulthandle2 = INVALID_HANDLE;
  3300. if(!IsPlayerAlive(client) && GetEntProp(client, Prop_Send, "m_iObserverMode")==4) traceresulthandle2 = TR_TraceHullFilterEx(pos, resultposition, vecmin, vecmax, MASK_PLAYERSOLID, tracerayfilterdefault, GetEntPropEnt(client, Prop_Send, "m_hObserverTarget"));
  3301. else traceresulthandle2 = TR_TraceHullFilterEx(pos, resultposition, vecmin, vecmax, MASK_PLAYERSOLID, tracerayfilterdefault, client);
  3302. MenuLastMan[client] = TR_GetEntityIndex(traceresulthandle);
  3303. if(!TR_GetEntityIndex(traceresulthandle)) MenuLastMan[client] = TR_GetEntityIndex(traceresulthandle2);
  3304. CloseHandle(traceresulthandle2);
  3305. }
  3306. CloseHandle(traceresulthandle);
  3307. }
  3308. if(IsInfect[client])
  3309. {
  3310. if(IsPlayerAlive(client))
  3311. {
  3312. new Handle:kv = CreateKeyValues("data"), String:Translate_Formatting[256];
  3313. Format(Translate_Formatting, 256, "%T", "progress zombie", client);
  3314. KvSetString(kv, "msg", Translate_Formatting);
  3315. KvSetNum(kv, "total", 500);
  3316. KvSetNum(kv, "current", RoundToZero(FloatSub(GetEngineTime(), LastFadeTime[client])*100));
  3317. ShowVGUIPanel(client, "nav_progress", kv, true);
  3318. CloseHandle(kv);
  3319. }
  3320. else
  3321. {
  3322. IsInfect[client] = false;
  3323. ShowVGUIPanel(client, "nav_progress", INVALID_HANDLE, false);
  3324. }
  3325. }
  3326. new buttons = GetClientButtons(client);
  3327. if(buttons & IN_ATTACK)
  3328. {
  3329. new WeaponIndex = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");
  3330. if(WeaponIndex <= 0) return;
  3331. if(GetGameTime() < GetEntPropFloat(WeaponIndex, Prop_Send, "m_flNextPrimaryAttack")) return;
  3332. if(GetGameTime() < GetEntPropFloat(client, Prop_Send, "m_flNextAttack")) return;
  3333. if(WeaponIndex == GetPlayerWeaponSlot(client, 1) && GetEntProp(client, Prop_Send, "m_iShotsFired")) return;
  3334. if(RPG[WeaponIndex]) return;
  3335. Process[client] = 0;
  3336. }
  3337. if(buttons & IN_ATTACK2)
  3338. {
  3339. new WeaponIndex = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");
  3340. if(WeaponIndex <= 0) return;
  3341. if(GetGameTime() < GetEntPropFloat(WeaponIndex, Prop_Send, "m_flNextPrimaryAttack")) return;
  3342. if(GetGameTime() < GetEntPropFloat(client, Prop_Send, "m_flNextAttack")) return;
  3343. if(WeaponIndex == GetPlayerWeaponSlot(client, 4) && GetEntProp(client, Prop_Send, "m_iShotsFired")) return;
  3344. SetEntProp(ClientVM[client][1], Prop_Send, "m_nSequence", 0);
  3345. Process[client] = 0;
  3346. }
  3347. }
  3348.  
  3349. public OnPostThinkPost(client)
  3350. {
  3351. static Float:Differ[MAXPLAYERS+1];
  3352. if(FloatSub(GetEngineTime(), Differ[client]) > 0.5)
  3353. {
  3354. if(IsPlayerAlive(client))
  3355. {
  3356. SetEntProp(client, Prop_Data, "m_iFrags", 1);
  3357. for(new i=1; i<=MaxClients; i++)
  3358. {
  3359. if(JoinCheck(i))
  3360. {
  3361. if(Job[client] == traitor)
  3362. {
  3363. if(!IsPlayerAlive(i) && Ragdoll[i] > 0 && !CheckedBody[Ragdoll[i]])
  3364. SetEntProp(client, Prop_Send, "m_bPlayerDominated", true, _, i);
  3365. else
  3366. SetEntProp(client, Prop_Send, "m_bPlayerDominated", false, _, i);
  3367. if(Job[i] == traitor)
  3368. SetEntProp(client, Prop_Send, "m_bPlayerDominatingMe", true, _, i);
  3369. else
  3370. SetEntProp(client, Prop_Send, "m_bPlayerDominatingMe", false, _, i);
  3371. }
  3372. else
  3373. {
  3374. SetEntProp(client, Prop_Send, "m_bPlayerDominated", false, _, i);
  3375. SetEntProp(client, Prop_Send, "m_bPlayerDominatingMe", false, _, i);
  3376. }
  3377. }
  3378. }
  3379. }
  3380. else
  3381. {
  3382. if((Ragdoll[client] > 0 && CheckedBody[Ragdoll[client]]))
  3383. SetEntProp(client, Prop_Data, "m_iFrags", 0);
  3384. else if(!Ragdoll[client])
  3385. SetEntProp(client, Prop_Data, "m_iFrags", -1);
  3386. else
  3387. SetEntProp(client, Prop_Data, "m_iFrags", 1);
  3388. for(new i=1; i<=MaxClients; i++)
  3389. {
  3390. if(JoinCheck(i))
  3391. {
  3392. if(!IsPlayerAlive(i) && Ragdoll[i] > 0 && !CheckedBody[Ragdoll[i]])
  3393. SetEntProp(client, Prop_Send, "m_bPlayerDominated", true, _, i);
  3394. else
  3395. SetEntProp(client, Prop_Send, "m_bPlayerDominated", false, _, i);
  3396. if(Job[i] == traitor)
  3397. SetEntProp(client, Prop_Send, "m_bPlayerDominatingMe", true, _, i);
  3398. else
  3399. SetEntProp(client, Prop_Send, "m_bPlayerDominatingMe", false, _, i);
  3400. }
  3401. }
  3402. }
  3403. SetEntProp(client, Prop_Data, "m_iDeaths", 0);
  3404. }
  3405. if(FloatSub(GetEngineTime(), PointDelay[client]) > GetPoint_Duration)
  3406. {
  3407. if(GetClientTeam(client) > 1)
  3408. {
  3409. Point[client] += GetPoint_Value;
  3410. SavePoint(client);
  3411. PrintToChat(client, "\x04You gained %ipoints for playing in the server!\n[ %imin = %i point ]", GetPoint_Value, RoundToNearest(GetPoint_Duration/60.0), GetPoint_Value);
  3412. }
  3413. PointDelay[client] = GetEngineTime();
  3414. }
  3415. SetEntProp(client, Prop_Send, "m_iAddonBits", 0);
  3416. SetEntProp(client, Prop_Send, "m_iPrimaryAddon", 0);
  3417. SetEntProp(client, Prop_Send, "m_iSecondaryAddon", 0);
  3418. SetEntPropString(client, Prop_Send, "m_szLastPlaceName", NULL_STRING);
  3419. static OldWeapon[MAXPLAYERS + 1];
  3420. static OldSequence[MAXPLAYERS + 1];
  3421. static Float:OldCycle[MAXPLAYERS + 1];
  3422. if(JoinCheck(GetClientAimTarget(client)) && IsPlayerAlive(GetClientAimTarget(client)) && !IsDisguise[GetClientAimTarget(client)]) MenuLastMan[client] = GetClientAimTarget(client);
  3423. if(IsValidEdict(ClientVM[client][1]) && IsValidEdict(ClientVM[client][0]))
  3424. {
  3425. decl String:ClassName[30];
  3426. new WeaponIndex;
  3427.  
  3428. //handle spectators
  3429. if (!IsPlayerAlive(client))
  3430. {
  3431. new spec = GetEntPropEnt(client, Prop_Send, "m_hObserverTarget");
  3432. if (spec > 0)
  3433. {
  3434. WeaponIndex = GetEntPropEnt(spec, Prop_Send, "m_hActiveWeapon");
  3435. if(IsValidEdict(WeaponIndex))
  3436. {
  3437. GetEdictClassname(WeaponIndex, ClassName, sizeof(ClassName));
  3438. if (StrEqual("weapon_knife", ClassName, false))
  3439. {
  3440. if(Dagger[spec])
  3441. {
  3442. SetEntProp(ClientVM[spec][1], Prop_Send, "m_nModelIndex", DaggerModel);
  3443. SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", DaggerModelW);
  3444. }
  3445. else
  3446. {
  3447. if(ItemOn[spec][VMSkinType] && ItemID[spec][VMSkinType])
  3448. {
  3449. new Model = PrecacheModel(ItemPath[ItemID[spec][VMSkinType]], true);
  3450. SetEntProp(ClientVM[spec][1], Prop_Send, "m_nModelIndex", Model);
  3451. }
  3452. else
  3453. {
  3454. SetEntProp(ClientVM[spec][1], Prop_Send, "m_nModelIndex", CrowbarModel);
  3455. }
  3456. SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", CrowbarModelW);
  3457. }
  3458. }
  3459. else if(StrEqual("weapon_deagle", ClassName, false))
  3460. {
  3461. if(GoldenGun[WeaponIndex])
  3462. {
  3463. SetEntProp(ClientVM[spec][1], Prop_Send, "m_nModelIndex", GoldenGunModel);
  3464. SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", GoldenGunModelW);
  3465. }
  3466. }
  3467. else if(StrEqual("weapon_c4", ClassName, false))
  3468. {
  3469. SetEntProp(ClientVM[spec][1], Prop_Send, "m_nModelIndex", StunStickModel);
  3470. SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", StunStickModelW);
  3471. }
  3472. else if(StrEqual("weapon_p228", ClassName, false))
  3473. {
  3474. SetEntProp(ClientVM[spec][1], Prop_Send, "m_nModelIndex", IgnitionGunModel);
  3475. SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", IgnitionGunModelW);
  3476. }
  3477. else if(StrEqual("weapon_awp", ClassName, false))
  3478. {
  3479. if(RPG[WeaponIndex])
  3480. {
  3481. SetEntProp(ClientVM[spec][1], Prop_Send, "m_nModelIndex", RPGModel);
  3482. SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", RPGModelW);
  3483. }
  3484. if(Silenced_Sniper_Rifle[WeaponIndex])
  3485. {
  3486. SetEntProp(ClientVM[spec][1], Prop_Send, "m_nModelIndex", SilencedSniperRifleModel);
  3487. SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", SilencedSniperRifleModelW);
  3488. }
  3489. }
  3490. else if(StrEqual("weapon_aug", ClassName, false))
  3491. {
  3492. if(Crossbow[WeaponIndex])
  3493. {
  3494. SetEntProp(ClientVM[spec][1], Prop_Send, "m_nModelIndex", CrossbowModel);
  3495. SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", CrossbowModelW);
  3496. }
  3497. }
  3498. else if(StrEqual("weapon_tmp", ClassName, false))
  3499. {
  3500. if(TVirus[WeaponIndex])
  3501. {
  3502. SetEntProp(ClientVM[spec][1], Prop_Send, "m_nModelIndex", TVirusModel);
  3503. SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", TVirusModelW);
  3504. }
  3505. }
  3506. else if(StrEqual("weapon_hegrenade", ClassName, false))
  3507. {
  3508. if(Teleporter[WeaponIndex])
  3509. {
  3510. SetEntProp(ClientVM[spec][1], Prop_Send, "m_nModelIndex", TeleporterModel);
  3511. SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", TeleporterModelW);
  3512. }
  3513. }
  3514. else if(StrEqual("weapon_smokegrenade", ClassName, false))
  3515. {
  3516. if(Jihad[WeaponIndex])
  3517. {
  3518. SetEntProp(ClientVM[spec][1], Prop_Send, "m_nModelIndex", JihadModel);
  3519. SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", JihadModelW);
  3520. SetEntPropFloat(WeaponIndex, Prop_Send, "m_flModelScale", 2.0);
  3521. }
  3522. }
  3523. else if(StrEqual("weapon_flashbang", ClassName, false))
  3524. {
  3525. if(HealthStation[WeaponIndex])
  3526. {
  3527. SetEntProp(ClientVM[spec][1], Prop_Send, "m_nModelIndex", HealthStationModel);
  3528. }
  3529. }
  3530. }
  3531. }
  3532. }
  3533.  
  3534. WeaponIndex = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");
  3535. new Sequence = GetEntProp(ClientVM[client][0], Prop_Send, "m_nSequence");
  3536. new Float:Cycle = GetEntPropFloat(ClientVM[client][0], Prop_Data, "m_flCycle");
  3537.  
  3538. if (WeaponIndex <= 0)
  3539. {
  3540. new EntEffects = GetEntProp(ClientVM[client][1], Prop_Send, "m_fEffects");
  3541. EntEffects |= EF_NODRAW;
  3542. SetEntProp(ClientVM[client][1], Prop_Send, "m_fEffects", EntEffects);
  3543.  
  3544. IsCustom[client] = false;
  3545.  
  3546. OldWeapon[client] = WeaponIndex;
  3547. OldSequence[client] = Sequence;
  3548. OldCycle[client] = Cycle;
  3549.  
  3550. return;
  3551. }
  3552.  
  3553. if(IsValidEdict(WeaponIndex)) GetEdictClassname(WeaponIndex, ClassName, sizeof(ClassName));
  3554.  
  3555. //just stuck the weapon switching in here aswell instead of a separate hook
  3556. if (WeaponIndex != OldWeapon[client])
  3557. {
  3558. new EntEffects = GetEntProp(ClientVM[client][1], Prop_Send, "m_fEffects");
  3559. EntEffects |= EF_NODRAW;
  3560. SetEntProp(ClientVM[client][1], Prop_Send, "m_fEffects", EntEffects);
  3561.  
  3562. if (StrEqual("weapon_knife", ClassName, false))
  3563. {
  3564. if(Dagger[client])
  3565. {
  3566. Weapon_SetViewModelIndex(client, DaggerModel);
  3567. SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", DaggerModelW);
  3568. }
  3569. else
  3570. {
  3571. if(ItemOn[client][VMSkinType] && ItemID[client][VMSkinType])
  3572. {
  3573. new Model = PrecacheModel(ItemPath[ItemID[client][VMSkinType]], true);
  3574. Weapon_SetViewModelIndex(client, Model);
  3575. }
  3576. else
  3577. {
  3578. Weapon_SetViewModelIndex(client, CrowbarModel);
  3579. }
  3580. SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", CrowbarModelW);
  3581. }
  3582. }
  3583. else if(StrEqual("weapon_deagle", ClassName, false))
  3584. {
  3585. if(GoldenGun[WeaponIndex])
  3586. {
  3587. Weapon_SetViewModelIndex(client, GoldenGunModel);
  3588. SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", GoldenGunModelW);
  3589. }
  3590. }
  3591. else if(StrEqual("weapon_c4", ClassName, false))
  3592. {
  3593. Weapon_SetViewModelIndex(client, StunStickModel);
  3594. SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", StunStickModelW);
  3595. }
  3596. else if(StrEqual("weapon_p228", ClassName, false))
  3597. {
  3598. Weapon_SetViewModelIndex(client, IgnitionGunModel);
  3599. SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", IgnitionGunModelW);
  3600. }
  3601. else if(StrEqual("weapon_awp", ClassName, false))
  3602. {
  3603. if(RPG[WeaponIndex])
  3604. {
  3605. Weapon_SetViewModelIndex(client, RPGModel);
  3606. SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", RPGModelW);
  3607. }
  3608. if(Silenced_Sniper_Rifle[WeaponIndex])
  3609. {
  3610. Weapon_SetViewModelIndex(client, SilencedSniperRifleModel);
  3611. SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", SilencedSniperRifleModelW);
  3612. }
  3613. }
  3614. else if(StrEqual("weapon_aug", ClassName, false))
  3615. {
  3616. if(Crossbow[WeaponIndex])
  3617. {
  3618. Weapon_SetViewModelIndex(client, CrossbowModel);
  3619. SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", CrossbowModelW);
  3620. }
  3621. }
  3622. else if(StrEqual("weapon_tmp", ClassName, false))
  3623. {
  3624. if(TVirus[WeaponIndex])
  3625. {
  3626. Weapon_SetViewModelIndex(client, TVirusModel);
  3627. SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", TVirusModelW);
  3628. }
  3629. }
  3630. else if(StrEqual("weapon_hegrenade", ClassName, false))
  3631. {
  3632. if(Teleporter[WeaponIndex])
  3633. {
  3634. Weapon_SetViewModelIndex(client, TeleporterModel);
  3635. SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", TeleporterModelW);
  3636. }
  3637. }
  3638. else if(StrEqual("weapon_smokegrenade", ClassName, false))
  3639. {
  3640. if(Jihad[WeaponIndex])
  3641. {
  3642. Weapon_SetViewModelIndex(client, JihadModel);
  3643. SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", JihadModelW);
  3644. SetEntPropFloat(WeaponIndex, Prop_Send, "m_flModelScale", 2.0);
  3645. }
  3646. }
  3647. else if(StrEqual("weapon_flashbang", ClassName, false))
  3648. {
  3649. if(HealthStation[WeaponIndex])
  3650. {
  3651. Weapon_SetViewModelIndex(client, HealthStationModel);
  3652. }
  3653. }
  3654. else
  3655. {
  3656. IsCustom[client] = false;
  3657. }
  3658. }
  3659. else
  3660. {
  3661. //copy the animation stuff from the viewmodel to the used one every frame
  3662. if(IsValidEdict(ClientVM[client][1]) && !(StrEqual(ClassName, "weapon_awp", false) && RPG[WeaponIndex]) && !(StrEqual(ClassName, "weapon_aug", false) && Crossbow[WeaponIndex]))
  3663. {
  3664. if(GetEntPropEnt(client, Prop_Data, "m_hActiveWeapon") == GetPlayerWeaponSlot(client, 2))
  3665. {
  3666. if(ItemID[client][VMSkinType] == 59 && (Sequence == 5 || Sequence == 4)) SetEntProp(ClientVM[client][1], Prop_Send, "m_nSequence", 2);
  3667. else if(ItemID[client][VMSkinType] == 59 && Sequence == 3) SetEntProp(ClientVM[client][1], Prop_Send, "m_nSequence", 1);
  3668. else if(ItemID[client][VMSkinType] == 59 && Sequence == 1) SetEntProp(ClientVM[client][1], Prop_Send, "m_nSequence", 3);
  3669. else SetEntProp(ClientVM[client][1], Prop_Send, "m_nSequence", GetEntProp(ClientVM[client][0], Prop_Send, "m_nSequence"));
  3670. }
  3671. else SetEntProp(ClientVM[client][1], Prop_Send, "m_nSequence", GetEntProp(ClientVM[client][0], Prop_Send, "m_nSequence"));
  3672. Sequence = GetEntProp(ClientVM[client][1], Prop_Send, "m_nSequence");
  3673. SetEntPropFloat(ClientVM[client][1], Prop_Send, "m_flPlaybackRate", GetEntPropFloat(ClientVM[client][0], Prop_Send, "m_flPlaybackRate"));
  3674. static Data[MAXPLAYERS+1];
  3675. if(GetEntPropEnt(client, Prop_Data, "m_hActiveWeapon") == GetPlayerWeaponSlot(client, 2))
  3676. {
  3677. if((Cycle < OldCycle[client]) && Sequence == OldSequence[client])
  3678. {
  3679. SetEntProp(ClientVM[client][1], Prop_Send, "m_nSequence", 0);
  3680. Data[client] = 4;
  3681. }
  3682. if(Data[client])
  3683. {
  3684. Data[client] -= 1;
  3685. SetEntProp(ClientVM[client][1], Prop_Send, "m_nSequence", 0);
  3686. }
  3687. }
  3688. else
  3689. {
  3690. if(Data[client]) Data[client] = 0;
  3691. if(Cycle < OldCycle[client] && Sequence == OldSequence[client])
  3692. {
  3693. SetEntProp(ClientVM[client][1], Prop_Send, "m_nSequence", 0);
  3694. }
  3695. }
  3696. }
  3697. }
  3698. //hide viewmodel a frame after spawning
  3699. if (SpawnCheck[client])
  3700. {
  3701. SpawnCheck[client] = false;
  3702. if(IsCustom[client])
  3703. {
  3704. new EntEffects = GetEntProp(ClientVM[client][0], Prop_Send, "m_fEffects");
  3705. EntEffects |= EF_NODRAW;
  3706. SetEntProp(ClientVM[client][0], Prop_Send, "m_fEffects", EntEffects);
  3707. }
  3708. }
  3709.  
  3710. OldWeapon[client] = WeaponIndex;
  3711. OldSequence[client] = Sequence;
  3712. OldCycle[client] = Cycle;
  3713. }
  3714.  
  3715. new buttons = GetClientButtons(client);
  3716. if(buttons & IN_ATTACK)
  3717. {
  3718. new String:classname[256];
  3719. GetEdictClassname(GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon"), classname, 256);
  3720. if(!Process[client])
  3721. {
  3722. for(new i; i< MAX_WEAPON; i++)
  3723. {
  3724. if(StrEqual(classname, WeaponDelay[i][0], false))
  3725. {
  3726. if(!StrEqual(classname, "weapon_c4", false))
  3727. {
  3728. if(!VIP[client]) SetEntProp(client, Prop_Send, "m_iShotsFired", 1);
  3729. else SetEntProp(client, Prop_Send, "m_iShotsFired", 0);
  3730. new Float:Delay = StringToFloat(WeaponDelay[i][1]);
  3731. SetEntDataFloat(GetEntPropEnt(client, Prop_Data, "m_hActiveWeapon"), g_NextPrimaryAttack, FloatAdd(GetGameTime(), Delay), true);
  3732. }
  3733. }
  3734. }
  3735. Process[client] = 1;
  3736. }
  3737. }
  3738. new String:classname[256], WeaponIndex = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");
  3739. if(WeaponIndex > 0 && IsValidEdict(WeaponIndex)) GetEdictClassname(WeaponIndex, classname, 256);
  3740. if(buttons & IN_ATTACK2)
  3741. {
  3742. if(!Process[client])
  3743. {
  3744. for(new i; i< MAX_WEAPON; i++)
  3745. {
  3746. if(StrEqual(classname, WeaponDelay[i][0], false))
  3747. {
  3748. if(StrEqual(classname, "weapon_c4", false))
  3749. {
  3750. SetEntProp(client, Prop_Send, "m_iShotsFired", 1);
  3751. new Float:Delay = StringToFloat(WeaponDelay[i][1]);
  3752. SetEntDataFloat(GetEntPropEnt(client, Prop_Data, "m_hActiveWeapon"), g_NextPrimaryAttack, FloatAdd(GetGameTime(), Delay), true);
  3753. }
  3754. }
  3755. }
  3756. }
  3757. }
  3758. if(StrEqual(classname, "weapon_c4"))
  3759. {
  3760. if(ReloadCount[client] > 0)
  3761. {
  3762. SetEntProp(ClientVM[client][1], Prop_Send, "m_nSequence", 2);
  3763. ReloadCount[client] -= 1;
  3764. }
  3765. }
  3766. }
  3767.  
  3768. public WeaponWorldModelThink(weapon)
  3769. {
  3770. decl String:name[64];
  3771. GetEdictClassname(weapon, name, sizeof(name));
  3772. if(StrEqual(name, "weapon_deagle") && GoldenGun[weapon])
  3773. {
  3774. SetEntProp(weapon, Prop_Send, "m_iWorldModelIndex", GoldenGunModelW);
  3775. }
  3776. else if(StrEqual(name, "weapon_awp") && RPG[weapon])
  3777. {
  3778. SetEntProp(weapon, Prop_Send, "m_iWorldModelIndex", RPGModelW);
  3779. }
  3780. else if(StrEqual(name, "weapon_awp") && Silenced_Sniper_Rifle[weapon])
  3781. {
  3782. SetEntProp(weapon, Prop_Send, "m_iWorldModelIndex", SilencedSniperRifleModelW);
  3783. }
  3784. else if(StrEqual(name, "weapon_aug") && Crossbow[weapon])
  3785. {
  3786. SetEntProp(weapon, Prop_Send, "m_iWorldModelIndex", CrossbowModelW);
  3787. }
  3788. else if(StrEqual(name, "weapon_p228"))
  3789. {
  3790. SetEntProp(weapon, Prop_Send, "m_iWorldModelIndex", IgnitionGunModelW);
  3791. }
  3792. else if(StrEqual(name, "weapon_tmp") && TVirus[weapon])
  3793. {
  3794. SetEntProp(weapon, Prop_Send, "m_iWorldModelIndex", TVirusModelW);
  3795. }
  3796. else if(StrEqual(name, "weapon_hegrenade") && Teleporter[weapon])
  3797. {
  3798. SetEntProp(weapon, Prop_Send, "m_iWorldModelIndex", TeleporterModelW);
  3799. }
  3800. else if(StrEqual(name, "weapon_smokegrenade") && Jihad[weapon])
  3801. {
  3802. SetEntProp(weapon, Prop_Send, "m_iWorldModelIndex", JihadModelW);
  3803. SetEntPropFloat(weapon, Prop_Send, "m_flModelScale", 2.0);
  3804. }
  3805. }
  3806.  
  3807. public Action:Check_Player(Handle:timer, any:Client)
  3808. {
  3809. if(JoinCheck(Client))
  3810. {
  3811. new Target = GetPlayerStuckEnt(Client);
  3812. if(JoinCheck(Target) && GetEntProp(Client, Prop_Send, "m_CollisionGroup") != 17) SetEntProp(Client, Prop_Send, "m_CollisionGroup", 17);
  3813. else if(!JoinCheck(Target) && GetEntProp(Client, Prop_Send, "m_CollisionGroup") != 5) SetEntProp(Client, Prop_Send, "m_CollisionGroup", 5);
  3814. new String:Translate_Formatting[256];
  3815. if(IsPlayerAlive(Client))
  3816. {
  3817. CS_SetClientClanTag(Client, "Alive");
  3818. decl String:strTime[256], String:strTime2[256];
  3819. FormatTime_Hud2(Client, Time1, strTime, 256);
  3820. FormatTime_Hud2(Client, Time2, strTime2, 256);
  3821. new String:Formatting[256];
  3822. if(Job[Client] == detector && !StrEqual(DNASample[Client][0], ""))
  3823. {
  3824. Format(Formatting, 256, "%s's DNA Scan\n[", DNASample[Client][1]);
  3825. if(DNAScanCount[Client] >= 30)
  3826. {
  3827. Format(Formatting, 256, "%s██████████]", Formatting);
  3828. }
  3829. else
  3830. {
  3831. new count;
  3832. for(new i; i < DNAScanCount[Client]/3; i++)
  3833. {
  3834. count++;
  3835. Format(Formatting, 256, "%sâ–ˆ", Formatting);
  3836. }
  3837. for(new i; i< 10-count; i++)
  3838. {
  3839. Format(Formatting, 256, "%s ", Formatting);
  3840. }
  3841. Format(Formatting, 256, "%s]", Formatting, DNAScanCount[Client]);
  3842. }
  3843. }
  3844. Format(Translate_Formatting, 256, "%s\n%T : %T\n%T\n%T : %i\nKarma : %i", Translate_Formatting, "job", Client, JobName[Job[Client]], Client, "you have credit", Client, Credit[Client], "point", Client, Point[Client], Karma[Client]);
  3845. if(chosen)
  3846. {
  3847. if(Time1 == 0) Format(Translate_Formatting, 256, "%s\n%T : %T", Translate_Formatting, "time", Client, "extended time", Client);
  3848. else Format(Translate_Formatting, 256, "%s\n%T : %s", Translate_Formatting, "time", Client, strTime);
  3849. if(Job[Client] == traitor) Format(Translate_Formatting, 256, "%s\n%T : %s", Translate_Formatting, "traitor's time", Client, strTime2);
  3850. }
  3851. else Format(Translate_Formatting, 256, "%s\n%T : %s", Translate_Formatting, "ready", Client, strTime);
  3852. if(Radar[Client])
  3853. {
  3854. if(RadarCount[Client] > 0) Format(Translate_Formatting, 256, "%s\n%T : %T", Translate_Formatting, "radar", Client, "remaining active", Client, RoundToCeil(float(RadarCount[Client])/10.0));
  3855. else Format(Translate_Formatting, 256, "%s\n%T : %T", Translate_Formatting, "radar", Client, "on active", Client);
  3856. }
  3857. if(!StrEqual(Formatting, "", false)) Format(Translate_Formatting, 256, "%s\n%s", Translate_Formatting, Formatting);
  3858. sendKeyHintTextMsg(Client, Translate_Formatting);
  3859. }
  3860. else
  3861. {
  3862. if(chosen)
  3863. {
  3864. decl String:strTime[256], String:strTime2[256];
  3865. FormatTime_Hud2(Client, Time1, strTime, 256);
  3866. FormatTime_Hud2(Client, Time2, strTime2, 256);
  3867. if(Time1 >= 1)
  3868. {
  3869. Format(Translate_Formatting, 256, "%T : %i\nKarma : %i\n%T : %s\n%T : %s", "point", Client, Point[Client], Karma[Client], "time", Client, strTime, "traitor's time", Client, strTime2);
  3870. }
  3871. else
  3872. {
  3873. Format(Translate_Formatting, 256, "%T : %i\nKarma : %i\n%T : %T\n%T : %s", "point", Client, Point[Client], Karma[Client], "time", Client, "extended time", Client, "traitor's time", Client, strTime2);
  3874. }
  3875. }
  3876. else
  3877. {
  3878. decl String:strTime[256];
  3879. FormatTime_Hud2(Client, Time1, strTime, 256);
  3880. Format(Translate_Formatting, 256, "%T : %i\nKarma : %i\n%T : %s", "point", Client, Point[Client], Karma[Client], "ready", Client, strTime);
  3881. }
  3882. sendKeyHintTextMsg(Client, Translate_Formatting);
  3883. if(Ragdoll[Client] > 0)
  3884. {
  3885. if(CheckedBody[Ragdoll[Client]]) CS_SetClientClanTag(Client, "Dead");
  3886. else CS_SetClientClanTag(Client, "Alive");
  3887. }
  3888. else CS_SetClientClanTag(Client, "Observer");
  3889. }
  3890. }
  3891. else return Plugin_Stop;
  3892. return Plugin_Continue;
  3893. }
  3894.  
  3895. public Action:Recognize_Player2(Handle:timer, any:Client)
  3896. {
  3897. if(JoinCheck(Client))
  3898. {
  3899. if(BlockWeaponUse[Client]) BlockWeaponUse[Client] = false;//이게 만약 true일경우에는 무기를 들수가 없다. 항상 체크해줘야 한다.
  3900. new String:Formatting[256], Alive_Innocent, Disappear_Innocent, Dead_Innocent, Alive_Detective, Disappear_Detective, Dead_Detective;
  3901. Format(Formatting, 256, "-- %T --", "list of traitor", Client);
  3902. for(new i = 1; i <= MaxClients; i++)
  3903. {
  3904. if(JoinCheck(i) && Job[i] == traitor)
  3905. {
  3906. if(IsPlayerAlive(i)) Format(Formatting, 256, "%s\n%N", Formatting, i);
  3907. else if(!CheckedBody[Ragdoll[i]]) Format(Formatting, 256, "%s\n*실종* %N", Formatting, i);
  3908. else Format(Formatting, 256, "%s\n*사망* %N", Formatting, i);
  3909. }
  3910. if(JoinCheck(i))
  3911. {
  3912. if(IsPlayerAlive(i))
  3913. {
  3914. if(Job[i] == innocent) Alive_Innocent++;
  3915. if(Job[i] == detector) Alive_Detective++;
  3916. }
  3917. else if(!CheckedBody[Ragdoll[i]])
  3918. {
  3919. if(Job[i] == innocent) Disappear_Innocent++;
  3920. if(Job[i] == detector) Disappear_Detective++;
  3921. }
  3922. else
  3923. {
  3924. if(Job[i] == innocent) Dead_Innocent++;
  3925. if(Job[i] == detector) Dead_Detective++;
  3926. }
  3927. }
  3928. }
  3929. if(Job[Client] == traitor || !IsPlayerAlive(Client))
  3930. {
  3931. new firstcolor[4] = {255, ...};
  3932. firstcolor[0] = 255;
  3933. firstcolor[1] = 127;
  3934. firstcolor[2] = 42;
  3935. HudMsg(Client, 1, 0.75, 0.08, firstcolor, firstcolor, 1, 0.0, 0.0, 3.0, 0.0, Formatting);
  3936. Format(Formatting, 256, "%T : %i\n%T : %i\n%T : %i\n%T : %i\n%T : %i\n%T : %i", "Alive innocent", Client, Alive_Innocent, "Alive Detective", Client, Alive_Detective, "Missing innocent", Client, Disappear_Innocent, "Missing Detective", Client, Disappear_Detective, "Dead innocent", Client, Dead_Innocent, "Dead Detective", Client, Dead_Detective);
  3937. HudMsg(Client, 2, 0.75, 0.4, firstcolor, firstcolor, 1, 0.0, 0.0, 3.0, 0.0, Formatting);
  3938. }
  3939. }
  3940. else return Plugin_Stop;
  3941. return Plugin_Continue;
  3942. }
  3943.  
  3944. public Action:Recognize_Player(Handle:timer, any:Client)
  3945. {
  3946. if(JoinCheck(Client))
  3947. {
  3948. decl Float:pos[3], Float:angle[3];
  3949. GetClientEyePosition(Client, pos);
  3950. GetClientEyeAngles(Client, angle);
  3951.  
  3952. new Handle:traceresulthandle = INVALID_HANDLE;
  3953. if(!IsPlayerAlive(Client) && GetEntProp(Client, Prop_Send, "m_iObserverMode")==4) traceresulthandle = TR_TraceRayFilterEx(pos, angle, MASK_SOLID, RayType_Infinite, tracerayfilterdefault, GetEntPropEnt(Client, Prop_Send, "m_hObserverTarget"));
  3954. else traceresulthandle = TR_TraceRayFilterEx(pos, angle, MASK_SOLID, RayType_Infinite, tracerayfilterdefault, Client);
  3955.  
  3956. new Float:resultposition[3], Entity;
  3957. if(TR_DidHit(traceresulthandle) == true)
  3958. {
  3959. TR_GetEndPosition(resultposition, traceresulthandle);
  3960. new Float:vecmin[3] = {-4.0, -4.0, -8.0}, Float:vecmax[3] = {4.0, 4.0, 0.0};
  3961. new Handle:traceresulthandle2 = INVALID_HANDLE;
  3962. if(!IsPlayerAlive(Client) && GetEntProp(Client, Prop_Send, "m_iObserverMode")==4) traceresulthandle2 = TR_TraceHullFilterEx(pos, resultposition, vecmin, vecmax, MASK_PLAYERSOLID, tracerayfilterdefault, GetEntPropEnt(Client, Prop_Send, "m_hObserverTarget"));
  3963. else traceresulthandle2 = TR_TraceHullFilterEx(pos, resultposition, vecmin, vecmax, MASK_PLAYERSOLID, tracerayfilterdefault, Client);
  3964. Entity = TR_GetEntityIndex(traceresulthandle);
  3965. if(!TR_GetEntityIndex(traceresulthandle)) Entity = TR_GetEntityIndex(traceresulthandle2);
  3966. CloseHandle(traceresulthandle2);
  3967. }
  3968. CloseHandle(traceresulthandle);
  3969.  
  3970. new String:Formatting[256];
  3971. if(JoinCheck(Entity))
  3972. {
  3973. if(IsDisguise[Entity])
  3974. {
  3975. return Plugin_Handled;
  3976. }
  3977. Format(Formatting, 256, "%N", Entity);
  3978. if(Job[Entity] == detector)
  3979. {
  3980. Format(Formatting, 256, "%s\n%T : %T", Formatting, "job", Client, JobName[Job[Entity]], Client);
  3981. HudMsg(Client, 4, -1.0, -1.0, {0, 0, 255, 255}, {0, 0, 255, 255}, 1, 0.0, 0.0, 1.0, 0.0, "ã…¡\n/ \\\nã…£ ã…£\n\\ /\nã…¡");
  3982. }
  3983. if(Job[Entity] == traitor)
  3984. {
  3985. if(Job[Client] == traitor) HudMsg(Client, 4, -1.0, -1.0, {255, 0, 0, 255}, {255, 0, 0, 255}, 1, 0.0, 0.0, 1.0, 0.0, "ã…¡\n/ \\\nã…£ ã…£\n\\ /\nã…¡");
  3986. }
  3987. if(GetClientHealth(Entity) < 20) Format(Formatting, 256, "%s\n%T", Formatting, "Near Death", Client);
  3988. else if(GetClientHealth(Entity) < 40) Format(Formatting, 256, "%s\n%T", Formatting, "Badly Wounded", Client);
  3989. else if(GetClientHealth(Entity) < 60) Format(Formatting, 256, "%s\n%T", Formatting, "Wounded", Client);
  3990. else if(GetClientHealth(Entity) < 80) Format(Formatting, 256, "%s\n%T", Formatting, "Hurt", Client);
  3991. else Format(Formatting, 256, "%s\n%T", Formatting, "Healthy", Client);
  3992. if(VIP[Entity]) Format(Formatting, 256, "%s\nVIP", Formatting);
  3993. }
  3994. else if(IsRagdoll[Entity])
  3995. {
  3996. if(!CheckedBody[Entity])
  3997. {
  3998. Format(Formatting, 256, "%T", "unidentified body", Client);
  3999. }
  4000. else
  4001. {
  4002. new String:TargetName[256];
  4003. GetEntPropString(Entity, Prop_Data, "m_iName", TargetName, 256);
  4004. Format(Formatting, 256, "%T", "person's corpse", Client, TargetName);
  4005. }
  4006. }
  4007. else if(IsHealthBox[Entity] || IsFakeHealthBox[Entity])
  4008. {
  4009. if(!HealthBox[Entity]) Format(Formatting, 256, "%T", "Empty Health Station", Client);
  4010. else if(IsFakeHealthBox[Entity] && Job[Client] == traitor) Format(Formatting, 256, "%T\n%T : %i", "Fake Health Station", Client, "Remain Health Amount", Client, HealthBox[Entity]);
  4011. else Format(Formatting, 256, "%T\n%T : %i", "Health Station", Client, "Remain Health Amount", Client, HealthBox[Entity]);
  4012. }
  4013. PrintHintText(Client, Formatting);
  4014. new firstcolor[4] = {255, ...};
  4015. firstcolor[0] = 255;
  4016. firstcolor[1] = 150;
  4017. firstcolor[2] = 200;
  4018. if(!StrEqual(Formatting, "")) HudMsg(Client, 3, -1.0, 0.55, firstcolor, firstcolor, 2, 0.01, 0.7, 0.2, 0.0, Formatting);
  4019. if(Fun2[Client]) ClientCommand(Client, "r_screenoverlay \"%s\"", "effects/alyxmonitor_talk.vmt");
  4020. }
  4021. else return Plugin_Stop;
  4022. return Plugin_Continue;
  4023. }
  4024.  
  4025. public Action:PlusPlayingTime(Handle:timer, any:Client)
  4026. {
  4027. if(JoinCheck(Client))
  4028. {
  4029. if(GetClientTeam(Client) > 1 && DataLoaded[Client][0] && DataLoaded[Client][1] && DataLoaded[Client][2])
  4030. {
  4031. new Float:differ = FloatSub(GetEngineTime(), LastEngineTime[Client]);
  4032. PlayingTime[Client] += differ;
  4033. new String:SteamID[256], String:query[512];
  4034. GetClientAuthString(Client ,SteamID, 256);
  4035. Format(query, 512, "UPDATE info SET playingtime = '%f' WHERE steamid = '%s';", PlayingTime[Client], SteamID);
  4036. SQL_TQuery(databasehandle, save_info, query, Client);
  4037.  
  4038. Format(query, 512, "SELECT * FROM vip WHERE steamid = '%s';", SteamID);
  4039. SQL_TQuery(databasehandle, vip_check, query, Client);
  4040. }
  4041. LastEngineTime[Client] = GetEngineTime();
  4042. }
  4043. else return Plugin_Stop;
  4044. return Plugin_Continue;
  4045. }
  4046.  
  4047. public OnClientDisconnect(Client)
  4048. {
  4049. AliveJobCount[Job[Client]] -= 1;
  4050. GravityGunDisconnect(Client);
  4051. }
  4052.  
  4053. public Action:JoinTeam(Client, Args)
  4054. {
  4055. decl String:text[192];
  4056. GetCmdArgString(text, sizeof(text));
  4057.  
  4058. new startidx = 0;
  4059. if(text[strlen(text)-1] == '"')
  4060. {
  4061. text[strlen(text)-1] = '\0';
  4062. startidx = 1;
  4063. }
  4064.  
  4065. new team = StringToInt(text[startidx]);
  4066.  
  4067. if(team > 1 && roundstart && !chosen)
  4068. {
  4069. CreateTimer(1.0, RespawnPlayer, Client);
  4070. }
  4071. }
  4072.  
  4073. public Action:JoinClass(Client, args)
  4074. {
  4075. if(IsPlayerAlive(Client)) return Plugin_Handled;
  4076. return Plugin_Continue;
  4077. }
  4078.  
  4079. public EventSpawn( Handle:Spawn_Event, const String:Death_Name[], bool:Death_Broadcast )
  4080. {
  4081. new Client = GetClientOfUserId(GetEventInt(Spawn_Event, "userid"));
  4082. if(IsPlayerAlive(Client) && !chosen && GetClientTeam(Client) > 1)
  4083. {
  4084. SpawnCheck[Client] = true;
  4085. new weapons = GetPlayerWeaponSlot(Client, 1);
  4086. if(IsValidEdict(weapons))
  4087. {
  4088. RemovePlayerItem(Client, weapons);
  4089. RemoveEdict(weapons);
  4090. }
  4091. weapons = GetPlayerWeaponSlot(Client, 2);
  4092. if(IsValidEdict(weapons))
  4093. {
  4094. RemovePlayerItem(Client, weapons);
  4095. RemoveEdict(weapons);
  4096. }
  4097. GivePlayerItem(Client, "weapon_knife");
  4098. weapons = GetPlayerWeaponSlot(Client, 0);
  4099. if(IsValidEdict(weapons))
  4100. {
  4101. RemovePlayerItem(Client, weapons);
  4102. RemoveEdict(weapons);
  4103. }
  4104. new bool:check;
  4105. do
  4106. {
  4107. check = false;
  4108. weapons = GetPlayerWeaponSlot(Client, 3);
  4109. if(IsValidEdict(weapons))
  4110. {
  4111. RemovePlayerItem(Client, weapons);
  4112. RemoveEdict(weapons);
  4113. check = true;
  4114. }
  4115. } while(check);
  4116. GivePlayerItem(Client, "weapon_fiveseven");
  4117. if(ItemOn[Client][SkinType] && ItemID[Client][SkinType])
  4118. {
  4119. SetEntityModel(Client, ItemPath[ItemID[Client][SkinType]]);
  4120. }
  4121. SetEntProp(Client, Prop_Send, "m_bHasHelmet", 1);
  4122. LastHitLog[Client] = HitLog[Client];
  4123. LastAttackLog[Client] = AttackLog[Client];
  4124. ResetData_Player(Client);
  4125. if(!IsFakeClient(Client)) CreateTimer(0.0, EventSpawn_Delay, Client);
  4126. SDKUnhook(Client, SDKHook_PreThink, MoveOnLadder);
  4127. SetEntityGravity(Client, 1.0);
  4128. }
  4129. if(chosen)
  4130. {
  4131. new weapons = GetPlayerWeaponSlot(Client, 1);
  4132. if(IsValidEdict(weapons))
  4133. {
  4134. RemovePlayerItem(Client, weapons);
  4135. RemoveEdict(weapons);
  4136. }
  4137. ChosenJoin[Client] = true;
  4138. new Float:Position[3];
  4139. GetClientAbsOrigin(Client, Position);
  4140. makeDamage(Client, Client, 999, (1<<17), 1.0, Position, "");
  4141. ResetData_Player(Client);
  4142. }
  4143. IsShowMenu[Client] = false;
  4144. ShowMenuCount[Client] = 0;
  4145. }
  4146.  
  4147. public Action:EventSpawn_Delay(Handle:timer, any:Client)
  4148. {
  4149. if(IsPlayerAlive(Client) && !chosen && GetClientTeam(Client) != 1)
  4150. {
  4151. GivePlayerItem(Client, "weapon_c4");
  4152. }
  4153. }
  4154.  
  4155. public Action:RadarPlayer(Handle:timer, any:Client)
  4156. {
  4157. if(JoinCheck(Client) && IsPlayerAlive(Client))
  4158. {
  4159. if(!Radar[Client])
  4160. {
  4161. SetEntDataFloat(Client, g_flFlashDuration, GetRandomFloat(10.0, 3600.0), true);
  4162. if(!Fun[Client]) SetEntDataFloat(Client, g_flFlashMaxAlpha, GetRandomFloat(0.1, 1.0), true);
  4163. else SetEntDataFloat(Client, g_flFlashMaxAlpha, GetRandomFloat(50.0, 255.0), true);
  4164. }
  4165. else if(RadarCount[Client] > 0)
  4166. {
  4167. RadarCount[Client] -= 1;
  4168. SetEntDataFloat(Client, g_flFlashDuration, GetRandomFloat(10.0, 3600.0), true);
  4169. if(!Fun[Client]) SetEntDataFloat(Client, g_flFlashMaxAlpha, GetRandomFloat(0.1, 1.0), true);
  4170. else SetEntDataFloat(Client, g_flFlashMaxAlpha, GetRandomFloat(50.0, 255.0), true);
  4171. }
  4172. else if(RadarCount[Client] > - 40)
  4173. {
  4174. RadarCount[Client] -= 1;
  4175. SetEntDataFloat(Client, g_flFlashDuration, 0.0, true);
  4176. SetEntDataFloat(Client, g_flFlashMaxAlpha, 0.5, true);
  4177. }
  4178. else
  4179. {
  4180. RadarCount[Client] = 300;
  4181. }
  4182. }
  4183. else if(JoinCheck(Client))
  4184. {
  4185. if(Fun[Client])
  4186. {
  4187. SetEntDataFloat(Client, g_flFlashMaxAlpha, GetRandomFloat(50.0, 255.0), true);
  4188. SetEntDataFloat(Client, g_flFlashDuration, GetRandomFloat(10.0, 3600.0), true);
  4189. }
  4190. else
  4191. {
  4192. SetEntDataFloat(Client, g_flFlashDuration, 0.0, true);
  4193. SetEntDataFloat(Client, g_flFlashMaxAlpha, 0.5, true);
  4194. }
  4195. }
  4196. else return Plugin_Stop;
  4197. return Plugin_Continue;
  4198. }
  4199.  
  4200. public EventHurt( Handle:Spawn_Event, const String:Death_Name[], bool:Death_Broadcast )
  4201. {
  4202. new Client = GetClientOfUserId(GetEventInt(Spawn_Event, "userid"));
  4203. new Attacker = GetClientOfUserId(GetEventInt(Spawn_Event, "attacker"));
  4204. new damage = GetEventInt(Spawn_Event, "dmg_health");
  4205. new String:WeaponName[256];
  4206. GetEventString(Spawn_Event, "weapon", WeaponName, 256);
  4207. if(StrEqual(WeaponName, "ump45", false))
  4208. {
  4209. new Float:vecPunch[3];
  4210. GetEntDataVector(Client, offsPunchAngle, vecPunch);
  4211. vecPunch[0] += GetRandomFloat(-20.0, 20.0);
  4212. vecPunch[1] += GetRandomFloat(-20.0, 20.0);
  4213. SetEntDataVector(Client, offsPunchAngle, vecPunch);
  4214. }
  4215. if(!StrContains(WeaponName, "prop_", false)) Format(WeaponName, 256, "prop");
  4216. if(JoinCheck(Attacker))
  4217. {
  4218. new weapons = GetEntPropEnt(Attacker, Prop_Data, "m_hActiveWeapon");
  4219. if(StrEqual(WeaponName, "awp", false) && weapons > 0 && Silenced_Sniper_Rifle[weapons]) Format(WeaponName, 256, "SSR");
  4220. }
  4221. if(JoinCheck(Attacker) && Attacker != Client)
  4222. {
  4223. if(StrEqual(WeaponName, "T-Virus", false))
  4224. {
  4225. if(Job[Attacker] == traitor) Format(HitLog[Client], 4096, "%s�[T]%N : T-Virus", HitLog[Client], Attacker);
  4226. if(Job[Attacker] == detector) Format(HitLog[Client], 4096, "%s�[D]%N : T-Virus", HitLog[Client], Attacker);
  4227. if(Job[Attacker] == innocent) Format(HitLog[Client], 4096, "%s�[I]%N : T-Virus", HitLog[Client], Attacker);
  4228.  
  4229. if(Job[Client] == traitor) Format(AttackLog[Attacker], 4096, "%s�[T]%N : T-Virus", AttackLog[Attacker], Client);
  4230. if(Job[Client] == detector) Format(AttackLog[Attacker], 4096, "%s�[D]%N : T-Virus", AttackLog[Attacker], Client);
  4231. if(Job[Client] == innocent) Format(AttackLog[Attacker], 4096, "%s�[I]%N : T-Virus", AttackLog[Attacker], Client);
  4232. return;
  4233. }
  4234. new bool:flamelog;
  4235. if(StrEqual(WeaponName, "entityflame", false))
  4236. {
  4237. new String:Formatting[4096], count, String:Name[256];
  4238. GetClientName(Client, Name, 256);
  4239. Formatting = HitLog[Client];
  4240. while(StrContains(Formatting, "�") != -1)
  4241. {
  4242. ReplaceStringEx(Formatting, 4096, "�", "");
  4243. count++;
  4244. }
  4245. Formatting = HitLog[Client];
  4246. new String:EString[count+1][64];
  4247. ExplodeString(Formatting, "�", EString, count+1, 64);
  4248. if(StrContains(EString[count][3], Name) == 0)
  4249. {
  4250. if(strlen(HitLog[Client])-12>0)
  4251. {
  4252. if(StrContains(HitLog[Client][strlen(HitLog[Client])-12], "entityflame") == 0)
  4253. {
  4254. new String:CheckString[16], String:LastDamage[3];
  4255. CheckString[0] = HitLog[Client][strlen(HitLog[Client])-15];
  4256. if(StringToInt(CheckString) > 0)
  4257. {
  4258. LastDamage[0] = HitLog[Client][strlen(HitLog[Client])-15];
  4259. Format(HitLog[Client][strlen(HitLog[Client])-15], 16, "%i(entityflame)", StringToInt(LastDamage) + damage);
  4260. }
  4261. else
  4262. {
  4263. LastDamage[0] = HitLog[Client][strlen(HitLog[Client])-14];
  4264. if(StringToInt(LastDamage) >= 9)
  4265. {
  4266. Format(HitLog[Client][strlen(HitLog[Client])-15], 16, "%i(entityflame)", StringToInt(LastDamage) + damage);
  4267. }
  4268. else
  4269. {
  4270. Format(HitLog[Client][strlen(HitLog[Client])-14], 16, "%i(entityflame)", StringToInt(LastDamage) + damage);
  4271. }
  4272. }
  4273. flamelog = true;
  4274. }
  4275. }
  4276. }
  4277. Formatting = AttackLog[Attacker];
  4278. count = 0;
  4279. while(StrContains(Formatting, "�") != -1)
  4280. {
  4281. ReplaceStringEx(Formatting, 4096, "�", "");
  4282. count++;
  4283. }
  4284. Formatting = AttackLog[Attacker];
  4285. new String:EString2[count+1][64];
  4286. ExplodeString(Formatting, "�", EString2, count+1, 64);
  4287. if(StrContains(EString2[count][3], Name) == 0)
  4288. {
  4289. if(strlen(AttackLog[Attacker])-12>0)
  4290. {
  4291. if(StrContains(AttackLog[Attacker][strlen(AttackLog[Attacker])-12], "entityflame") == 0)
  4292. {
  4293. new String:CheckString[16], String:LastDamage[2];
  4294. CheckString[0] = AttackLog[Attacker][strlen(AttackLog[Attacker])-15];
  4295. if(StringToInt(CheckString) > 0)
  4296. {
  4297. LastDamage[0] = AttackLog[Attacker][strlen(AttackLog[Attacker])-15];
  4298. LastDamage[1] = AttackLog[Attacker][strlen(AttackLog[Attacker])-14];
  4299. Format(AttackLog[Attacker][strlen(AttackLog[Attacker])-15], 17, "%i(entityflame)", StringToInt(LastDamage) + damage);
  4300. }
  4301. else
  4302. {
  4303. LastDamage[0] = AttackLog[Attacker][strlen(AttackLog[Attacker])-14];
  4304. if(StringToInt(LastDamage) >= 9)
  4305. {
  4306. Format(AttackLog[Attacker][strlen(AttackLog[Attacker])-15], 16, "%i(entityflame)", StringToInt(LastDamage) + damage);
  4307. }
  4308. else
  4309. {
  4310. Format(AttackLog[Attacker][strlen(AttackLog[Attacker])-14], 16, "%i(entityflame)", StringToInt(LastDamage) + damage);
  4311. }
  4312. }
  4313. flamelog = true;
  4314. }
  4315. }
  4316. }
  4317. if(flamelog) return;
  4318. }
  4319. if(Job[Attacker] == traitor) Format(HitLog[Client], 4096, "%s�[T]%N : %i", HitLog[Client], Attacker, damage);
  4320. if(Job[Attacker] == detector) Format(HitLog[Client], 4096, "%s�[D]%N : %i", HitLog[Client], Attacker, damage);
  4321. if(Job[Attacker] == innocent) Format(HitLog[Client], 4096, "%s�[I]%N : %i", HitLog[Client], Attacker, damage);
  4322.  
  4323. if(Job[Client] == traitor) Format(AttackLog[Attacker], 4096, "%s�[T]%N : %i", AttackLog[Attacker], Client, damage);
  4324. if(Job[Client] == detector) Format(AttackLog[Attacker], 4096, "%s�[D]%N : %i", AttackLog[Attacker], Client, damage);
  4325. if(Job[Client] == innocent) Format(AttackLog[Attacker], 4096, "%s�[I]%N : %i", AttackLog[Attacker], Client, damage);
  4326. }
  4327. else if(Attacker != Client)
  4328. {
  4329. new String:EdictName[256];
  4330. GetEdictClassname(Attacker, EdictName, 256);
  4331. Format(HitLog[Client], 4096, "%s�%s : %i", HitLog[Client], EdictName, damage);
  4332. }
  4333. }
  4334.  
  4335. public Action:EventBullet(Handle:Event, const String:Name[], bool:Broadcast)
  4336. {
  4337. new Client = GetClientOfUserId(GetEventInt(Event, "userid"));
  4338. new weapons = GetEntPropEnt(Client, Prop_Data, "m_hActiveWeapon");
  4339. new String:classname[256], Float:targetposition[3], Float:clientposition[3], Float:clienteyeangle[3], Float:FWD[3], Float:RIGHT[3];
  4340. if(IsValidEdict(weapons) && weapons > 0) GetEdictClassname(weapons, classname, 256);
  4341. if(StrEqual(classname, "weapon_ump45", false))
  4342. {
  4343. GetClientAbsOrigin(Client, clientposition);
  4344. GetClientEyeAngles(Client, clienteyeangle);
  4345. clientposition[2] += 60.0;
  4346. GetAngleVectors(clienteyeangle, FWD, RIGHT, NULL_VECTOR);
  4347. NormalizeVector(FWD, FWD);
  4348. ScaleVector(FWD, 32.0);
  4349. AddVectors(clientposition, FWD, clientposition);
  4350. NormalizeVector(RIGHT, RIGHT);
  4351. ScaleVector(RIGHT, 6.0);
  4352. AddVectors(clientposition, RIGHT, clientposition);
  4353. targetposition[0] = GetEventFloat(Event, "x");
  4354. targetposition[1] = GetEventFloat(Event, "y");
  4355. targetposition[2] = GetEventFloat(Event, "z");
  4356. TE_SetupBeamPoints(clientposition, targetposition, PrecacheModel("sprites/physbeam.vmt"), 0, 0, 0, 0.5, 1.0, 1.0, 0, 10.0, {255, 255, 255, 255}, 0);
  4357. TE_SendToAll();
  4358. }
  4359.  
  4360. return Plugin_Handled;
  4361. }
  4362.  
  4363. public Action:roundfreezeend_event(Handle:Event, const String:Name[], bool:Broadcast)
  4364. {
  4365. for(new i = 1;i <= MaxClients; i++)
  4366. {
  4367. if(JoinCheck(i) && IsPlayerAlive(i))
  4368. {
  4369. if(ItemOn[i][SkinType] && ItemID[i][SkinType])
  4370. {
  4371. SetEntityModel(i, ItemPath[ItemID[i][SkinType]]);
  4372. }
  4373. }
  4374. }
  4375. }
  4376.  
  4377.  
  4378. public EventFire( Handle:Spawn_Event, const String:Death_Name[], bool:Death_Broadcast )
  4379. {
  4380. new Attacker = GetClientOfUserId(GetEventInt(Spawn_Event, "userid"));
  4381. new weapons = GetEntPropEnt(Attacker, Prop_Data, "m_hActiveWeapon");
  4382. new Float:vecPunch[3], String:classname[32];
  4383. GetEntDataVector(Attacker, offsPunchAngle, vecPunch);
  4384. GetEdictClassname(weapons, classname, 32);
  4385. if(vecPunch[0] < 4.0 && vecPunch[1] < 4.0 && vecPunch[0] > -4.0 && vecPunch[1] > -4.0)
  4386. {
  4387. vecPunch[0] *= 2.0;
  4388. vecPunch[1] *= 2.0;
  4389. }
  4390. //if(StrEqual(classname, "weapon_awp", false) && Silenced_Sniper_Rifle[weapons]) EmitSoundToAll("weapons/m4a1/m4a1-1.wav", weapons, SNDCHAN_WEAPON);
  4391. if(StrEqual(classname, "weapon_p228", false)) EmitSoundToAll("weapons/flaregun/fire.wav", weapons, SNDCHAN_WEAPON);
  4392. SetEntDataVector(Attacker, offsPunchAngle, vecPunch);
  4393. }
  4394.  
  4395. public Action:EventDeath(Handle:Spawn_Event, const String:Spawn_Name[], bool:Spawn_Broadcast)
  4396. {
  4397. new Client = GetClientOfUserId(GetEventInt(Spawn_Event, "userid"));
  4398. new entity = GetEntPropEnt(Client, Prop_Send, "m_hRagdoll");
  4399. AcceptEntityInput(entity, "kill");
  4400. if(!ChosenJoin[Client])
  4401. {
  4402. ClientCommand(Client, "r_screenoverlay \"\"");
  4403. new Attacker = GetClientOfUserId(GetEventInt(Spawn_Event, "attacker")), String:ModelName[256], Float:attackerposition[3];
  4404. GetEventString(Spawn_Event, "weapon", Weapon[Client], 256);
  4405. if(JoinCheck(Attacker))
  4406. {
  4407. new weapon = GetEntPropEnt(Attacker, Prop_Data, "m_hActiveWeapon");
  4408. if(StrEqual(Weapon[Client], "awp", false) && weapon > 0 && Silenced_Sniper_Rifle[weapon]) Format(Weapon[Client], 256, "SSR");
  4409. }
  4410. GetClientModel(Client, ModelName, 256);
  4411. if(!IsModelPrecached(ModelName))
  4412. {
  4413. PrecacheModel(ModelName, true);
  4414. }
  4415. if(Attacker) GetClientEyePosition(Attacker, attackerposition);
  4416. if(Client != Attacker && Attacker) PrintChat(Client, "\x05[%T] \x04%N\x01%T", JobName[Job[Attacker]], Client, Attacker, "Kill message", Client, Weapon[Client]);
  4417. if(Job[Client] != traitor) Time2 += 20;
  4418. if(Job[Attacker] == traitor && Job[Client] != traitor)
  4419. {
  4420. if(Job[Client] == detector)
  4421. {
  4422. for(new i = 1; i <= MaxClients; i++)
  4423. {
  4424. if(IsClientInGame(i))
  4425. {
  4426. if(Job[i] == traitor && IsPlayerAlive(i))
  4427. {
  4428. Credit[i] += 1;
  4429. PrintChat(i, "\x0787CEEB%T", "received credit for killing", i, JobName[Job[i]], i);
  4430. }
  4431. }
  4432. }
  4433. }
  4434. if(roundstart)
  4435. {
  4436. Format(TraitorKillList[Attacker], 256, "%s\n%N", TraitorKillList[Attacker], Client);
  4437. }
  4438. }
  4439. else if(Attacker && Job[Attacker] != traitor && Job[Client] == traitor)
  4440. {
  4441. if(chosen)
  4442. {
  4443. Karma[Attacker] += Karma_KillTraitor;
  4444. if(Karma[Attacker] > Karma_Max)
  4445. Karma[Attacker] = Karma_Max;
  4446. SaveKarma(Attacker);
  4447. for(new i = 1; i <= MaxClients; i++)
  4448. {
  4449. if(IsClientInGame(i))
  4450. {
  4451. if(Job[i] == detector && IsPlayerAlive(i))
  4452. {
  4453. Credit[i] += 1;
  4454. PrintChat(i, "\x0787CEEB%T", "received credit for killing", i, JobName[Job[i]], i);
  4455. }
  4456. }
  4457. }
  4458. }
  4459. }
  4460. else if(Attacker && Job[Attacker] != traitor && Job[Client] != traitor && Client != Attacker)
  4461. {
  4462. if(chosen && !IsFakeClient(Attacker))
  4463. {
  4464. Karma[Attacker] -= Karma_TeamKill;
  4465. SaveKarma(Attacker);
  4466. if(!Karma[Attacker])
  4467. BanClient(Attacker, 0, BANFLAG_AUTHID, "Karma Ban [ Duration : never ]", "You have been banned from this server\n[ Reason : Karma Ban, Duration : never ]");
  4468. else if(Karma[Attacker] <= 100)
  4469. BanClient(Attacker, 43200, BANFLAG_AUTHID, "Karma Ban [ Duration : 43200mins ]", "You have been banned from this server\n[ Reason : Karma Ban, Duration : 43200mins ]");
  4470. else if(Karma[Attacker] <= 200)
  4471. BanClient(Attacker, 10080, BANFLAG_AUTHID, "Karma Ban [ Duration : 10080mins ]", "You have been banned from this server\n[ Reason : Karma Ban, Duration : 10080mins ]");
  4472. else if(Karma[Attacker] <= 300)
  4473. BanClient(Attacker, 1440, BANFLAG_AUTHID, "Karma Ban [ Duration : 1440mins ]", "You have been banned from this server\n[ Reason : Karma Ban, Duration : 1440mins ]");
  4474. else if(Karma[Attacker] <= 400)
  4475. BanClient(Attacker, 60, BANFLAG_AUTHID, "Karma Ban [ Duration : 60mins ]", "You have been banned from this server\n[ Reason : Karma Ban, Duration : 60mins ]");
  4476. }
  4477. }
  4478. new String:SoundFormat[256];
  4479. do
  4480. {
  4481. Format(SoundFormat, 256, "tttmusic/die%i.wav", GetRandomInt(1, 16));
  4482. } while(StrEqual("tttmusic/die11.wav", SoundFormat, false) || StrEqual("tttmusic/die9.wav", SoundFormat, false));
  4483. if(!StrEqual(Weapon[Client], "knife", false) || !Dagger[Attacker]) EmitSoundToAll(SoundFormat, Client);
  4484. IsHeadShot[Client] = GetEventBool(Spawn_Event, "headshot");
  4485. //살아있는직업수
  4486. AliveJobCount[Job[Client]] -= 1;
  4487. //스프라이트제거
  4488. if(Sprites[Client] != 0 && IsValidEdict(Sprites[Client])) AcceptEntityInput(Sprites[Client], "Kill");
  4489. if(DNASprites[Client] != 0 && IsValidEdict(DNASprites[Client]))
  4490. {
  4491. AcceptEntityInput(DNASprites[Client], "Kill");
  4492. if(IsValidEdict(info_target[DNASprites[Client]])) AcceptEntityInput(info_target[DNASprites[Client]], "Kill");
  4493. }
  4494. if(JihadSpark[Client] != 0 && IsValidEdict(JihadSpark[Client])) AcceptEntityInput(JihadSpark[Client], "Kill");
  4495. //리스폰시켜주자
  4496. if(roundstart && !chosen) CreateTimer(0.5, RespawnPlayer, Client);
  4497. if((roundstart && chosen) || !roundstart)
  4498. {
  4499. new Float:Pos[3], Float:Angle[3];
  4500. GetClientAbsOrigin(Client, Pos);
  4501. GetClientEyeAngles(Client, Angle);
  4502. new String:TargetName[256];
  4503. Format(TargetName, 256, "%N", Client);
  4504. //임시 데이터를 전달하기위한 래그돌
  4505. new ragdoll = CreateEntityByName("prop_ragdoll");
  4506. DispatchKeyValue(ragdoll, "targetname", TargetName);
  4507. DispatchKeyValue(ragdoll, "model", ModelName);
  4508. DispatchSpawn(ragdoll);
  4509. SetEntPropEnt(Client, Prop_Send, "m_hRagdoll", ragdoll);
  4510. SetEntProp(ragdoll, Prop_Send, "m_nSolidType", 6);
  4511. SetEntProp(ragdoll, Prop_Send, "m_CollisionGroup", 2);
  4512. SetEntityModel(ragdoll, ModelName);
  4513. TeleportEntity(ragdoll, Pos, Angle, NULL_VECTOR);
  4514. SetEntPropVector(ragdoll, Prop_Send, "m_vecOrigin", Pos);
  4515.  
  4516. //이것은 래그돌이다.
  4517. IsRagdoll[ragdoll] = true;
  4518. //이제 래그돌의 정보를 적어주자.
  4519. Format(TargetDescription[ragdoll][0], 256, "%s", JobName[Job[Client]]);
  4520. Format(TargetDescription[ragdoll][1], 256, "%f", GetEngineTime());
  4521. if(IsHeadShot[Client])
  4522. {
  4523. //헤드샷정보는 마지막에두자.
  4524. Format(TargetDescription[ragdoll][4], 256, "The fatal wound was a headshot. No time to scream");
  4525. TargetDescription_bool[ragdoll][4] = true;
  4526. }
  4527. else TargetDescription_bool[ragdoll][4] = false;
  4528. if(!Attacker || StrEqual(Weapon[Client], "worldspawn", false))
  4529. {
  4530. Format(TargetDescription[ragdoll][2], 256, "He fell to his death");
  4531. TargetDescription_bool[ragdoll][3] = false;
  4532. TargetDescription_bool[ragdoll][4] = false;
  4533. }
  4534. else if(StrEqual(Weapon[Client], "knife", false))
  4535. {
  4536. Format(TargetDescription[ragdoll][2], 256, "The body is bruised and battered. Clearly he was clubbed to death");
  4537. TargetDescription_bool[ragdoll][3] = false;
  4538. TargetDescription_bool[ragdoll][4] = false;
  4539. }
  4540. else if(StrEqual(Weapon[Client], "RPG-7", false) || StrEqual(Weapon[Client], "the_jihad", false) || StrEqual(Weapon[Client], "fake_healthbox", false))
  4541. {
  4542. Format(TargetDescription[ragdoll][2], 256, "Smells like roasted terrorist around here");
  4543. TargetDescription_bool[ragdoll][3] = false;
  4544. TargetDescription_bool[ragdoll][4] = false;
  4545. SetVariantString("40 30 10");
  4546. AcceptEntityInput(ragdoll, "Color");
  4547. }
  4548. else if(Client == Attacker)
  4549. {
  4550. Format(TargetDescription[ragdoll][2], 256, "You cannot find a specific cause of this terrorist's death");
  4551. TargetDescription_bool[ragdoll][3] = false;
  4552. TargetDescription_bool[ragdoll][4] = false;
  4553. }
  4554. else
  4555. {
  4556. Format(TargetDescription[ragdoll][2], 256, "It is obvious he was shot to death");
  4557. Format(TargetDescription[ragdoll][3], 256, "It appears a weapon was used to kill him:%s", Weapon[Client]);
  4558. TargetDescription_bool[ragdoll][3] = true;
  4559. }
  4560. if(Job[Client] == traitor)
  4561. {
  4562. if(StrEqual(TraitorKillList[Client], ""))
  4563. {
  4564. TargetDescription_bool[ragdoll][5] = false;
  4565. }
  4566. else
  4567. {
  4568. Format(TargetDescription[ragdoll][5], 256, "You found a list of kills with these names�%s", TraitorKillList[Client]);
  4569. TargetDescription_bool[ragdoll][5] = true;
  4570. }
  4571. }
  4572. else TargetDescription_bool[ragdoll][5] = false;
  4573. if(StrEqual(Weapon[Client], "knife", false))
  4574. {
  4575. if(Dagger[Attacker])
  4576. {
  4577. Dagger[Attacker] = false;
  4578. new weapons = GetPlayerWeaponSlot(Attacker, 2);
  4579. if(IsValidEdict(weapons))
  4580. {
  4581. RemovePlayerItem(Attacker, weapons);
  4582. RemoveEdict(weapons);
  4583. }
  4584. GivePlayerItem(Attacker, "weapon_knife");
  4585. }
  4586. }
  4587. //이것은 아직 체크안된 시체이다를 표시하자.
  4588. CheckedBody[ragdoll] = false;
  4589. //크레딧도 건네주자
  4590. RemainCredit[ragdoll] = Credit[Client];
  4591. Credit[Client] = 0;
  4592. //DNA정보쯤이야
  4593. if(Attacker && Client != Attacker && Job[Client] != traitor && !(StrEqual(Weapon[Client], "RPG-7", false) || StrEqual(Weapon[Client], "the_jihad", false) || StrEqual(Weapon[Client], "fake_healthbox", false) || StrEqual(Weapon[Client], "worldspawn", false)) && GetVectorDistance(attackerposition, Pos, false) < 1000.0) Format(DNAInformation[ragdoll], 256, "%i", Attacker);
  4594. Ragdoll[Client] = ragdoll;
  4595. SDKHook(ragdoll, SDKHook_OnTakeDamage, RagdollTakeDamageHook);
  4596. }
  4597. new EntEffects = GetEntProp(ClientVM[Client][1], Prop_Send, "m_fEffects");
  4598. EntEffects |= EF_NODRAW;
  4599. SetEntProp(ClientVM[Client][1], Prop_Send, "m_fEffects", EntEffects);
  4600.  
  4601. new String:Formatting[4096], count, bool:check;
  4602. Formatting = HitLog[Client];
  4603. while(StrContains(Formatting, "�") != -1)
  4604. {
  4605. ReplaceStringEx(Formatting, 4096, "�", "");
  4606. count++;
  4607. check = true;
  4608. }
  4609. if(check)
  4610. {
  4611. Formatting = HitLog[Client];
  4612. new String:Formatting2[count+1][64];
  4613. ExplodeString(Formatting, "�", Formatting2, count+1, 64);
  4614. new Handle:menuhandle = CreateMenu(NULL_CallBack);
  4615. SetMenuTitle(menuhandle, "-----데미지로그-----");
  4616. for(new i=1; i<=count; i++)
  4617. {
  4618. AddMenuItem(menuhandle, "", Formatting2[i], ITEMDRAW_DISABLED);
  4619. }
  4620. SetMenuExitButton(menuhandle, true);
  4621. DisplayMenu(menuhandle, Client, 10);
  4622. }
  4623. new weapons = GetPlayerWeaponSlot(Client, 4);
  4624. if(IsValidEdict(weapons))
  4625. {
  4626. RemovePlayerItem(Client, weapons);
  4627. RemoveEdict(weapons);
  4628. }
  4629. }
  4630. if(ChosenJoin[Client]) ChosenJoin[Client] = false;
  4631. return Plugin_Handled;
  4632. }
  4633.  
  4634. public Action:RespawnPlayer(Handle:timer, any:Client)
  4635. {
  4636. if(IsClientInGame(Client) && !IsPlayerAlive(Client) && GetClientTeam(Client) > 1 && !chosen) CS_RespawnPlayer(Client);
  4637. }
  4638.  
  4639. public OnChangeName(Handle:event, const String:name[], bool:dontbroadcast)
  4640. {
  4641. new Client = GetClientOfUserId(GetEventInt(event, "userid")), String:OldName[256], String:NewName[256];
  4642. GetEventString(event, "oldname", OldName, 256);
  4643. GetEventString(event, "newname", NewName, 256);
  4644. if(IsPlayerAlive(Client)) KickClient(Client, "%T", "Dont change nickname", Client);
  4645. else PrintChat(Client, "\x03You changed your nickname.\x07C5C5C5%s \x01-> \x07C5C5C5%s", OldName, NewName);
  4646. CreateTimer(0.1, ChangedName, Client);
  4647. }
  4648.  
  4649. public Action:ChangedName(Handle:timer, any:Client)
  4650. {
  4651. if(JoinCheck(Client)) ChangeNickname(Client);
  4652. }
  4653.  
  4654. public RoundStart(Handle:event, const String:Name[], bool:Broadcast)
  4655. {
  4656. roundstart = true;
  4657. ReceiveCredit = false;
  4658. if(FirstRound)
  4659. {
  4660. FirstRound = false;
  4661. GameCount = 350;
  4662. }
  4663. else GameCount = 200;
  4664. Time1 = GameCount/10;
  4665. Time2 = 180+(GameCount/10);
  4666. CreateTimer(0.1, GameStart, _, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
  4667. new String:CurrentMap[256];
  4668. GetCurrentMap(CurrentMap, 256);
  4669. MaxDiaCount = 1;
  4670. DiaCount = 0;
  4671. for(new i=MaxClients+1; i < GetMaxEntities(); i++)
  4672. {
  4673. if(IsValidEdict(i))
  4674. {
  4675. decl String:classname[256];
  4676. GetEdictClassname(i, classname, 256);
  4677. new iOwnerEntity = FindSendPropOffs("CBaseCombatWeapon", "m_hOwnerEntity");
  4678. if(StrContains(classname, "weapon_", false) != -1 && GetEntDataEnt2(i, iOwnerEntity) == -1)
  4679. {
  4680. RemoveEdict(i);
  4681. }
  4682. if(StrContains(classname, "rope", false) != -1)
  4683. {
  4684. if(IsRope[i]) RemoveEdict(i);
  4685. }
  4686. if(StrEqual(classname, "hostage_entity", false) || StrEqual(classname, "func_hostage_rescue", false))
  4687. {
  4688. RemoveEdict(i);
  4689. }
  4690. if(IsValidEntity(i) && (!StrContains(classname, "prop_physics", false) || !StrContains(classname, "prop_dynamic", false)))
  4691. {
  4692. SetEntData(i, CollOff, 0, 4, true);
  4693. SetEntPropFloat(i, Prop_Data, "m_explodeDamage", 0.0);
  4694. SetEntPropFloat(i, Prop_Data, "m_explodeRadius", 0.0);
  4695. }
  4696. if(StrEqual(CurrentMap, "ttt_minecraft_b4", false))
  4697. {
  4698. if(IsValidEntity(i))
  4699. {
  4700. new String:iName[256], String:Classname[32];
  4701. GetEntPropString(i, Prop_Data, "m_iName", iName, 256);
  4702. GetEdictClassname(i, Classname, 32);
  4703. if(StrContains(iName, "Door", false) != -1 || StrContains(iName, "_Clip", false) != -1)
  4704. {
  4705. if(StrContains(iName, "Ttest_", false) && StrContains(iName, "T1_Door", false)) SetEntData(i, CollOff, 2, 4, true);
  4706. }
  4707. if(StrEqual(iName, "Trap_water", false))
  4708. {
  4709. AcceptEntityInput(i, "Kill");
  4710. }
  4711. if(StrEqual(iName, "Trap_lava", false))
  4712. {
  4713. AcceptEntityInput(i, "Enable");
  4714. }
  4715. if(StrEqual(iName, "Trap_Lava_Hurt", false))
  4716. {
  4717. AcceptEntityInput(i, "Enable");
  4718. }
  4719. if(!StrContains(iName, "DiaOre_"))
  4720. {
  4721. MaxDiaCount++;
  4722. SetEntityRenderMode(i, RENDER_TRANSCOLOR);
  4723. SetEntityRenderColor(i, 255, 255, 255, 0);
  4724. }
  4725. if(StrEqual(Classname, "trigger_once"))
  4726. {
  4727. new Float:pos[3];
  4728. GetEntPropVector(i, Prop_Send, "m_vecOrigin", pos);
  4729. if(RoundToNearest(pos[0]) == -1808 && RoundToNearest(pos[1]) == 592 && RoundToNearest(pos[2]) == 738)
  4730. {
  4731. new Float:mins[3], Float:maxs[3];
  4732. GetEntPropVector(i, Prop_Send, "m_vecMins", mins);
  4733. GetEntPropVector(i, Prop_Send, "m_vecMaxs", maxs);
  4734. AcceptEntityInput(i, "Kill");
  4735.  
  4736. new entity = CreateEntityByName("trigger_multiple");
  4737. DispatchKeyValue(entity, "spawnflags", "1036");
  4738. DispatchKeyValue(entity, "targetname", "");
  4739. DispatchKeyValue(entity, "filtername", "Diablock_Filter");
  4740. DispatchSpawn(entity);
  4741. ActivateEntity(entity);
  4742. TeleportEntity(entity, pos, NULL_VECTOR, NULL_VECTOR);
  4743.  
  4744. PrecacheModel("models/props/cs_office/vending_machine.mdl", true);
  4745. SetEntityModel(entity, "models/props/cs_office/vending_machine.mdl");
  4746.  
  4747. SetEntPropVector(entity, Prop_Send, "m_vecMins", mins);
  4748. SetEntPropVector(entity, Prop_Send, "m_vecMaxs", maxs);
  4749.  
  4750. //노블럭
  4751. SetEntProp(entity, Prop_Send, "m_nSolidType", 2);
  4752.  
  4753. SetVariantString("OnStartTouch !activator:DisableMotion::0:-1");
  4754. AcceptEntityInput(entity, "AddOutput");
  4755. SetVariantString("OnStartTouch Furnace_Teleport:Teleport::0:-1");
  4756. AcceptEntityInput(entity, "AddOutput");
  4757. SetVariantString("OnStartTouch !activator:Kill::2.0:-1");
  4758. AcceptEntityInput(entity, "AddOutput");
  4759. }
  4760. }
  4761. }
  4762. }
  4763. if(StrEqual(CurrentMap, "zm_roy_the_ship_64", false))
  4764. {
  4765. if(IsValidEntity(i))
  4766. {
  4767. new String:Classname[32];
  4768. GetEdictClassname(i, Classname, 32);
  4769. if(StrEqual(Classname, "func_breakable"))
  4770. {
  4771. new Float:pos[3];
  4772. GetEntPropVector(i, Prop_Send, "m_vecOrigin", pos);
  4773. if(RoundToNearest(pos[0]) == -2276 && (RoundToNearest(pos[1]) == -450 || RoundToNearest(pos[1]) == -478) && RoundToNearest(pos[2]) == 264)
  4774. {
  4775. SetVariantInt(999999);
  4776. AcceptEntityInput(i, "SetHealth");
  4777. }
  4778. }
  4779. }
  4780. }
  4781. if(StrEqual(CurrentMap, "de_dolls_blue", false))
  4782. {
  4783. if(IsValidEntity(i))
  4784. {
  4785. new String:iName[256];
  4786. GetEntPropString(i, Prop_Data, "m_iName", iName, 256);
  4787. if(StrEqual(iName, "frame", false) || StrEqual(iName, "frame1", false) || StrEqual(iName, "prop", false) || StrEqual(iName, "prop1", false) || StrEqual(iName, "fanpush", false)) RemoveEdict(i);
  4788. if(StrEqual(classname, "prop_ragdoll", false)) RemoveEdict(i);
  4789. }
  4790. }
  4791. if(StrEqual(classname, "func_useableladder"))
  4792. {
  4793. new Float:Position[3], Float:Position_Start[3], Float:Position_End[3], Float:Angle[3], Float:Mins[3], Float:Maxs[3];
  4794. GetEntPropVector(i, Prop_Send, "m_vecOrigin", Position);
  4795. GetEntPropVector(i, Prop_Send, "m_vecPlayerMountPositionBottom", Position_Start);
  4796. GetEntPropVector(i, Prop_Send, "m_vecPlayerMountPositionTop", Position_End);
  4797. Position[2] += Mins[2];
  4798. Maxs[2] -= Mins[2];
  4799. Mins[2] = 0.0;
  4800. Mins[2] += Position_Start[2];
  4801. Maxs[2] += Position_End[2]-10.0;
  4802. GetEntPropVector(i, Prop_Send, "m_vecLadderDir", Angle);
  4803. new entity = CreateEntityByName("trigger_multiple");
  4804. DispatchKeyValue(entity, "spawnflags", "1");
  4805. DispatchKeyValue(entity, "targetname", "ladder");
  4806. DispatchSpawn(entity);
  4807. ActivateEntity(entity);
  4808. TeleportEntity(entity, Position, Angle, NULL_VECTOR);
  4809.  
  4810. //PrecacheModel("models/props/cs_office/vending_machine.mdl", true);
  4811. //SetEntityModel(entity, "models/props/cs_office/vending_machine.mdl");
  4812. SetEntityModel(entity, "models/props/cs_italy/orange.mdl");
  4813.  
  4814. SetEntPropVector(entity, Prop_Send, "m_vecMins", Mins);
  4815. SetEntPropVector(entity, Prop_Send, "m_vecMaxs", Maxs);
  4816.  
  4817. //노블럭
  4818. SetEntProp(entity, Prop_Send, "m_nSolidType", 2);
  4819. }
  4820. }
  4821. }
  4822. if(StrEqual(CurrentMap, "ttt_minecraft_b4", false)) PrintChatAll("\x04[Furnace]\x07FFFFFFYou have placed %i In the furnace You need %i more.", DiaCount, MaxDiaCount-DiaCount);
  4823. new Handle:kv = CreateKeyValues("TTTWeapons"), Float:spawnposition[3], String:weaponname[256], String:buffer[256];
  4824. FileToKeyValues(kv, Path);
  4825. KvGotoFirstSubKey(kv);
  4826. do
  4827. {
  4828. KvGetSectionName(kv, buffer, sizeof(buffer));
  4829. if(StrEqual(buffer, CurrentMap, false))
  4830. {
  4831. KvJumpToKey(kv, CurrentMap, false);
  4832. KvGotoFirstSubKey(kv);
  4833. do
  4834. {
  4835. KvGetSectionName(kv, buffer, sizeof(buffer));
  4836. KvGetVector(kv, "weapon", spawnposition);
  4837. KvGetString(kv, "weapon2", weaponname, 256, "NULL");
  4838. if(!StrEqual(weaponname, "NULL", false))
  4839. {
  4840. new entity = CreateEntityByName(weaponname);
  4841. if(entity != -1)
  4842. {
  4843. if(StrContains(weaponname, "light", false) == 0)
  4844. {
  4845. DispatchKeyValue(entity, "_light", "255 255 255");
  4846. DispatchKeyValue(entity, "brightness", "3");
  4847. DispatchKeyValue(entity, "spotlight_radius", "1000");
  4848. DispatchKeyValue(entity, "pitch", "-90");
  4849. DispatchKeyValue(entity, "distance", "300");
  4850. }
  4851. DispatchSpawn(entity);
  4852. if(StrContains(weaponname, "light", false) == 0)
  4853. {
  4854. AcceptEntityInput(entity, "TurnOn");
  4855. }
  4856. TeleportEntity(entity, spawnposition, NULL_VECTOR, NULL_VECTOR);
  4857. }
  4858. }
  4859. }
  4860. while(KvGotoNextKey(kv));
  4861. }
  4862. }while(KvGotoNextKey(kv));
  4863. KvRewind(kv);
  4864. CloseHandle(kv);
  4865. Ladder_Spawn();
  4866. for(new i=1; i<=MaxClients; i++)
  4867. {
  4868. FunCommand[i] = 0;
  4869. if(TVirusTimer[i] != INVALID_HANDLE)
  4870. {
  4871. KillTimer(TVirusTimer[i]);
  4872. TVirusTimer[i] = INVALID_HANDLE;
  4873. }
  4874. if(Teleport[i] != INVALID_HANDLE)
  4875. {
  4876. KillTimer(Teleport[i]);
  4877. Teleport[i] = INVALID_HANDLE;
  4878. }
  4879. WillTimer[i] = INVALID_HANDLE;
  4880. DNAScanTimer[i] = INVALID_HANDLE;
  4881. }
  4882. }
  4883.  
  4884. public Ladder_Spawn()
  4885. {
  4886. new String:CurrentMap[256], String:buffer[256], String:classname[32], Float:spawnposition[3], Float:spawnposition2[3];
  4887. GetCurrentMap(CurrentMap, 256);
  4888. new Handle:kv = CreateKeyValues("TTTLadders");
  4889. FileToKeyValues(kv, Path3);
  4890. KvGotoFirstSubKey(kv);
  4891. do
  4892. {
  4893. KvGetSectionName(kv, buffer, sizeof(buffer));
  4894. if(StrEqual(buffer, CurrentMap, false))
  4895. {
  4896. KvJumpToKey(kv, CurrentMap, false);
  4897. KvGotoFirstSubKey(kv);
  4898. do
  4899. {
  4900. KvGetSectionName(kv, buffer, sizeof(buffer));
  4901. KvGetString(kv, "info", classname, 256, "NULL");
  4902. KvGetVector(kv, "position", spawnposition);
  4903. KvGetVector(kv, "position2", spawnposition2);
  4904. if(!StrEqual(classname, "NULL", false))
  4905. {
  4906. new Float:origin[3], Float:mins[3], Float:maxs[3];
  4907. origin[0] = (spawnposition[0]+spawnposition2[0])/2.0;
  4908. origin[1] = (spawnposition[1]+spawnposition2[1])/2.0;
  4909. origin[2] = (spawnposition[2]+spawnposition2[2])/2.0;
  4910. maxs[0] = FloatAbs(spawnposition[0]-spawnposition2[0])/2.0;
  4911. maxs[1] = FloatAbs(spawnposition[1]-spawnposition2[1])/2.0;
  4912. maxs[2] = FloatAbs(spawnposition[2]-spawnposition2[2])/2.0;
  4913. mins[0] = -maxs[0];
  4914. mins[1] = -maxs[1];
  4915. mins[2] = -maxs[2];
  4916.  
  4917. new entity = CreateEntityByName("trigger_multiple");
  4918. DispatchKeyValue(entity, "spawnflags", "1");
  4919. DispatchKeyValue(entity, "targetname", "ladder");
  4920. DispatchSpawn(entity);
  4921. ActivateEntity(entity);
  4922. TeleportEntity(entity, origin, NULL_VECTOR, NULL_VECTOR);
  4923.  
  4924. //PrecacheModel("models/props/cs_office/vending_machine.mdl", true);
  4925. //SetEntityModel(entity, "models/props/cs_office/vending_machine.mdl");
  4926. SetEntityModel(entity, "models/props/cs_italy/orange.mdl");
  4927.  
  4928. SetEntPropVector(entity, Prop_Send, "m_vecMins", mins);
  4929. SetEntPropVector(entity, Prop_Send, "m_vecMaxs", maxs);
  4930.  
  4931. //노블럭
  4932. SetEntProp(entity, Prop_Send, "m_nSolidType", 2);
  4933. }
  4934. }while(KvGotoNextKey(kv));
  4935. break;
  4936. }
  4937. }while(KvGotoNextKey(kv));
  4938. KvRewind(kv);
  4939. CloseHandle(kv);
  4940. }
  4941.  
  4942. public Action:GameStart(Handle:timer)
  4943. {
  4944. if(roundstart && !chosen)
  4945. {
  4946. for(new Client = 1; Client <= MaxClients; Client++)
  4947. {
  4948. if(JoinCheck(Client))
  4949. {
  4950. if(GetTeamClientCount(2) < 3)
  4951. {
  4952. PrintCenterText(Client, "%T %T", "job select", Client, RoundToCeil(float(GameCount)/10.0), "at least 3", Client);
  4953. }
  4954. else
  4955. {
  4956. PrintCenterText(Client, "%T", "job select", Client, RoundToCeil(float(GameCount)/10.0));
  4957. }
  4958. }
  4959. }
  4960. if(GameCount == 0)
  4961. {
  4962. new Traitor[8] = {-1, -1, ...}, Detector[4] = {-1, -1, ...};
  4963. if(GetTeamClientCount(2) < 3)
  4964. {
  4965. GameCount = 100;
  4966. Time1 += 10;
  4967. Time2 += 10;
  4968. }
  4969. else
  4970. {
  4971. chosen = true;
  4972. for(new i; i < 4; i++)
  4973. {
  4974. AliveJobCount[i] = 0;
  4975. }
  4976. if(GetTeamClientCount(2) >= 4)
  4977. {
  4978. for(new i; i < GetTeamClientCount(2)/4; i++)
  4979. {
  4980. if(i == 0) Traitor[i] = GetRandomPlayer(true);
  4981. if(i== 1) Traitor[i] = GetRandomPlayer(true, Traitor[i-1]);
  4982. if(i== 2) Traitor[i] = GetRandomPlayer(true, Traitor[i-2], Traitor[i-1]);
  4983. if(i== 3) Traitor[i] = GetRandomPlayer(true, Traitor[i-3], Traitor[i-2], Traitor[i-1]);
  4984. if(i== 4) Traitor[i] = GetRandomPlayer(true, Traitor[i-4], Traitor[i-3], Traitor[i-2], Traitor[i-1]);
  4985. if(i== 5) Traitor[i] = GetRandomPlayer(true, Traitor[i-5], Traitor[i-4], Traitor[i-3], Traitor[i-2], Traitor[i-1]);
  4986. if(i== 6) Traitor[i] = GetRandomPlayer(true, Traitor[i-6], Traitor[i-5], Traitor[i-4], Traitor[i-3], Traitor[i-2], Traitor[i-1]);
  4987. if(i== 7) Traitor[i] = GetRandomPlayer(true, Traitor[i-7], Traitor[i-6], Traitor[i-5], Traitor[i-4], Traitor[i-3], Traitor[i-2], Traitor[i-1]);
  4988. }
  4989. for(new i=8; i < (GetTeamClientCount(2)/8)+8; i++)
  4990. {
  4991. if(i== 8) Detector[i-8] = GetRandomPlayer(false, Traitor[i-8], Traitor[i-7], Traitor[i-6], Traitor[i-5], Traitor[i-4], Traitor[i-3], Traitor[i-2], Traitor[i-1]);
  4992. if(i== 9) Detector[i-8] = GetRandomPlayer(false, Traitor[i-9], Traitor[i-8], Traitor[i-7], Traitor[i-6], Traitor[i-5], Traitor[i-4], Traitor[i-3], Traitor[i-2], Detector[i-9]);
  4993. if(i== 10) Detector[i-8] = GetRandomPlayer(false, Traitor[i-10], Traitor[i-9], Traitor[i-8], Traitor[i-7], Traitor[i-6], Traitor[i-5], Traitor[i-4], Traitor[i-3], Detector[i-10], Detector[i-9]);
  4994. if(i== 11) Detector[i-8] = GetRandomPlayer(false, Traitor[i-11], Traitor[i-10], Traitor[i-9], Traitor[i-8], Traitor[i-7], Traitor[i-6], Traitor[i-5], Traitor[i-4], Detector[i-11], Detector[i-10], Detector[i-9]);
  4995. }
  4996. if(GetTeamClientCount(2) > 4 && GetTeamClientCount(2) < 8)
  4997. {
  4998. Detector[0] = GetRandomPlayer(false, Traitor[0]);
  4999. }
  5000. }
  5001. else
  5002. {
  5003. Traitor[0] = GetRandomPlayer(true);
  5004. }
  5005. for(new Client = 1; Client <= MaxClients; Client++)
  5006. {
  5007. if(IsClientInGame(Client))
  5008. {
  5009. ResetData_Player(Client);
  5010. if(!IsPlayerAlive(Client) && GetClientTeam(Client) > 1 && !IsFakeClient(Client))
  5011. {
  5012. CS_RespawnPlayer(Client);
  5013. }
  5014. if(IsPlayerAlive(Client))
  5015. {
  5016. if(Karma[Client] >= Karma_Effect)
  5017. CreateRotatingTrail(Client);
  5018. if(Karma[Client] >= 1000)
  5019. PrintToChat(Client, "\x078888FFYour Karma is %i, so you deal full damage this round!", Karma[Client]);
  5020. else
  5021. PrintToChat(Client, "\x07FF8888Your Karma is %i, so damage you deal is reduced by %i%%!", Karma[Client], Karma[Client]/10);
  5022. }
  5023. for(new i; i < 12; i++)
  5024. {
  5025. if(i < 8)
  5026. {
  5027. if(Traitor[i] == Client)
  5028. {
  5029. Job[Client] = traitor;
  5030. AliveJobCount[traitor] += 1;
  5031. PrintChat(Client, "\x07FFFFFFYou are \x07FF0000Traitor.");
  5032. Credit[Client] = 2;
  5033. new Float:Pos[3], Float:move[3];
  5034. GetClientAbsOrigin(Client, Pos);
  5035. move[2] += 20.0;
  5036. new sprite = CreateVMT(Client, Pos, "ttt/icon_traitor_fix_v2.vmt", 0.3);
  5037. Sprites[Client] = sprite;
  5038. SDKHook(sprite, SDKHook_SetTransmit, Hook_SetTransmit);
  5039. TeleportEntity(sprite, move, NULL_VECTOR, NULL_VECTOR);
  5040. if(VIP[Client]) Credit[Client] += 1;
  5041. }
  5042. }
  5043. else
  5044. {
  5045. if(Detector[i-8] == Client)
  5046. {
  5047. Job[Client] = detector;
  5048. AliveJobCount[detector] += 1;
  5049. PrintChat(Client, "\x07FFFFFFYou are \x070000FFDetective.");
  5050. Credit[Client] = 2;
  5051. new Float:Pos[3], Float:move[3];
  5052. GetClientAbsOrigin(Client, Pos);
  5053. move[0] += 4.0;
  5054. move[2] += 20.0;
  5055. new sprite = CreateVMT(Client, Pos, "ttt/icon_det.vmt", 0.2);
  5056. SDKHook(sprite, SDKHook_SetTransmit, Hook_SetTransmit3);
  5057. Sprites[Client] = sprite;
  5058. TeleportEntity(sprite, move, NULL_VECTOR, NULL_VECTOR);
  5059. if(VIP[Client]) Credit[Client] += 1;
  5060. SetEntProp(Client, Prop_Data, "m_ArmorValue", 9999);
  5061. IronShoes[Client] = true;
  5062. }
  5063. }
  5064. }
  5065. if((Job[Client] == 0 || Job[Client] == innocent) && GetClientTeam(Client) > 1)
  5066. {
  5067. Job[Client] = innocent;
  5068. AliveJobCount[innocent] += 1;
  5069. PrintChat(Client, "\x07FFFFFFYou are \x0700FF00innocent.");
  5070. }
  5071. }
  5072. }
  5073. Time1 = Time2;
  5074. /*
  5075. SoundNumber = GetRandomInt(0, MAX_MUSIC-1);
  5076. new String:Formatting[256];
  5077. Format(Formatting, 256, "tttmusic/%s", SoundData[SoundNumber][0]);
  5078. for(new i=1; i <= MaxClients; i++)
  5079. {
  5080. if(JoinCheck(i) && !BGM[i])
  5081. {
  5082. EmitSoundToClient(i, Formatting, i, _, _, _, float(Volume[i])/100);
  5083. }
  5084. }
  5085. SoundCount = StringToInt(SoundData[SoundNumber][1]);
  5086. CreateTimer(1.0, CheckSound, _, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
  5087. */
  5088. new String:CurrentMap[256];
  5089. GetCurrentMap(CurrentMap, 256);
  5090. if(StrEqual(CurrentMap, "ttt_minecraft_b4", false))
  5091. {
  5092. for(new i; i < GetMaxEntities(); i++)
  5093. {
  5094. if(IsValidEdict(i))
  5095. {
  5096. decl String:classname[256];
  5097. GetEdictClassname(i, classname, 256);
  5098. if(IsValidEntity(i))
  5099. {
  5100. new String:iName[256];
  5101. GetEntPropString(i, Prop_Data, "m_iName", iName, 256);
  5102. if(!StrContains(iName, "T1_Door", false)) SetEntData(i, CollOff, 2, 4, true);
  5103. if(StrEqual(classname, "trigger_multiple", false)) AcceptEntityInput(i, "Enable");
  5104. if(!StrContains(iName, "DiaOre_"))
  5105. {
  5106. SetEntityRenderMode(i, RENDER_TRANSCOLOR);
  5107. SetEntityRenderColor(i, 255, 255, 255, 255);
  5108. }
  5109. }
  5110. }
  5111. }
  5112. }
  5113. }
  5114. }
  5115. GameCount -= 1;
  5116. }
  5117. else return Plugin_Stop;
  5118. return Plugin_Continue;
  5119. }
  5120. /*
  5121. public Action:CheckSound(Handle:timer)
  5122. {
  5123. if(!chosen)
  5124. {
  5125. SoundCount = 0;
  5126. SoundNumber = 0;
  5127. return Plugin_Stop;
  5128. }
  5129. else
  5130. {
  5131. if(SoundCount > 0)
  5132. {
  5133. SoundCount -= 1;
  5134. }
  5135. else
  5136. {
  5137. new String:Formatting[256];
  5138. Format(Formatting, 256, "tttmusic/%s", SoundData[SoundNumber][0]);
  5139. for(new i=1; i <= MaxClients; i++)
  5140. {
  5141. if(JoinCheck(i) && !BGM[i])
  5142. {
  5143. EmitSoundToClient(i, Formatting, i, _, _, _, float(Volume[i])/100);
  5144. }
  5145. }
  5146. SoundCount = StringToInt(SoundData[SoundNumber][1]);
  5147. }
  5148. }
  5149. return Plugin_Continue;
  5150. }
  5151. */
  5152. public RoundEnd(Handle:Spawn_Event, const String:Spawn_Name[], bool:Spawn_Broadcast)
  5153. {
  5154. chosen = false;
  5155. roundstart = false;
  5156. for(new Client = 1; Client <= MaxClients; Client++)
  5157. {
  5158. if(IsClientInGame(Client))
  5159. {
  5160. release(Client);
  5161. /*
  5162. new String:Formatting[256];
  5163. Format(Formatting, 256, "tttmusic/%s", SoundData[SoundNumber][0]);
  5164. StopSound(Client, SNDCHAN_AUTO, Formatting);
  5165. if(!BGM[Client])
  5166. {
  5167. EmitSoundToClient(Client, "tttmusic/end.mp3", Client, _, _, _, float(Volume[Client])/100);
  5168. }
  5169. */
  5170. }
  5171. IsInfect[Client] = false;
  5172. g_bIsWeaponGrabber[Client] = false;
  5173. grabbedentref[Client] = INVALID_ENT_REFERENCE;
  5174. entityownersave[Client] = INVALID_ENT_REFERENCE;
  5175. }
  5176. for(new i = MaxClients+1; i<2048; i++)
  5177. {
  5178. DNASprites[i] = 0;
  5179. }
  5180. }
  5181.  
  5182. public Action:OnHostageBlocking(Handle:event, const String:name[], bool:dontBroadcast)
  5183. {
  5184. return Plugin_Handled;
  5185. }
  5186.  
  5187. public CheckDeadBody(Client, entity, far)
  5188. {
  5189. if(Job[Client] == detector && DNASprites[entity] && IsValidEdict(DNASprites[entity]))
  5190. {
  5191. AcceptEntityInput(DNASprites[entity], "Kill");
  5192. DNASprites[entity] = 0;
  5193. }
  5194. new String:Formatting[1024], String:Translate_Formatting[256], String:EString[2][128], String:TargetName[256], String:CorrectTime[256];
  5195. GetEntPropString(entity, Prop_Data, "m_iName", TargetName, 256);
  5196. FormatTime_Hud(Client, StringToFloat(TargetDescription[entity][1]), CorrectTime, 256);
  5197. new Handle:menuhandle = CreateMenu(CheckDeadBody_CallBack);
  5198. Format(Formatting, 1024, "-- TTT %T --", "Body Search Results", Client);
  5199. Format(Formatting, 1024, "%s\n%T", Formatting, "This is the body of person", Client, TargetName);
  5200. Format(Formatting, 1024, "%s\n%T", Formatting, "This person was a jobname", Client, TargetDescription[entity][0], Client);
  5201. Format(Formatting, 1024, "%s\n%T", Formatting, "He died roughly before you conducted the search", Client, CorrectTime);
  5202. Format(Formatting, 1024, "%s\n%T", Formatting, TargetDescription[entity][2], Client);
  5203. if(StrContains(TargetDescription[entity][3], ":", false) != -1)
  5204. {
  5205. ExplodeString(TargetDescription[entity][3], ":", EString, 2, 128);
  5206. Format(Formatting, 1024, "%s\n%T", Formatting, EString[0], Client, EString[1]);
  5207. }
  5208. if(TargetDescription_bool[entity][4]) Format(Formatting, 1024, "%s\n%T", Formatting, TargetDescription[entity][4], Client);
  5209. SetMenuTitle(menuhandle, Formatting);
  5210. AddMenuItem(menuhandle, "Close", "Close");
  5211. if(far) Format(Formatting, 256, "farCall%i", entity);
  5212. else Format(Formatting, 1024, "Call%i", entity);
  5213. Format(Translate_Formatting, 256, "%T", "Call Detective", Client);
  5214. if(Job[Client] != detector)
  5215. {
  5216. if(AliveJobCount[detector] > 0 && !(DNASprites[entity] && IsValidEdict(DNASprites[entity])) && IsPlayerAlive(Client)) AddMenuItem(menuhandle, Formatting, Translate_Formatting);
  5217. else if(AliveJobCount[detector] > 0) AddMenuItem(menuhandle, "Call", Translate_Formatting, ITEMDRAW_DISABLED);
  5218. else
  5219. {
  5220. Format(Translate_Formatting, 256, "%T(%T)", "Call Detective", Client, "None Detective", Client);
  5221. AddMenuItem(menuhandle, "Call", Translate_Formatting, ITEMDRAW_DISABLED);
  5222. }
  5223. }
  5224. if(RemainCredit[entity] > 0)
  5225. {
  5226. new String:Formatting2[256];
  5227. if(far) Format(Formatting2, 256, "farCredit%i", entity);
  5228. else Format(Formatting2, 256, "Credit%i", entity);
  5229. if(IsPlayerAlive(Client)) AddMenuItem(menuhandle, Formatting2, "크레딧 회수");
  5230. }
  5231. new String:Formatting2[256];
  5232. if(far) Format(Formatting2, 256, "farDNA%i", entity);
  5233. else Format(Formatting2, 256, "DNA%i", entity);
  5234. if(!StrEqual(DNAInformation[entity], ""))
  5235. {
  5236. if(GetEngineTime() - StringToFloat(TargetDescription[entity][1]) < 120.0)
  5237. {
  5238. new String:Formatting3[256], String:DNARemainTime[256];
  5239. FormatTime_Hud(Client, -120.0+(2.0*GetEngineTime())-StringToFloat(TargetDescription[entity][1]), DNARemainTime, 256);
  5240. Format(Formatting3, 256, "Returning DNA(Disappear in %s.)", DNARemainTime);
  5241. if(Job[Client] == detector && IsPlayerAlive(Client)) AddMenuItem(menuhandle, Formatting2, Formatting3);
  5242. else AddMenuItem(menuhandle, Formatting2, Formatting3, ITEMDRAW_DISABLED);
  5243. }
  5244. else AddMenuItem(menuhandle, Formatting2, "Returning DNA(DNA disapeared.)", ITEMDRAW_DISABLED);
  5245. }
  5246. else AddMenuItem(menuhandle, Formatting2, "Returning DNA(Cant find DNA.)", ITEMDRAW_DISABLED);
  5247. Format(Translate_Formatting, 256, "%T", "You found a list of kills with these names", Client);
  5248. Format(Formatting2, 256, "traitor kill list%i", entity);
  5249. if(TargetDescription_bool[entity][5]) AddMenuItem(menuhandle, Formatting2, Translate_Formatting);
  5250. SetMenuExitButton(menuhandle, true);
  5251. DisplayMenu(menuhandle, Client, 20);
  5252. }
  5253.  
  5254. public CheckDeadBody_CallBack(Handle:menu, MenuAction:action, Client, select)
  5255. {
  5256. if(action == MenuAction_Select)
  5257. {
  5258. new String:info[256];
  5259. GetMenuItem(menu, select, info, 256);
  5260. if(StrContains(info, "Credit", false) != -1)
  5261. {
  5262. new bool:check;
  5263. if(StrContains(info, "far", false) == 0)
  5264. {
  5265. ReplaceStringEx(info, 256, "farCredit", "");
  5266. check = true;
  5267. }
  5268. else ReplaceStringEx(info, 256, "Credit", "");
  5269. new entity = StringToInt(info);
  5270. if(RemainCredit[entity] > 0 && chosen)
  5271. {
  5272. Credit[Client] += RemainCredit[entity];
  5273. PrintChat(Client, "\x07C53AC5%T", "found credit", Client, RemainCredit[entity], "\x07FFFFFF");
  5274. RemainCredit[entity] = 0;
  5275. }
  5276. if(check)
  5277. {
  5278. CheckDeadBody(Client, entity, 1);
  5279. }
  5280. else
  5281. {
  5282. CheckDeadBody(Client, entity, 0);
  5283. }
  5284. }
  5285. if(StrContains(info, "Call", false) != -1)
  5286. {
  5287. new bool:check;
  5288. if(StrContains(info, "far", false) == 0)
  5289. {
  5290. ReplaceStringEx(info, 256, "farCall", "");
  5291. check = true;
  5292. }
  5293. else ReplaceStringEx(info, 256, "Call", "");
  5294. new Float:position[3], Float:entityposition[3];
  5295. GetClientAbsOrigin(Client, position);
  5296. GetEntPropVector(StringToInt(info), Prop_Send, "m_vecOrigin", entityposition);
  5297. if(GetVectorDistance(position, entityposition, false) > 200.0 && !check)
  5298. {
  5299. PrintChat(Client, "\x07C5C5FF%T", "too far from body", Client);
  5300. }
  5301. else if(IsPlayerAlive(Client) && chosen)
  5302. {
  5303. entityposition[2] += 10.0;
  5304. new String:TargetName[256];
  5305. GetEntPropString(StringToInt(info), Prop_Data, "m_iName", TargetName, 256);
  5306. DNASprites[StringToInt(info)] = CreateEntityByName("env_glow");
  5307. if(!IsModelPrecached("ttt/call_detective.vmt"))
  5308. {
  5309. PrecacheModel("ttt/call_detective.vmt", true);
  5310. }
  5311. DispatchKeyValue(DNASprites[StringToInt(info)], "spawnflags", "1");
  5312. DispatchKeyValue(DNASprites[StringToInt(info)], "model", "ttt/call_detective.vmt");
  5313. DispatchKeyValue(DNASprites[StringToInt(info)], "framerate", "0");
  5314. DispatchKeyValueFloat(DNASprites[StringToInt(info)], "scale", 1.0);
  5315. DispatchSpawn(DNASprites[StringToInt(info)]);
  5316. SetEntityModel(DNASprites[StringToInt(info)], "ttt/call_detective.vmt");
  5317. TeleportEntity(DNASprites[StringToInt(info)], entityposition, NULL_VECTOR, NULL_VECTOR);
  5318. SetVariantString("!activator");
  5319. AcceptEntityInput(DNASprites[StringToInt(info)], "SetParent", StringToInt(info), DNASprites[StringToInt(info)], 0);
  5320. SDKHook(DNASprites[StringToInt(info)], SDKHook_SetTransmit, Hook_SetTransmit5);
  5321. for(new i=1; i <= MaxClients; i++)
  5322. {
  5323. if(JoinCheck(i))
  5324. {
  5325. PrintChat(i, "\x07FF3A3A%N\x07FFFF3A%T", Client, "called a Detective", i, TargetName, "\x07FF3A3A", "\x07FFFF3A", "\x0787CEEB", "\x07FFFF3A");
  5326. }
  5327. }
  5328. }
  5329. }
  5330. if(StrContains(info, "DNA", false) != -1)
  5331. {
  5332. new bool:check;
  5333. if(StrContains(info, "far", false) == 0)
  5334. {
  5335. ReplaceStringEx(info, 256, "farDNA", "");
  5336. check = true;
  5337. }
  5338. else ReplaceStringEx(info, 256, "DNA", "");
  5339. new Float:position[3], Float:entityposition[3], String:TargetName[256];
  5340. GetClientAbsOrigin(Client, position);
  5341. GetEntPropVector(StringToInt(info), Prop_Send, "m_vecOrigin", entityposition);
  5342. GetEntPropString(StringToInt(info), Prop_Data, "m_iName", TargetName, 256);
  5343. if(GetVectorDistance(position, entityposition, false) > 200.0 && !check)
  5344. {
  5345. PrintChat(Client, "\x07C5C5FF%T", "too far from body", Client);
  5346. return;
  5347. }
  5348. if(!StrEqual(DNAInformation[StringToInt(info)], ""))
  5349. {
  5350. for(new i; i < 5; i++)
  5351. {
  5352. if(StrEqual(Sample[Client][i][0], ""))
  5353. {
  5354. Sample[Client][i][0] = DNAInformation[StringToInt(info)];
  5355. GetEntPropString(StringToInt(info), Prop_Data, "m_iName", Sample[Client][i][1], 256);
  5356. DNAInformation[StringToInt(info)] = "";
  5357. break;
  5358. }
  5359. }
  5360. }
  5361. PrintChat(Client, "\x07FFFFFF%T", "press tab key", Client);
  5362. }
  5363. if(StrContains(info, "traitor kill list", false) != -1)
  5364. {
  5365. ReplaceStringEx(info, 256, "traitor kill list", "");
  5366. KillList(Client, StringToInt(info));
  5367. }
  5368. }
  5369. if(action == MenuAction_End)
  5370. {
  5371. CloseHandle(menu);
  5372. }
  5373. }
  5374.  
  5375. public KillList(Client, entity)
  5376. {
  5377. new Handle:menuhandle = CreateMenu(KillList_CallBack);
  5378. SetMenuTitle(menuhandle, "%T", "You found a list of kills with these names", Client);
  5379. new String:EString[2][256], String:TemporaryString[256], count;
  5380. ExplodeString(TargetDescription[entity][5], "�", EString, 2, 256);
  5381. TemporaryString = EString[1];
  5382. while(StrContains(TemporaryString, "\n") != -1)
  5383. {
  5384. ReplaceStringEx(TemporaryString, 256, "\n", "");
  5385. count++;
  5386. }
  5387. new String:EString2[count+1][32];
  5388. ExplodeString(EString[1], "\n", EString2, count+1, 256);
  5389. for(new i=1; i < count+1; i++)
  5390. {
  5391. AddMenuItem(menuhandle, "", EString2[i], ITEMDRAW_DISABLED);
  5392. }
  5393. SetMenuExitButton(menuhandle, true);
  5394. DisplayMenu(menuhandle, Client, 20);
  5395. }
  5396.  
  5397. public KillList_CallBack(Handle:menu, MenuAction:action, Client, select)
  5398. {
  5399. if(action == MenuAction_End)
  5400. {
  5401. CloseHandle(menu);
  5402. }
  5403. }
  5404.  
  5405. public DNAMenu(Client)
  5406. {
  5407. new Handle:menuhandle = CreateMenu(DNAMenu_CallBack), String:Translate_Formatting[256];
  5408. SetMenuTitle(menuhandle, "-- DNA Sample --");
  5409. for(new i; i<5; i++)
  5410. {
  5411. if(StrEqual(Sample[Client][i][0], ""))
  5412. {
  5413. Format(Translate_Formatting, 256, "%T", "empty slot", Client);
  5414. AddMenuItem(menuhandle, "", Translate_Formatting);
  5415. }
  5416. else
  5417. {
  5418. AddMenuItem(menuhandle, "", Sample[Client][i][1]);
  5419. }
  5420. }
  5421. SetMenuExitButton(menuhandle, true);
  5422. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  5423. }
  5424.  
  5425. public DNAMenu_CallBack(Handle:menu, MenuAction:action, Client, select)
  5426. {
  5427. if(action == MenuAction_Select)
  5428. {
  5429. if(StrEqual(Sample[Client][select][0], "")) PrintChat(Client, "\x073A3A3A%T!", "empty slot", Client);
  5430. else DNAMenu2(Client, select);
  5431. }
  5432. if(action == MenuAction_End)
  5433. {
  5434. CloseHandle(menu);
  5435. }
  5436. }
  5437.  
  5438. public DNAMenu2(Client, Number)
  5439. {
  5440. new Handle:menuhandle = CreateMenu(DNAMenu2_CallBack), String:Formatting[256];
  5441. SetMenuTitle(menuhandle, "-- DNA Sample --\n%s", Sample[Client][Number][1]);
  5442. Format(Formatting, 256, "%i", Number);
  5443. AddMenuItem(menuhandle, Formatting, "Use");
  5444. AddMenuItem(menuhandle, Formatting, "Drop");
  5445. SetMenuExitButton(menuhandle, true);
  5446. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  5447. }
  5448.  
  5449. public DNAMenu2_CallBack(Handle:menu, MenuAction:action, Client, select)
  5450. {
  5451. if(action == MenuAction_Select)
  5452. {
  5453. new String:StringNumber[256];
  5454. GetMenuItem(menu, select, StringNumber, 256);
  5455. new Number = StringToInt(StringNumber);
  5456. if(select == 0)
  5457. {
  5458. if(StrEqual(Sample[Client][Number][0], ""))
  5459. {
  5460. DNAScanning[Client] = false;
  5461. new String:Translate_Formatting[256];
  5462. Format(Translate_Formatting, 256, "\x073A3A3A%T!", "empty slot", Client);
  5463. PrintChat(Client, Translate_Formatting);
  5464. return;
  5465. }
  5466. else
  5467. {
  5468. DNAScanning[Client] = true;
  5469. DNASample[Client][0] = Sample[Client][Number][0];
  5470. DNASample[Client][1] = Sample[Client][Number][1];
  5471. new Handle:pack = CreateDataPack();
  5472. WritePackCell(pack, StringToInt(DNASample[Client][0]));
  5473. WritePackCell(pack, Client);
  5474. WritePackCell(pack, Ragdoll[StringToInt(DNASample[Client][0])]);
  5475. DNAScanCount[Client] = 0;
  5476. if(DNAScanTimer[Client] != INVALID_HANDLE)
  5477. {
  5478. KillTimer(DNAScanTimer[Client]);
  5479. DNAScanTimer[Client] = INVALID_HANDLE;
  5480. }
  5481. DNAScanTimer[Client] = CreateTimer(1.0, DNAScanCheck, pack, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE|TIMER_DATA_HNDL_CLOSE);
  5482. PrintChat(Client, "\x07FFFF3A%T", "start dna scan", Client);
  5483. }
  5484. }
  5485. if(select == 1)
  5486. {
  5487. if(StrEqual(Sample[Client][Number][0], ""))
  5488. {
  5489. DNAScanning[Client] = false;
  5490. new String:Translate_Formatting[256];
  5491. Format(Translate_Formatting, 256, "\x073A3A3A%T!", "empty slot", Client);
  5492. PrintChat(Client, Translate_Formatting);
  5493. return;
  5494. }
  5495. else
  5496. {
  5497. Sample[Client][Number][0] = "";
  5498. Sample[Client][Number][1] = "";
  5499. PrintChat(Client, "\x07FFFF3A%T", "drop dna", Client);
  5500. }
  5501. }
  5502. }
  5503. if(action == MenuAction_End)
  5504. {
  5505. CloseHandle(menu);
  5506. }
  5507. }
  5508.  
  5509. public Action:OnPlayerRunCmd(Client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon)
  5510. {
  5511. if(JoinCheck(Client))
  5512. {
  5513. if(JoinCheck(GetClientAimTarget(Client)) && IsPlayerAlive(GetClientAimTarget(Client)) && !IsDisguise[GetClientAimTarget(Client)]) MenuLastMan[Client] = GetClientAimTarget(Client);
  5514. new weapons = GetEntPropEnt(Client, Prop_Data, "m_hActiveWeapon"), String:weaponclass[32];
  5515. if(weapons > 0 && IsValidEdict(weapons)) GetEdictClassname(weapons, weaponclass, 32);
  5516. if(buttons & IN_RELOAD)
  5517. {
  5518. if(weapons == GetPlayerWeaponSlot(Client, 0) && StrEqual(weaponclass, "weapon_awp", false) && Silenced_Sniper_Rifle[weapons]) buttons &= ~IN_RELOAD;
  5519. else if(weapons == GetPlayerWeaponSlot(Client, 1) && StrEqual(weaponclass, "weapon_p228", false)) buttons &= ~IN_RELOAD;
  5520. }
  5521. if((buttons & IN_SPEED) && !(keybuffer[Client] & IN_SPEED))
  5522. {
  5523. keybuffer[Client] = keybuffer[Client] | IN_SPEED;
  5524. ShowMenuCount[Client] = 50;
  5525. MenuLastMan[Client] = 0;
  5526. if(!IsShowMenu[Client])
  5527. {
  5528. FastChat(Client);
  5529. IsShowMenu[Client] = true;
  5530. }
  5531. if(IsPlayerAlive(Client))
  5532. {
  5533. if(JoinCheck(GetClientAimTarget(Client)) && IsPlayerAlive(GetClientAimTarget(Client)) && IsDisguise[GetClientAimTarget(Client)])
  5534. {
  5535. for(new i=1; i<=MaxClients; i++)
  5536. {
  5537. if(JoinCheck(i))
  5538. {
  5539. PrintChat(i, "\x07FF3A3A%N \x01: someone in disguise!", Client);
  5540. }
  5541. }
  5542. }
  5543. }
  5544. }
  5545. else if(!(buttons & IN_SPEED) && keybuffer[Client] & IN_SPEED)
  5546. {
  5547. keybuffer[Client] = keybuffer[Client] & ~IN_SPEED;
  5548. }
  5549. if(buttons & IN_SCORE && !(keybuffer[Client] & IN_SCORE))
  5550. {
  5551. keybuffer[Client] |= IN_SCORE;
  5552. if(IsPlayerAlive(Client))
  5553. {
  5554. for(new i; i < 5; i++)
  5555. {
  5556. if(!StrEqual(Sample[Client][i][0], ""))
  5557. {
  5558. DNAMenu(Client);
  5559. break;
  5560. }
  5561. }
  5562. }
  5563. }
  5564. else if(!(buttons & IN_SCORE))
  5565. {
  5566. keybuffer[Client] &= ~IN_SCORE;
  5567. }
  5568. if((buttons & IN_USE) && !(keybuffer[Client] & IN_USE))
  5569. {
  5570. keybuffer[Client] = keybuffer[Client] | IN_USE;
  5571. decl Float:pos[3], Float:angle[3];
  5572. GetClientEyePosition(Client, pos);
  5573. GetClientEyeAngles(Client, angle);
  5574.  
  5575. new Handle:traceresulthandle = INVALID_HANDLE;
  5576. traceresulthandle = TR_TraceRayFilterEx(pos, angle, MASK_SOLID, RayType_Infinite, tracerayfilternoplayer, Client);
  5577.  
  5578. if(TR_DidHit(traceresulthandle) == true)
  5579. {
  5580. new Entity = TR_GetEntityIndex(traceresulthandle);
  5581. new Float:entityposition[3], String:TargetName[256], String:classname[256];
  5582. GetEntPropVector(Entity, Prop_Send, "m_vecOrigin", entityposition);
  5583. GetEntPropString(Entity, Prop_Data, "m_iName", TargetName, 256);
  5584. GetEdictClassname(Entity, classname, 256);
  5585. entityposition[2] += 60.0;
  5586. if((IsPlayerAlive(Client) && GetVectorDistance(pos, entityposition) <= 200.0) || !IsPlayerAlive(Client))
  5587. {
  5588. if(IsRagdoll[Entity])
  5589. {
  5590. CheckDeadBody(Client, Entity, 0);
  5591. if(!CheckedBody[Entity] && IsPlayerAlive(Client))
  5592. {
  5593. for(new i=1; i<=MaxClients; i++)
  5594. {
  5595. if(JoinCheck(i))
  5596. {
  5597. PrintChat(i, "\x07FF3A3A%N%T", Client, "found the body", i, TargetName, TargetDescription[Entity][0], "\x07FFFF3A", "\x07FF3A3A", "\x07FFFF3A", "\x07FFFFFF", i, "\x07FFFF3A");
  5598. }
  5599. }
  5600. CheckedBody[Entity] = true;
  5601. }
  5602. }
  5603. }
  5604. }
  5605. CloseHandle(traceresulthandle);
  5606. }
  5607. else if(!(buttons & IN_USE))
  5608. {
  5609. keybuffer[Client] = keybuffer[Client] & ~IN_USE;
  5610. }
  5611. if(ShowMenuCount[Client])
  5612. {
  5613. if(!IsPlayerAlive(Client))
  5614. {
  5615. MenuLastMan[Client] = 0;
  5616. }
  5617. }
  5618. }
  5619. if(JoinCheck(Client) && IsPlayerAlive(Client))
  5620. {
  5621. new Float:FallVelocity = GetEntPropFloat(Client, Prop_Send, "m_flFallVelocity");
  5622. if(FallVelocity < 0 && KnockBackAttacker[Client] && !KnockBackAttackerDelay[Client]) KnockBackAttackerDelay[Client] = 1;
  5623. else if(FallVelocity == 0 && KnockBackAttacker[Client] && KnockBackAttackerDelay[Client]) KnockBackAttacker[Client] = 0;
  5624. if(buttons & IN_USE)
  5625. {
  5626. if(!HealDelay[Client])
  5627. {
  5628. decl Float:pos[3], Float:angle[3];
  5629. GetClientEyePosition(Client, pos);
  5630. GetClientEyeAngles(Client, angle);
  5631.  
  5632. new Handle:traceresulthandle = INVALID_HANDLE;
  5633. traceresulthandle = TR_TraceRayFilterEx(pos, angle, MASK_SOLID, RayType_Infinite, tracerayfilternoplayer, Client);
  5634.  
  5635. if(TR_DidHit(traceresulthandle) == true)
  5636. {
  5637. new Entity = TR_GetEntityIndex(traceresulthandle);
  5638. new Float:entityposition[3], String:TargetName[256];
  5639. GetEntPropVector(Entity, Prop_Send, "m_vecOrigin", entityposition);
  5640. GetEntPropString(Entity, Prop_Data, "m_iName", TargetName, 256);
  5641. entityposition[2] += 60.0;
  5642. if(IsFakeHealthBox[Entity])
  5643. {
  5644. if(Job[Client] == traitor)
  5645. {
  5646. if(HealthBox[Entity])
  5647. {
  5648. HealthBox[Entity] -= 1;
  5649. HealDelay[Client] = true;
  5650. CreateTimer(0.3, HealDelay_Timer, Client);
  5651. }
  5652. }
  5653. }
  5654. if(GetVectorDistance(pos, entityposition) <= 150.0)
  5655. {
  5656. if(IsFakeHealthBox[Entity])
  5657. {
  5658. if(Job[Client] != traitor)
  5659. {
  5660. if(JoinCheck(FakeHealthBoxOwner[Entity])) makeRadiusDamage(FakeHealthBoxOwner[Entity], entityposition, 200.0, 99.0, "fake_healthbox", true);
  5661. else makeRadiusDamage(0, entityposition, 200.0, 99.0, "fake_healthbox", true);
  5662. AcceptEntityInput(Entity, "Kill");
  5663. IsFakeHealthBox[Entity] = false;
  5664. }
  5665. }
  5666. if(IsHealthBox[Entity] && HealthBox[Entity] > 0)
  5667. {
  5668. if(GetClientHealth(Client) < 100)
  5669. {
  5670. new HealthBoxAbility = IsDetectorHealthBox[Entity] ? 2 : 1, PlusHP;
  5671. if(IsVIPHealthBox[Entity]) HealthBoxAbility += 1;
  5672. if(GetClientHealth(Client) > 100-HealthBoxAbility)
  5673. {
  5674. PlusHP = 100 - GetClientHealth(Client);
  5675. if(HealthBox[Entity] >= PlusHP)
  5676. {
  5677. SetEntityHealth(Client, GetClientHealth(Client)+PlusHP);
  5678. HealthBox[Entity] -= PlusHP;
  5679. }
  5680. else
  5681. {
  5682. SetEntityHealth(Client, GetClientHealth(Client)+HealthBox[Entity]);
  5683. HealthBox[Entity] = 0;
  5684. }
  5685. }
  5686. else
  5687. {
  5688. if(HealthBox[Entity] >= HealthBoxAbility)
  5689. {
  5690. SetEntityHealth(Client, GetClientHealth(Client)+HealthBoxAbility);
  5691. HealthBox[Entity] -= HealthBoxAbility;
  5692. }
  5693. else
  5694. {
  5695. SetEntityHealth(Client, GetClientHealth(Client)+HealthBox[Entity]);
  5696. HealthBox[Entity] = 0;
  5697. }
  5698. }
  5699. if(!HealSoundDelay[Client])
  5700. {
  5701. EmitSoundToAll("items/smallmedkit1.wav", Client);
  5702. CreateTimer(2.0, HealSoundDelay_Timer, Client);
  5703. HealSoundDelay[Client] = true;
  5704. }
  5705. HealDelay[Client] = true;
  5706. CreateTimer(0.3, HealDelay_Timer, Client);
  5707. }
  5708. }
  5709. }
  5710. }
  5711. CloseHandle(traceresulthandle);
  5712. }
  5713. }
  5714. decl String:WeaponName[256];
  5715. GetClientWeapon(Client, WeaponName, 256);
  5716. new weapons = GetEntPropEnt(Client, Prop_Data, "m_hActiveWeapon");
  5717. if(TeleporterDelay[Client])
  5718. {
  5719. if(!Teleporter[weapons] && Teleport[Client] != INVALID_HANDLE)
  5720. {
  5721. TeleporterDelay[Client] = false;
  5722. TeleportSuccess[Client] = false;
  5723. SetEntPropFloat(Client, Prop_Send, "m_flProgressBarStartTime", 0.0);
  5724. SetEntProp(Client, Prop_Send, "m_iProgressBarDuration", 0);
  5725. SetEntityMoveType(Client, MOVETYPE_WALK);
  5726. KillTimer(Teleport[Client]);
  5727. Teleport[Client] = INVALID_HANDLE;
  5728. }
  5729. }
  5730. if(buttons & IN_ATTACK)
  5731. {
  5732. if(StrEqual(WeaponName, "weapon_c4", false))
  5733. {
  5734. buttons &= ~IN_ATTACK;
  5735. if(grabbedentref[Client] == INVALID_ENT_REFERENCE)
  5736. {
  5737. new targetentity, Float:distancetoentity, Float:resultpos[3], Float:eyeposition[3], Float:vector[3];
  5738. GetClientEyePosition(Client, eyeposition);
  5739. targetentity = GetClientAimEntity3(Client, distancetoentity, resultpos);
  5740. if(targetentity > 0){
  5741.  
  5742. new PropTypeCheck:entityType = entityTypeCheck(targetentity);
  5743. new String:classname[256];
  5744. if(IsValidEdict(targetentity)) GetEdictClassname(targetentity, classname, 256);
  5745. new iOwnerEntity = FindSendPropOffs("CBaseCombatWeapon", "m_hOwnerEntity");
  5746. if(StrContains(classname, "weapon_") != -1)
  5747. {
  5748. if(GetEntDataEnt2(targetentity, iOwnerEntity) != -1) return;
  5749. }
  5750. if(StrEqual(classname, "player", false))
  5751. {
  5752. /*
  5753. new Float:entityspeed[3];
  5754. GetEntPropVector(targetentity, Prop_Data, "m_vecVelocity", entityspeed);
  5755. new Float:position[3], Float:position2[3], Float:push[3];
  5756. GetClientEyePosition(targetentity, position2);
  5757. GetClientEyePosition(Client, position);
  5758. MakeVectorFromPoints(position, position2, push);
  5759. NormalizeVector(push, push);
  5760. ScaleVector(push, 8.0);
  5761. AddVectors(push, entityspeed, push);
  5762. TeleportEntity(targetentity, NULL_VECTOR, NULL_VECTOR, push);
  5763. */
  5764. return;
  5765. }
  5766. if(entityType && !isClientConnectedIngameAlive(GetEntPropEnt(targetentity, Prop_Send, "m_hOwnerEntity")))
  5767. {
  5768. if(distancetoentity <= 300.0)
  5769. {
  5770. MakeVectorFromPoints(eyeposition, resultpos, vector);
  5771. ScaleVector(vector, 1.0);
  5772. Phys_SetVelocity(targetentity, vector, ZERO_VECTOR, true);
  5773. }
  5774. }
  5775. }
  5776. }
  5777. else if(grabbedentref[Client] != INVALID_ENT_REFERENCE)
  5778. {
  5779. decl Float:pos[3], Float:angle[3];
  5780. GetClientEyePosition(Client, pos);
  5781. GetClientEyeAngles(Client, angle);
  5782.  
  5783. new Handle:traceresulthandle = INVALID_HANDLE, Float:resultposition[3];
  5784. traceresulthandle = TR_TraceRayFilterEx(pos, angle, MASK_SOLID, RayType_Infinite, tracerayfilternoragdoll, Client);
  5785.  
  5786. if(TR_DidHit(traceresulthandle) == true)
  5787. {
  5788. new Entity = TR_GetEntityIndex(traceresulthandle);
  5789. if(!Entity && IsRagdoll[EntRefToEntIndex(grabbedentref[Client])])
  5790. {
  5791. TR_GetEndPosition(resultposition, traceresulthandle);
  5792. if(GetVectorDistance(pos, resultposition, false) < 200.0)
  5793. {
  5794. for(new i; i<4; i++)
  5795. {
  5796. if(!Wire[EntRefToEntIndex(grabbedentref[Client])][i][0] && !Wire[EntRefToEntIndex(grabbedentref[Client])][i][1] && !Wire[EntRefToEntIndex(grabbedentref[Client])][i][2])
  5797. {
  5798. CreateWire(EntRefToEntIndex(grabbedentref[Client]), resultposition);
  5799. release(Client);
  5800. break;
  5801. }
  5802. }
  5803. }
  5804. }
  5805. }
  5806. CloseHandle(traceresulthandle);
  5807. }
  5808. }
  5809. if(StrEqual(WeaponName, "weapon_smokegrenade", false) && DNASignalJammer[weapons] && !(keybuffer[Client] & IN_ATTACK))
  5810. {
  5811. keybuffer[Client] = keybuffer[Client] | IN_ATTACK;
  5812. new Float:pos[3], Float:angle[3];
  5813. GetClientEyePosition(Client, pos);
  5814. GetClientEyeAngles(Client, angle);
  5815.  
  5816. new Handle:traceresulthandle = INVALID_HANDLE, Float:resultposition[3];
  5817. traceresulthandle = TR_TraceRayFilterEx(pos, angle, MASK_SOLID, RayType_Infinite, tracerayfilternoplayer, Client);
  5818.  
  5819. if(TR_DidHit(traceresulthandle) == true)
  5820. {
  5821. TR_GetEndPosition(resultposition, traceresulthandle);
  5822. if(GetVectorDistance(resultposition, pos) < 300.0)
  5823. {
  5824. new entity = Create_Prop(Client, "models/props/cs_office/phone.mdl", true);
  5825. if(entity != -1)
  5826. {
  5827. JammerEntity[Client] = entity;
  5828. SetVariantInt(500);
  5829. AcceptEntityInput(entity, "SetHealth");
  5830. SetEntityMoveType(entity, MOVETYPE_NONE);
  5831. if(IsValidEdict(weapons))
  5832. {
  5833. RemovePlayerItem(Client, weapons);
  5834. RemoveEdict(weapons);
  5835. }
  5836. }
  5837. }
  5838. else PrintChat(Client, "It's too far away!");
  5839. }
  5840. CloseHandle(traceresulthandle);
  5841. }
  5842. if(StrEqual(WeaponName, "weapon_smokegrenade", false) && Jihad[weapons] && !(keybuffer[Client] & IN_ATTACK))
  5843. {
  5844. keybuffer[Client] = keybuffer[Client] | IN_ATTACK;
  5845. if(!IsJihad[Client])
  5846. {
  5847. IsJihad[Client] = true;
  5848. new Float:Position[3], Float:Angle[3] = {-90.0, 0.0, 0.0};
  5849. GetClientAbsOrigin(Client, Position);
  5850. Position[2] += 20.0;
  5851. JihadSpark[Client] = CreateEntityByName("env_spark");
  5852. DispatchKeyValueVector(JihadSpark[Client], "angles", Angle);
  5853. DispatchKeyValue(JihadSpark[Client], "MaxDelay", "1");
  5854. DispatchKeyValue(JihadSpark[Client], "Magnitude", "2");
  5855. DispatchKeyValue(JihadSpark[Client], "TrailLength", "1");
  5856. DispatchKeyValue(JihadSpark[Client], "spawnflags", "395");
  5857. DispatchSpawn(JihadSpark[Client]);
  5858. TeleportEntity(JihadSpark[Client], Position, NULL_VECTOR, NULL_VECTOR);
  5859. AcceptEntityInput(JihadSpark[Client], "StartSpark", Client);
  5860. SetVariantString("!activator");
  5861. AcceptEntityInput(JihadSpark[Client], "SetParent", Client, JihadSpark[Client], 0);
  5862. CreateTimer(2.5, Jihad_Explosion, Client);
  5863. EmitSoundToAll("tttmusic/jihad.wav", Client, SNDCHAN_WEAPON, ATTN_TO_SNDLEVEL(0.28));
  5864. }
  5865. buttons &= ~IN_ATTACK;
  5866. }
  5867. if(StrEqual(WeaponName, "weapon_flashbang", false) && HealthStation[weapons] && !(keybuffer[Client] & IN_ATTACK))
  5868. {
  5869. keybuffer[Client] = keybuffer[Client] | IN_ATTACK;
  5870. new Float:pos[3], Float:angle[3];
  5871. GetClientEyePosition(Client, pos);
  5872. GetClientEyeAngles(Client, angle);
  5873.  
  5874. new Handle:traceresulthandle = INVALID_HANDLE, Float:resultposition[3];
  5875. traceresulthandle = TR_TraceRayFilterEx(pos, angle, MASK_SOLID, RayType_Infinite, tracerayfilternoplayer, Client);
  5876.  
  5877. if(TR_DidHit(traceresulthandle) == true)
  5878. {
  5879. TR_GetEndPosition(resultposition, traceresulthandle);
  5880. if(GetVectorDistance(resultposition, pos) < 300.0)
  5881. {
  5882. new entity = Create_Prop(Client, "models/items/item_item_crate.mdl");
  5883. if(entity != -1)
  5884. {
  5885. IsHealthBox[entity] = true;
  5886. if(VIP[Client]) HealthBox[entity] = 300;
  5887. else HealthBox[entity] = 150;
  5888. if(Job[Client] == detector) IsDetectorHealthBox[entity] = true;
  5889. if(VIP[Client]) IsVIPHealthBox[entity] = true;
  5890. SetVariantInt(200);
  5891. AcceptEntityInput(entity, "SetHealth");
  5892. if(IsValidEdict(weapons))
  5893. {
  5894. RemovePlayerItem(Client, weapons);
  5895. RemoveEdict(weapons);
  5896. }
  5897. }
  5898. }
  5899. else PrintChat(Client, "It's too far away!");
  5900. }
  5901. CloseHandle(traceresulthandle);
  5902. }
  5903. if(StrEqual(WeaponName, "weapon_hegrenade", false) && Teleporter[weapons] && !(keybuffer[Client] & IN_ATTACK))
  5904. {
  5905. keybuffer[Client] = keybuffer[Client] | IN_ATTACK;
  5906. if(TeleportCount[weapons] > 0)
  5907. {
  5908. if(TeleporterSavedPosition[Client])
  5909. {
  5910. if(!TeleporterDelay[Client])
  5911. {
  5912. TeleporterDelay[Client] = true;
  5913. TeleportSuccess[Client] = true;
  5914. Teleport[Client] = CreateTimer(0.9, Teleporting, Client);
  5915. SetEntPropFloat(Client, Prop_Send, "m_flProgressBarStartTime", GetGameTime());
  5916. SetEntProp(Client, Prop_Send, "m_iProgressBarDuration", 1);
  5917. SetEntityMoveType(Client, MOVETYPE_NONE);
  5918. }
  5919. }
  5920. }
  5921. buttons &= ~IN_ATTACK;
  5922. }
  5923. }
  5924. else if(keybuffer[Client] & IN_ATTACK)
  5925. {
  5926. keybuffer[Client] = keybuffer[Client] & ~IN_ATTACK;
  5927. }
  5928. if(IsValidEdict(weapons) && (StrEqual(WeaponName, "weapon_hegrenade", false) || StrEqual(WeaponName, "weapon_smokegrenade", false) || StrEqual(WeaponName, "weapon_flashbang", false)))
  5929. {
  5930. new Float:Delay = 999.9;
  5931. SetEntDataFloat(weapons, g_NextPrimaryAttack, FloatAdd(GetGameTime(), Delay), true);
  5932. }
  5933. if(IsValidEdict(weapons) && (RPG[weapons] || Crossbow[weapons]))
  5934. {
  5935. new Float:Delay = 999.9;
  5936. SetEntDataFloat(weapons, g_NextPrimaryAttack, FloatAdd(GetGameTime(), Delay), true);
  5937. if(RPG[weapons] && GetClientiClip2(weapons, Client) > 1)
  5938. SetClientiClip2(weapons, Client, 0);
  5939. if(AttackDelay[Client] == 1)
  5940. {
  5941. if(RPG[weapons])
  5942. {
  5943. if(GetClientiClip2(weapons, Client) && !GetEntProp(weapons, Prop_Send, "m_iClip1"))
  5944. {
  5945. AttackDelay[Client] = 2;
  5946. ReloadCount[Client] = 20;
  5947. CreateTimer(0.1, Reloading, Client, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
  5948. }
  5949. }
  5950. if(Crossbow[weapons])
  5951. {
  5952. if(GetClientiClip2(weapons, Client) && !GetEntProp(weapons, Prop_Send, "m_iClip1"))
  5953. {
  5954. AttackDelay[Client] = 2;
  5955. ReloadCount[Client] = 6;
  5956. CreateTimer(0.1, Reloading, Client, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
  5957. }
  5958. }
  5959. }
  5960. if(buttons & IN_ATTACK)
  5961. {
  5962. if(AttackDelay[Client] == 1)
  5963. {
  5964. if(RPG[weapons])
  5965. {
  5966. if(!GetEntProp(Client, Prop_Send, "m_iShotsFired") && GetEntProp(Client, Prop_Send, "m_iFOV") < 90 && GetEntProp(Client, Prop_Send, "m_iFOV") > 0 && GetEntProp(weapons, Prop_Send, "m_iClip1") > 0)
  5967. {
  5968. AttackDelay[Client] = 0;
  5969. CreateTimer(0.0, Missile, Client);
  5970. CreateTimer(1.0, AttackDelayed, Client);
  5971. SetEntProp(Client, Prop_Send, "m_iShotsFired", 1);
  5972. SetEntProp(weapons, Prop_Send, "m_iClip1", GetEntProp(weapons, Prop_Send, "m_iClip1")-1);
  5973. SetEntProp(Client, Prop_Send, "m_iFOV", 90);
  5974. SetEntProp(Client, Prop_Send, "m_iFOVStart", 90);
  5975. SetEntProp(ClientVM[Client][0], Prop_Send, "m_nSequence", 0);
  5976. SetEntProp(ClientVM[Client][1], Prop_Send, "m_nSequence", 0);
  5977. new Float:vecPunch[3] = {-22.5, 0.0, 0.0};
  5978. SetEntDataVector(Client, offsPunchAngle, vecPunch);
  5979. ClientCommand(Client, "r_screenoverlay \"\"");
  5980. }
  5981. }
  5982. if(Crossbow[weapons])
  5983. {
  5984. if(!GetEntProp(Client, Prop_Send, "m_iShotsFired") && GetEntProp(weapons, Prop_Send, "m_iClip1") > 0)
  5985. {
  5986. AttackDelay[Client] = 0;
  5987. /*****Bolt*****/
  5988. new Float:cleyepos[3], Float:cleyeangle[3], Float:resultposition[3], target, hitgroup = -1;
  5989. GetClientEyePosition(Client, cleyepos);
  5990. GetClientEyeAngles(Client, cleyeangle);
  5991. new Handle:traceresulthandle = INVALID_HANDLE;
  5992. traceresulthandle = TR_TraceRayFilterEx(cleyepos, cleyeangle, MASK_SHOT, RayType_Infinite, tracerayfilternotarrow, Client);
  5993. if(TR_DidHit(traceresulthandle) == true)
  5994. {
  5995. TR_GetEndPosition(resultposition, traceresulthandle);
  5996. new Float:vecmin[3] = {-0.5, -0.5, -8.0}, Float:vecmax[3] = {0.5, 0.5, 0.0};
  5997. new Handle:traceresulthandle2 = TR_TraceHullFilterEx(cleyepos, resultposition, vecmin, vecmax, MASK_PLAYERSOLID, tracerayfilternotarrow, Client);
  5998. target = TR_GetEntityIndex(traceresulthandle2);
  5999. if(!target) target = TR_GetEntityIndex(traceresulthandle);
  6000. if(JoinCheck(target))
  6001. {
  6002. hitgroup = TR_GetHitGroup(traceresulthandle);
  6003. if(!hitgroup) hitgroup = 1;
  6004. }
  6005. CloseHandle(traceresulthandle2);
  6006. }
  6007. CloseHandle(traceresulthandle);
  6008. new entity = CreateEntityByName("hegrenade_projectile");
  6009. DispatchSpawn(entity);
  6010. SetEntityMoveType(entity, MOVETYPE_NONE);
  6011. SetEntityModel(entity, "models/aoc_weapon/aoc_arrow.mdl");
  6012. TeleportEntity(entity, resultposition, cleyeangle, NULL_VECTOR);
  6013. SetEntPropEnt(entity, Prop_Send, "m_hOwnerEntity", Client);
  6014. SetEntProp(entity, Prop_Send, "m_CollisionGroup", 2);
  6015. new Float:vecmax[3] = {0.0001, 0.0001, 0.0001};
  6016. new Float:vecmin[3] = {-0.0001, -0.0001, -0.0001};
  6017. SetEntPropVector(entity, Prop_Send, "m_vecMins", vecmin);
  6018. SetEntPropVector(entity, Prop_Send, "m_vecMaxs", vecmax);
  6019. EmitSoundToAll("weapons/crossbow/fire1.wav", Client);
  6020. EmitSoundToAll("weapons/crossbow/bolt_fly4.wav", entity);
  6021. if(JoinCheck(target))
  6022. {
  6023. if(hitgroup == 1) makeDamage(Client, target, 300, DMG_GENERIC, 0.0, resultposition, "Crossbow");
  6024. else makeDamage(Client, target, 60, DMG_GENERIC, 0.0, resultposition, "Crossbow");
  6025. EmitSoundToAll("weapons/crossbow/hitbod1.wav", entity, SNDCHAN_WEAPON, SNDLEVEL_NORMAL, SND_NOFLAGS, 1.0, SNDPITCH_NORMAL, -1, resultposition);
  6026. AcceptEntityInput(entity, "Kill");
  6027. }
  6028. else if(!target || entityTypeCheck(target))
  6029. {
  6030. EmitSoundToAll("weapons/crossbow/hit1.wav", entity, SNDCHAN_WEAPON, SNDLEVEL_NORMAL, SND_NOFLAGS, 1.0, SNDPITCH_NORMAL, -1, resultposition);
  6031. SetEntityMoveType(entity, MOVETYPE_NONE);
  6032. SetEntData(entity, CollOff, 2, 4, true);
  6033. CreateTimer(30.0, DeleteEntity, entity);
  6034. if(entityTypeCheck(target))
  6035. {
  6036. SetVariantString("!activator");
  6037. AcceptEntityInput(entity, "SetParent", target, entity, 0);
  6038. if(GetEntProp(target, Prop_Data, "m_iHealth") && GetEntProp(target, Prop_Data, "m_iHealth") <= 200) AcceptEntityInput(target, "Break", Client, target);
  6039. else SetEntProp(entity, Prop_Data, "m_iHealth", GetEntProp(entity, Prop_Data, "m_iHealth") ? GetEntProp(entity, Prop_Data, "m_iHealth")-200 : GetEntProp(entity, Prop_Data, "m_iHealth"));
  6040. }
  6041. }
  6042. else CreateTimer(30.0, DeleteEntity, entity);
  6043. /***************/
  6044. CreateTimer(0.1, AttackDelayed, Client);
  6045. SetEntProp(weapons, Prop_Send, "m_iClip1", GetEntProp(weapons, Prop_Send, "m_iClip1")-1);
  6046. SetEntProp(Client, Prop_Send, "m_iFOV", 90);
  6047. SetEntProp(Client, Prop_Send, "m_iFOVStart", 90);
  6048. SetEntProp(ClientVM[Client][0], Prop_Send, "m_nSequence", 0);
  6049. SetEntProp(ClientVM[Client][1], Prop_Send, "m_nSequence", 0);
  6050. new Float:vecPunch[3];
  6051. vecPunch[0] =GetRandomFloat(-5.0, 5.0);
  6052. vecPunch[1] = GetRandomFloat(-5.0, 5.0);
  6053. SetEntDataVector(Client, offsPunchAngle, vecPunch);
  6054. }
  6055. }
  6056. }
  6057. }
  6058. else
  6059. {
  6060. SetEntProp(Client, Prop_Send, "m_iShotsFired", 0);
  6061. }
  6062. if(RPG[weapons])
  6063. {
  6064. if(AttackDelay[Client] == 2)
  6065. {
  6066. if(ReloadCount[Client] > 0)
  6067. {
  6068. SetEntProp(ClientVM[Client][0], Prop_Send, "m_nSequence", 3);
  6069. SetEntProp(ClientVM[Client][1], Prop_Send, "m_nSequence", 3);
  6070. }
  6071. }
  6072. else if(!AttackDelay[Client])
  6073. {
  6074. SetEntProp(ClientVM[Client][0], Prop_Send, "m_nSequence", 2);
  6075. SetEntProp(ClientVM[Client][1], Prop_Send, "m_nSequence", 2);
  6076. }
  6077. else
  6078. {
  6079. SetEntProp(ClientVM[Client][0], Prop_Send, "m_nSequence", 0);
  6080. SetEntProp(ClientVM[Client][1], Prop_Send, "m_nSequence", 0);
  6081. }
  6082. }
  6083. if(Crossbow[weapons])
  6084. {
  6085. if(AttackDelay[Client] == 2)
  6086. {
  6087. if(ReloadCount[Client] > 0)
  6088. {
  6089. SetEntProp(ClientVM[Client][0], Prop_Send, "m_nSequence", 4);
  6090. SetEntProp(ClientVM[Client][1], Prop_Send, "m_nSequence", 4);
  6091. }
  6092. }
  6093. else if(!AttackDelay[Client])
  6094. {
  6095. if(GetEntProp(weapons, Prop_Send, "m_iClip1") > 0)
  6096. {
  6097. SetEntProp(ClientVM[Client][0], Prop_Send, "m_nSequence", 0);
  6098. SetEntProp(ClientVM[Client][1], Prop_Send, "m_nSequence", 0);
  6099. }
  6100. else
  6101. {
  6102. SetEntProp(ClientVM[Client][0], Prop_Send, "m_nSequence", 1);
  6103. SetEntProp(ClientVM[Client][1], Prop_Send, "m_nSequence", 1);
  6104. }
  6105. }
  6106. else
  6107. {
  6108. if(GetEntProp(weapons, Prop_Send, "m_iClip1") > 0)
  6109. {
  6110. SetEntProp(ClientVM[Client][0], Prop_Send, "m_nSequence", 0);
  6111. SetEntProp(ClientVM[Client][1], Prop_Send, "m_nSequence", 0);
  6112. }
  6113. else
  6114. {
  6115. SetEntProp(ClientVM[Client][0], Prop_Send, "m_nSequence", 1);
  6116. SetEntProp(ClientVM[Client][1], Prop_Send, "m_nSequence", 1);
  6117. }
  6118. }
  6119. }
  6120. }
  6121. if((buttons & IN_ATTACK2))
  6122. {
  6123. if(StrEqual(WeaponName, "weapon_awp", false) && RPG[weapons])
  6124. {
  6125. RPGFOV[Client] = GetEntProp(Client, Prop_Send, "m_iFOV");
  6126. if(!RPGFOV[Client] || RPGFOV[Client] == 90) ClientCommand(Client, "r_screenoverlay \"\"");
  6127. else ClientCommand(Client, "r_screenoverlay \"%s\"", "Effects/combine_binocoverlay.vmt");
  6128. }
  6129. }
  6130. if((buttons & IN_ATTACK2) && !(keybuffer[Client] & IN_ATTACK2))
  6131. {
  6132. keybuffer[Client] = keybuffer[Client] | IN_ATTACK2;
  6133. if(StrEqual(WeaponName, "weapon_c4"))
  6134. {
  6135. SetEntProp(ClientVM[Client][1], Prop_Send, "m_nSequence", 0);
  6136. ReloadCount[Client] = 25;
  6137. }
  6138. if(grabbedentref[Client] == INVALID_ENT_REFERENCE)
  6139. {
  6140. if(teamcanusegravitygun(GetClientTeam(Client)) && g_bIsWeaponGrabber[Client])
  6141. {
  6142. grab(Client);
  6143. }
  6144. }
  6145. else
  6146. {
  6147. release(Client);
  6148. }
  6149. if(StrEqual(WeaponName, "weapon_hegrenade", false) && Teleporter[weapons])
  6150. {
  6151. if(!(buttons & IN_DUCK))
  6152. {
  6153. if(GetEntityFlags(Client) & FL_ONGROUND)
  6154. {
  6155. GetClientAbsOrigin(Client, TeleporterPosition[Client]);
  6156. GetClientEyeAngles(Client, TeleporterAngle[Client]);
  6157. if(!TeleporterSavedPosition[Client]) TeleporterSavedPosition[Client] = true;
  6158. PrintChat(Client, "\x07FFFFFF%T", "Saved Position", Client);
  6159. }
  6160. else PrintChat(Client, "\x07FFFFFF%T", "Only Ground", Client);
  6161. }
  6162. else PrintChat(Client, "\x07FFFFFF%T", "No duck", Client);
  6163. }
  6164. }
  6165. else if(!(buttons & IN_ATTACK2) && keybuffer[Client] & IN_ATTACK2)
  6166. {
  6167. keybuffer[Client] = keybuffer[Client] & ~IN_ATTACK2;
  6168. }
  6169. if(!(buttons & IN_ATTACK) && keybuffer[Client] & IN_ATTACK)
  6170. {
  6171. keybuffer[Client] = keybuffer[Client] & ~IN_ATTACK;
  6172. }
  6173. }
  6174. if(DNAScanning[Client])
  6175. {
  6176. if(!IsPlayerAlive(Client))
  6177. {
  6178. DNAScanning[Client] = false;
  6179. }
  6180. }
  6181. }
  6182.  
  6183. public Action:CloseDoor(Handle:timer, any:Entity)
  6184. {
  6185. if(IsValidEdict(Entity)) AcceptEntityInput(Entity, "Close");
  6186. }
  6187.  
  6188. public Action:Teleporting(Handle:timer, any:Client)
  6189. {
  6190. if(JoinCheck(Client) && IsPlayerAlive(Client) && TeleportSuccess[Client] && (!roundstart || chosen))
  6191. {
  6192. SetEntityMoveType(Client, MOVETYPE_WALK);
  6193. new Float:NowPosition[3];
  6194. GetClientAbsOrigin(Client, NowPosition);
  6195. TeleportCount[GetEntPropEnt(Client, Prop_Data, "m_hActiveWeapon")] -= 1;
  6196. TeleporterDelay[Client] = false;
  6197. new Float:zerovelocity[3];
  6198. TeleportEntity(Client, TeleporterPosition[Client], TeleporterAngle[Client], zerovelocity);
  6199. SetEntPropFloat(Client, Prop_Send, "m_flProgressBarStartTime", 0.0);
  6200. SetEntProp(Client, Prop_Send, "m_iProgressBarDuration", 0);
  6201. PrintChat(Client, "\x07FFFFFF%T \x04: \x07FF3A3A%i", "Remain Teleport Count", Client, TeleportCount[GetEntPropEnt(Client, Prop_Data, "m_hActiveWeapon")]);
  6202. }
  6203. else if(roundstart && !chosen)
  6204. {
  6205. SetEntPropFloat(Client, Prop_Send, "m_flProgressBarStartTime", 0.0);
  6206. SetEntProp(Client, Prop_Send, "m_iProgressBarDuration", 0);
  6207. }
  6208. Teleport[Client] = INVALID_HANDLE;
  6209. }
  6210.  
  6211. public Action:Reloading(Handle:timer, any:Client)
  6212. {
  6213. if(JoinCheck(Client) && IsValidEdict(GetEntPropEnt(Client, Prop_Data, "m_hActiveWeapon")))
  6214. {
  6215. new weapons = GetEntPropEnt(Client, Prop_Data, "m_hActiveWeapon");
  6216. decl String:weaponname[64];
  6217. GetEdictClassname(weapons, weaponname, sizeof(weaponname));
  6218. if(!GetEntProp(weapons, Prop_Send, "m_iClip1"))
  6219. {
  6220. if((StrEqual(weaponname, "weapon_awp", false) || StrEqual(weaponname, "weapon_aug")) && IsValidEdict(weapons))
  6221. {
  6222. if(ReloadCount[Client] > 0)
  6223. {
  6224. ReloadCount[Client] -= 1;
  6225. if(!ReloadCount[Client])
  6226. {
  6227. if(StrEqual(weaponname, "weapon_aug")) EmitSoundToAll("weapons/crossbow/bolt_load1.wav", Client);
  6228. }
  6229. }
  6230. else
  6231. {
  6232. if(GetClientiClip2(weapons, Client) > 0) SetClientiClip2(weapons, Client, GetClientiClip2(weapons, Client)-1);
  6233. SetEntProp(weapons, Prop_Send, "m_iClip1", 1);
  6234. AttackDelay[Client] = 1;
  6235. if(StrEqual(weaponname, "weapon_awp")) CreateTimer(0.0, AttackDelayed_FOV, Client);
  6236. return Plugin_Stop;
  6237. }
  6238. }
  6239. else return Plugin_Stop;
  6240. }
  6241. else return Plugin_Stop;
  6242. }
  6243. else return Plugin_Stop;
  6244. return Plugin_Continue;
  6245. }
  6246.  
  6247. public Action:AttackDelayed_FOV(Handle:timer, any:Client)
  6248. {
  6249. if(JoinCheck(Client) && IsValidEdict(GetEntPropEnt(Client, Prop_Data, "m_hActiveWeapon")))
  6250. {
  6251. new weapons = GetEntPropEnt(Client, Prop_Data, "m_hActiveWeapon");
  6252. decl String:weaponname[64];
  6253. GetEdictClassname(weapons, weaponname, sizeof(weaponname));
  6254. if((StrEqual(weaponname, "weapon_awp", false) || StrEqual(weaponname, "weapon_aug")) && IsValidEdict(weapons))
  6255. {
  6256. SetEntProp(Client, Prop_Send, "m_iFOV", RPGFOV[Client]);
  6257. SetEntProp(Client, Prop_Send, "m_iFOVStart", RPGFOV[Client]);
  6258. if(RPGFOV[Client] && RPGFOV[Client] < 90) ClientCommand(Client, "r_screenoverlay \"%s\"", "Effects/combine_binocoverlay.vmt");
  6259. else ClientCommand(Client, "r_screenoverlay \"\"");
  6260. }
  6261. }
  6262. }
  6263.  
  6264. public Action:AttackDelayed(Handle:timer, any:Client)
  6265. {
  6266. if(JoinCheck(Client) && IsValidEdict(GetEntPropEnt(Client, Prop_Data, "m_hActiveWeapon")))
  6267. {
  6268. new weapons = GetEntPropEnt(Client, Prop_Data, "m_hActiveWeapon");
  6269. decl String:weaponname[64];
  6270. GetEdictClassname(weapons, weaponname, sizeof(weaponname));
  6271. if((StrEqual(weaponname, "weapon_awp", false) || StrEqual(weaponname, "weapon_aug")) && IsValidEdict(weapons))
  6272. {
  6273. AttackDelay[Client] = 1;
  6274. }
  6275. }
  6276. }
  6277.  
  6278. public Action:HealDelay_Timer(Handle:timer, any:Client)
  6279. {
  6280. if(JoinCheck(Client))
  6281. {
  6282. HealDelay[Client] = false;
  6283. }
  6284. }
  6285.  
  6286. public Action:HealSoundDelay_Timer(Handle:timer, any:Client)
  6287. {
  6288. if(JoinCheck(Client))
  6289. {
  6290. HealSoundDelay[Client] = false;
  6291. }
  6292. }
  6293.  
  6294. public Action:DNAScanCheck(Handle:timer, Handle:pack)
  6295. {
  6296. ResetPack(pack);
  6297. new Target = ReadPackCell(pack);
  6298. new Client = ReadPackCell(pack);
  6299. new RagdollEntity = ReadPackCell(pack);
  6300. if(JoinCheck(Client))
  6301. {
  6302. if(DNAScanning[Client])
  6303. {
  6304. if(DNAScanCount[Client] >= 30)
  6305. {
  6306. if(JoinCheck(Target))
  6307. {
  6308. new Float:Pos[3];
  6309. if(IsPlayerAlive(Target)) GetClientAbsOrigin(Target, Pos);
  6310. else GetEntPropVector(EntIndexToEntRef(Ragdoll[Target]), Prop_Send, "m_vecOrigin", Pos);
  6311. Pos[2] += 40.0;
  6312. if(DNASprites[Client] && IsValidEntity(DNASprites[Client]) && IsValidEdict(DNASprites[Client]) && IsValidEntity(info_target[DNASprites[Client]]) && IsValidEdict(info_target[DNASprites[Client]]))
  6313. {
  6314. if(JammerEntity[Target] && IsValidEdict(JammerEntity[Target]) && IsValidEntity(JammerEntity[Target]))
  6315. {
  6316. new Float:entityposition[3];
  6317. GetEntPropVector(JammerEntity[Target], Prop_Send, "m_vecOrigin", entityposition);
  6318. TeleportEntity(info_target[DNASprites[Client]], entityposition, NULL_VECTOR, NULL_VECTOR);
  6319. }
  6320. else
  6321. {
  6322. TeleportEntity(info_target[DNASprites[Client]], Pos, NULL_VECTOR, NULL_VECTOR);
  6323. }
  6324. }
  6325. else
  6326. {
  6327. if(JammerEntity[Target] && IsValidEdict(JammerEntity[Target]) && IsValidEntity(JammerEntity[Target]))
  6328. {
  6329. GetEntPropVector(JammerEntity[Target], Prop_Send, "m_vecOrigin", Pos);
  6330. }
  6331. new sprite = CreateVMT(Client, Pos, "materials/effects/strider_bulge_dudv_DX60.vmt", 0.25, false);
  6332. DNASprites[Client] = sprite;
  6333. SDKHook(sprite, SDKHook_SetTransmit, Hook_SetTransmit2);
  6334. info_target[sprite] = CreateEntityByName("info_target");
  6335. if(DispatchSpawn(info_target[sprite]))
  6336. {
  6337. TeleportEntity(info_target[sprite], Pos, NULL_VECTOR, NULL_VECTOR);
  6338. SetVariantString("!activator");
  6339. AcceptEntityInput(sprite, "SetParent", info_target[sprite], sprite, 0);
  6340. }
  6341. }
  6342. DNAScanCount[Client] = 0;
  6343. }
  6344. else
  6345. {
  6346. if(Job[Client] == detector && Sprites[Client] && IsValidEntity(Sprites[Client]) && IsValidEdict(Sprites[Client]))
  6347. {
  6348. AcceptEntityInput(Sprites[Client], "Kill");
  6349. }
  6350. DNASample[Client][0] = "";
  6351. DNASample[Client][1] = "";
  6352. PrintChat(Client, "\x07C53AC5A person\x07FFFF3A is not in the server.");
  6353. DNAScanning[Client] = false;
  6354. DNAScanTimer[Client] = INVALID_HANDLE;
  6355. return Plugin_Stop;
  6356. }
  6357. }
  6358. else
  6359. {
  6360. if(JoinCheck(Target))
  6361. {
  6362. new Float:Pos[3], Float:Pos2[3];
  6363. GetClientEyePosition(Target, Pos);
  6364. GetClientEyePosition(Client, Pos2);
  6365. if(!IsPlayerAlive(Target))
  6366. {
  6367. GetEntPropVector(Ragdoll[Target], Prop_Send, "m_vecOrigin", Pos);
  6368. }
  6369. if(JammerEntity[Target] && IsValidEdict(JammerEntity[Target]) && IsValidEntity(JammerEntity[Target]))
  6370. {
  6371. GetEntPropVector(JammerEntity[Target], Prop_Send, "m_vecOrigin", Pos);
  6372. }
  6373. if(GetVectorDistance(Pos, Pos2, false) <= 1000.0) DNAScanCount[Client] += 1;
  6374. if(GetVectorDistance(Pos, Pos2, false) <= 750.0) DNAScanCount[Client] += 1;
  6375. if(GetVectorDistance(Pos, Pos2, false) <= 400.0) DNAScanCount[Client] += 1;
  6376. if(GetVectorDistance(Pos, Pos2, false) <= 200.0) DNAScanCount[Client] += 1;
  6377. DNAScanCount[Client] += 1;
  6378. }
  6379. else if(IsValidEdict(RagdollEntity) && IsValidEntity(RagdollEntity))
  6380. {
  6381. new Float:Pos[3], Float:Pos2[3];
  6382. GetClientEyePosition(Client, Pos2);
  6383. GetEntPropVector(RagdollEntity, Prop_Send, "m_vecOrigin", Pos);
  6384. if(GetVectorDistance(Pos, Pos2, false) <= 1000.0) DNAScanCount[Client] += 1;
  6385. if(GetVectorDistance(Pos, Pos2, false) <= 750.0) DNAScanCount[Client] += 1;
  6386. if(GetVectorDistance(Pos, Pos2, false) <= 400.0) DNAScanCount[Client] += 1;
  6387. if(GetVectorDistance(Pos, Pos2, false) <= 200.0) DNAScanCount[Client] += 1;
  6388. DNAScanCount[Client] += 1;
  6389. }
  6390. else
  6391. {
  6392. PrintChat(Client, "Cant find\x07C53AC5DNA\x07FFFF3A.");
  6393. DNAScanning[Client] = false;
  6394. DNAScanTimer[Client] = INVALID_HANDLE;
  6395. return Plugin_Stop;
  6396. }
  6397. }
  6398. }
  6399. else
  6400. {
  6401. DNAScanTimer[Client] = INVALID_HANDLE;
  6402. return Plugin_Stop;
  6403. }
  6404. }
  6405. else
  6406. {
  6407. DNAScanTimer[Client] = INVALID_HANDLE;
  6408. return Plugin_Stop;
  6409. }
  6410. return Plugin_Continue;
  6411. }
  6412.  
  6413. public Action:DeleteEntity(Handle:timer, any:entity)
  6414. {
  6415. if(IsValidEntity(entity) && IsValidEdict(entity))
  6416. {
  6417. new String:classname[32];
  6418. GetEdictClassname(entity, classname, 32);
  6419. if(StrEqual(classname, "hegrenade_projectile", false) || StrContains(classname, "rope", false) != -1) AcceptEntityInput(entity, "Kill");
  6420. }
  6421. }
  6422.  
  6423. public Action:OnTakeDamageHook(Client, &attacker, &inflictor, &Float:damage, &damagetype)
  6424. {
  6425. if(damagetype & DMG_CRUSH && JoinCheck(attacker)) return Plugin_Handled;
  6426. if(!chosen && roundstart)
  6427. {
  6428. return Plugin_Handled;
  6429. }
  6430. if(JoinCheck(Client))
  6431. {
  6432. if(!attacker && KnockBackAttacker[Client])
  6433. {
  6434. attacker = KnockBackAttacker[Client];
  6435. KnockBackAttacker[Client] = 0;
  6436. return Plugin_Changed;
  6437. }
  6438. if(IronShoes[Client] && damagetype & DMG_FALL)
  6439. {
  6440. damage *= 0.3;
  6441. return Plugin_Changed;
  6442. }
  6443. if(damagetype & DMG_BURN)
  6444. {
  6445. if(damage <= 1.0) attacker = BurnOwner[Client];
  6446. damage *= 2.0;
  6447. return Plugin_Changed;
  6448. }
  6449. }
  6450. return Plugin_Continue;
  6451. }
  6452.  
  6453. public Action:OnTraceAttack(Client, &attacker, &inflictor, &Float:damage, &damagetype, &ammotype, hitbox, hitgroup)
  6454. {
  6455. if(JoinCheck(Client) && JoinCheck(attacker))
  6456. {
  6457. if(!chosen && roundstart)
  6458. {
  6459. return Plugin_Handled;
  6460. }
  6461. if(GetClientTeam(Client) == GetClientTeam(attacker))
  6462. {
  6463. damage *= 3.0;
  6464. }
  6465. new String:WeaponName[256];
  6466. GetClientWeapon(attacker, WeaponName, 256);
  6467. if(RoundToNearest(damage) >= 150 && StrEqual(WeaponName, "weapon_knife") && !Dagger[attacker] && !(damagetype & DMG_BLAST))
  6468. {
  6469. new Float:attackerposition[3], Float:clientposition[3], Float:vector[3];
  6470. GetClientEyePosition(Client, clientposition);
  6471. GetClientEyePosition(attacker, attackerposition);
  6472. MakeVectorFromPoints(attackerposition, clientposition, vector);
  6473. NormalizeVector(vector, vector);
  6474. if(SuperCrowbar[attacker]) ScaleVector(vector, 1000.0);
  6475. else ScaleVector(vector, 250.0);
  6476. TeleportEntity(Client, NULL_VECTOR, NULL_VECTOR, vector);
  6477. KnockBackAttacker[Client] = attacker;
  6478. KnockBackAttackerDelay[Client] = 0;
  6479. return Plugin_Handled;
  6480. }
  6481. if(damagetype & DMG_BULLET && !StrEqual(WeaponName, "weapon_awp") && !StrEqual(WeaponName, "weapon_scout") && !StrEqual(WeaponName, "weapon_knife"))
  6482. {
  6483. damage *= 0.7;
  6484. }
  6485. if(damagetype & DMG_BULLET && StrEqual(WeaponName, "weapon_awp"))
  6486. {
  6487. damage *= 0.9;
  6488. if(Silenced_Sniper_Rifle[GetEntPropEnt(attacker, Prop_Data, "m_hActiveWeapon")])
  6489. {
  6490. damage *= 0.55;
  6491. }
  6492. }
  6493. if(StrEqual(WeaponName, "weapon_ump45") && !(damagetype & DMG_BLAST))
  6494. {
  6495. damage *= 0.7;
  6496. }
  6497. if(StrEqual(WeaponName, "weapon_p228") && !(damagetype & DMG_BLAST))
  6498. {
  6499. IgniteEntity(Client, 4.0, false, 3.0, false);
  6500. BurnOwner[Client] = attacker;
  6501. return Plugin_Handled;
  6502. }
  6503. if(StrEqual(WeaponName, "weapon_elite") && !(damagetype & DMG_BLAST))
  6504. {
  6505. if(hitgroup == 1) damage *= 0.65;
  6506. damage *= 0.85;
  6507. }
  6508. if(StrEqual(WeaponName, "weapon_usp") && !(damagetype & DMG_BLAST))
  6509. {
  6510. if(hitgroup != 1) damage += 17.5;
  6511. }
  6512. if(StrEqual(WeaponName, "weapon_tmp") && !(damagetype & DMG_BLAST))
  6513. {
  6514. if(TVirus[GetEntPropEnt(attacker, Prop_Data, "m_hActiveWeapon")])
  6515. {
  6516. if(TVirusTimer[Client] == INVALID_HANDLE)
  6517. {
  6518. CreateTimer(20.0, GreenFade, Client);
  6519. new Handle:pack = CreateDataPack();
  6520. WritePackCell(pack, Client);
  6521. WritePackCell(pack, attacker);
  6522. TVirusTimer[Client] = CreateTimer(25.0, YouAreZombie, pack, TIMER_DATA_HNDL_CLOSE);
  6523. }
  6524. return Plugin_Handled;
  6525. }
  6526. }
  6527. if(GetEntProp(Client, Prop_Data, "m_ArmorValue"))
  6528. {
  6529. if(damagetype & DMG_BULLET && !StrEqual(WeaponName, "weapon_knife"))
  6530. {
  6531. damage *= 0.9;
  6532. }
  6533. }
  6534. if(StrEqual(WeaponName, "weapon_knife") && !(damagetype & DMG_BLAST))
  6535. {
  6536. if(Dagger[attacker])
  6537. {
  6538. damage = 500.0;
  6539. }
  6540. else if(SuperCrowbar[attacker])
  6541. {
  6542. damage *= 2.0;
  6543. }
  6544. }
  6545. if(StrEqual(WeaponName, "weapon_deagle") && !(damagetype & DMG_BLAST))
  6546. {
  6547. new weapons = GetPlayerWeaponSlot(attacker, 1);
  6548. if(GoldenGun[weapons])
  6549. {
  6550. if(Job[Client] == traitor && !StrEqual(TraitorKillList[Client], ""))
  6551. {
  6552. new Float:Position[3];
  6553. makeDamage(attacker, Client, 500, DMG_BULLET, 0.0, Position, "GoldenGun");
  6554. return Plugin_Handled;
  6555. }
  6556. else damage = 0.0;
  6557. }
  6558. }
  6559. if(Client != attacker) LastAttacker = attacker;
  6560. return Plugin_Changed;
  6561. }
  6562. return Plugin_Continue;
  6563. }
  6564.  
  6565. public Action:RagdollTakeDamageHook(ragdoll, &attacker, &inflictor, &Float:damage, &damagetype)
  6566. {
  6567. if(IsValidEntity(ragdoll) && IsValidEdict(ragdoll))
  6568. {
  6569. if(JoinCheck(attacker))
  6570. {
  6571. new String:Weaponname[256];
  6572. GetClientWeapon(attacker, Weaponname, 256);
  6573. if(StrEqual(Weaponname, "weapon_p228", false))
  6574. {
  6575. //AcceptEntityInput(ragdoll, "Ignite");
  6576. new Float:rand = GetRandomFloat(2.0, 3.0);
  6577. IgniteEntity(ragdoll, rand, _, 5.0);
  6578. CreateTimer(rand, RemoveRagdoll, ragdoll);
  6579. }
  6580. for(new i; i<4; i++)
  6581. {
  6582. if(Wire[ragdoll][i][0] && Wire[ragdoll][i][1] && Wire[ragdoll][i][2] && IsValidEdict(Wire[ragdoll][i][1]) && IsValidEdict(Wire[ragdoll][i][2]))
  6583. {
  6584. AcceptEntityInput(Wire[ragdoll][i][0], "Kill");
  6585. AcceptEntityInput(Wire[ragdoll][i][1], "Break");
  6586. AcceptEntityInput(Wire[ragdoll][i][2], "Break");
  6587. CreateTimer(1.0, DeleteEntity, Wire[ragdoll][i][1]);
  6588. CreateTimer(1.0, DeleteEntity, Wire[ragdoll][i][2]);
  6589. IsRope[Wire[ragdoll][i][1]] = false;
  6590. IsRope[Wire[ragdoll][i][2]] = false;
  6591. Wire[ragdoll][i][0] = 0;
  6592. Wire[ragdoll][i][1] = 0;
  6593. Wire[ragdoll][i][2] = 0;
  6594. }
  6595. }
  6596. }
  6597. }
  6598. else SDKUnhook(ragdoll, SDKHook_OnTakeDamage, RagdollTakeDamageHook);
  6599. return Plugin_Continue;
  6600. }
  6601.  
  6602. public Action:ZombieDamageHook(monster, &attacker, &inflictor, &Float:damage, &damagetype)
  6603. {
  6604. decl String:tmp[32];
  6605. GetEntPropString(monster, Prop_Data, "m_iName", tmp, sizeof(tmp));
  6606. new monster_tmp = StringToInt(tmp);
  6607. new Roll = GetRandomInt(1, 3);
  6608. if(Roll == 1) SetVariantString("FlinchC");
  6609. if(Roll == 2) SetVariantString("FlinchL");
  6610. else SetVariantString("FlinchR");
  6611. AcceptEntityInput(monster_tmp, "SetAnimation");
  6612.  
  6613. decl String:soundfile[32], bool:check;
  6614. Format(soundfile, sizeof(soundfile), "npc/zombie/zombie_pain%i.wav", GetRandomInt(1, 6));
  6615. if(JoinCheck(attacker))
  6616. {
  6617. new weapons = GetEntPropEnt(attacker, Prop_Data, "m_hActiveWeapon"), String:WeaponName[256];
  6618. if(weapons != -1) GetEdictClassname(weapons, WeaponName, 256);
  6619. if(StrEqual(WeaponName, "weapon_knife") && !(damagetype & DMG_BLAST))
  6620. {
  6621. if(Dagger[attacker])
  6622. {
  6623. damage = 9999.0;
  6624. check = true;
  6625. }
  6626. }
  6627. }
  6628. if(BaseNPC_Hurt(monster, attacker, RoundToZero(damage), soundfile))
  6629. {
  6630. if(Dagger[attacker] && check)
  6631. {
  6632. Dagger[attacker] = false;
  6633. new weapons = GetPlayerWeaponSlot(attacker, 2);
  6634. if(IsValidEdict(weapons))
  6635. {
  6636. RemovePlayerItem(attacker, weapons);
  6637. RemoveEdict(weapons);
  6638. }
  6639. GivePlayerItem(attacker, "weapon_knife");
  6640. }
  6641. SDKUnhook(monster, SDKHook_OnTakeDamage, ZombieDamageHook);
  6642.  
  6643. BaseNPC_Death(monster);
  6644.  
  6645. decl Float:position[3];
  6646. GetEntPropVector(monster, Prop_Send, "m_vecOrigin", position);
  6647. EmitSoundToAll("npc/zombie/zombie_die1.wav", 0, SNDCHAN_AUTO, SNDLEVEL_NORMAL, SND_NOFLAGS, SNDVOL_NORMAL, SNDPITCH_NORMAL, -1, position);
  6648. }
  6649.  
  6650. return Plugin_Handled;
  6651. }
  6652.  
  6653. public Action:RemoveRagdoll(Handle:timer, any:ragdoll)
  6654. {
  6655. if(IsValidEdict(ragdoll) && IsValidEntity(ragdoll))
  6656. {
  6657. new Float:entityposition[3];
  6658. GetEntPropVector(ragdoll, Prop_Send, "m_vecOrigin", entityposition);
  6659. //AcceptEntityInput(ragdoll, "Kill");
  6660. IsRagdoll[ragdoll] = false;
  6661. SetEntityRenderMode(ragdoll, RENDER_TRANSCOLOR);
  6662. SetEntityRenderColor(ragdoll, 255, 255, 255, 0);
  6663. SetEntProp(ragdoll, Prop_Send, "m_CollisionGroup", 1);
  6664. SetEntProp(ragdoll, Prop_Send, "m_nSolidType", 0);
  6665. SDKUnhook(ragdoll, SDKHook_OnTakeDamage, RagdollTakeDamageHook);
  6666. makeExplosion(ragdoll, ragdoll, entityposition, "ragdoll_remove", 0, 0, 0.0, 0x00000004|0x00000008|0x00000020|0x00000100|0x00000200);
  6667. }
  6668. }
  6669.  
  6670. public Action:GreenFade(Handle:timer, any:Client)
  6671. {
  6672. if(JoinCheck(Client) && IsPlayerAlive(Client) && (chosen || !roundstart))
  6673. {
  6674. LastFadeTime[Client] = GetEngineTime();
  6675. IsInfect[Client] = true;
  6676. PerformFade(Client, 2500, {0, 255, 0, 255});
  6677. }
  6678. }
  6679.  
  6680. public Action:YouAreZombie(Handle:timer, Handle:pack)
  6681. {
  6682. ResetPack(pack);
  6683. new Client = ReadPackCell(pack);
  6684. new attacker = ReadPackCell(pack);
  6685. if(JoinCheck(Client) && IsPlayerAlive(Client) && JoinCheck(attacker))
  6686. {
  6687. ChosenJoin[Client] = true;
  6688. new Float:Position[3];
  6689. makeDamage(attacker, Client, 777, (1<<17), 1.0, Position, "T-Virus");
  6690. makeZombie(Client);
  6691. Format(TraitorKillList[attacker], 256, "%s\n%N", TraitorKillList[attacker], Client);
  6692. Time2 += 20;
  6693. EmitSoundToAll("tttmusic/biohazard_detected.wav");
  6694. if(Job[Client] == detector)
  6695. {
  6696. for(new i = 1; i <= MaxClients; i++)
  6697. {
  6698. if(IsClientInGame(i))
  6699. {
  6700. if(Job[i] == traitor && IsPlayerAlive(i))
  6701. {
  6702. Credit[i] += 1;
  6703. PrintChat(i, "\x0787CEEB%T", "received credit for killing", i, JobName[Job[i]], i);
  6704. }
  6705. }
  6706. }
  6707. }
  6708. }
  6709. TVirusTimer[Client] = INVALID_HANDLE;
  6710. }
  6711.  
  6712. public CreditShop(Client)
  6713. {
  6714. new Handle:menuhandle = CreateMenu(CreditShop_CallBack);
  6715. SetMenuTitle(menuhandle, "-- %T --", "Credit Shop", Client);
  6716. new String:Translate_Formatting[256];
  6717. Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Body Armor", Client, "Passive Equipment", Client, "Armor Description", Client, 1, "Credit", Client);
  6718. if(GetEntProp(Client, Prop_Data, "m_ArmorValue")) AddMenuItem(menuhandle, "Body Armor", Translate_Formatting, ITEMDRAW_DISABLED);
  6719. else AddMenuItem(menuhandle, "Body Armor", Translate_Formatting);
  6720. AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  6721. AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  6722. Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Iron Shoes", Client, "Passive Equipment", Client, "Iron Shoes Description", Client, 1, "Credit", Client);
  6723. if(IronShoes[Client]) AddMenuItem(menuhandle, "Iron Shoes", Translate_Formatting, ITEMDRAW_DISABLED);
  6724. else AddMenuItem(menuhandle, "Iron Shoes", Translate_Formatting);
  6725. AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  6726. AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  6727. if(Dagger[Client] || SuperCrowbar[Client])
  6728. {
  6729. Format(Translate_Formatting, 256, "%T - %T(%T)\n%T\n%i%T", "Knife", Client, "Weapon", Client, "already have knife type", Client, "Knife Description", Client, 1, "Credit", Client);
  6730. AddMenuItem(menuhandle, "Knife", Translate_Formatting, ITEMDRAW_DISABLED);
  6731. }
  6732. else if(BuyDagger[Client])
  6733. {
  6734. Format(Translate_Formatting, 256, "%T - %T(%T)\n%T\n%i%T", "Knife", Client, "Weapon", Client, "No Stock", Client, "Knife Description", Client, 1, "Credit", Client);
  6735. AddMenuItem(menuhandle, "Knife", Translate_Formatting, ITEMDRAW_DISABLED);
  6736. }
  6737. else
  6738. {
  6739. Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Knife", Client, "Weapon", Client, "Knife Description", Client, 1, "Credit", Client);
  6740. AddMenuItem(menuhandle, "Knife", Translate_Formatting);
  6741. }
  6742. Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Dual Elite", Client, "Weapon", Client, "Dual Elite Description", Client, 1, "Credit", Client);
  6743. AddMenuItem(menuhandle,"Dual Elite", Translate_Formatting);
  6744. AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  6745. AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  6746. Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Health Station", Client, "Active Equipment", Client, "Health Station Description", Client, 1, "Credit", Client);
  6747. AddMenuItem(menuhandle, "Health Station", Translate_Formatting);
  6748. AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  6749. AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  6750. if(Radar[Client])
  6751. {
  6752. Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Radar", Client, "Passive Equipment", Client, "Radar Description", Client, 1, "Credit", Client);
  6753. AddMenuItem(menuhandle, "Radar", Translate_Formatting, ITEMDRAW_DISABLED);
  6754. }
  6755. else
  6756. {
  6757. Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Radar", Client, "Passive Equipment", Client, "Radar Description", Client, 1, "Credit", Client);
  6758. AddMenuItem(menuhandle, "Radar", Translate_Formatting);
  6759. }
  6760. if(SpeedBoots[Client])
  6761. {
  6762. Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Speed Boots", Client, "Passive Equipment", Client, "Speed Boots Description", Client, 1, "Credit", Client);
  6763. AddMenuItem(menuhandle, "Speed Boots", Translate_Formatting, ITEMDRAW_DISABLED);
  6764. }
  6765. else
  6766. {
  6767. Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Speed Boots", Client, "Passive Equipment", Client, "Speed Boots Description", Client, 1, "Credit", Client);
  6768. AddMenuItem(menuhandle, "Speed Boots", Translate_Formatting);
  6769. }
  6770. AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  6771. AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  6772. if(Job[Client] == detector)
  6773. {
  6774. if(chosen && Time1 > 165)
  6775. {
  6776. Format(Translate_Formatting, 256, "%T - %T(%T)\n%T\n%i%T", "Golden Gun", Client, "Weapon", Client, "not arrived", Client, "Golden Gun Description", Client, 1, "Credit", Client);
  6777. AddMenuItem(menuhandle, "Golden Gun", Translate_Formatting, ITEMDRAW_DISABLED);
  6778. }
  6779. else if(!BuyGoldenGun[Client])
  6780. {
  6781. Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Golden Gun", Client, "Weapon", Client, "Golden Gun Description", Client, 1, "Credit", Client);
  6782. AddMenuItem(menuhandle, "Golden Gun", Translate_Formatting);
  6783. }
  6784. else
  6785. {
  6786. Format(Translate_Formatting, 256, "%T - %T(%T)\n%T\n%i%T", "Golden Gun", Client, "Weapon", Client, "No Stock", Client, "Golden Gun Description", Client, 1, "Credit", Client);
  6787. AddMenuItem(menuhandle, "Golden Gun", Translate_Formatting, ITEMDRAW_DISABLED);
  6788. }
  6789. AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  6790. AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  6791. if(!BuySG552[Client])
  6792. {
  6793. Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "SG552", Client, "Weapon", Client, "SG552 Description", Client, 1, "Credit", Client);
  6794. AddMenuItem(menuhandle, "SG552", Translate_Formatting);
  6795. }
  6796. else
  6797. {
  6798. Format(Translate_Formatting, 256, "%T - %T(%T)\n%T\n%i%T", "SG552", Client, "Weapon", Client, "No Stock", Client, "SG552 Description", Client, 1, "Credit", Client);
  6799. AddMenuItem(menuhandle, "SG552", Translate_Formatting, ITEMDRAW_DISABLED);
  6800. }
  6801. if(!BuyTeleporter[Client])
  6802. {
  6803. Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Teleporter", Client, "Weapon", Client, "Teleporter Description", Client, 1, "Credit", Client);
  6804. AddMenuItem(menuhandle,"Teleporter", Translate_Formatting);
  6805. }
  6806. else
  6807. {
  6808. Format(Translate_Formatting, 256, "%T - %T(%T)\n%T\n%i%T", "Teleporter", Client, "Weapon", Client, "No Stock", Client, "Teleporter Description", Client, 1, "Credit", Client);
  6809. AddMenuItem(menuhandle,"Teleporter", Translate_Formatting, ITEMDRAW_DISABLED);
  6810. }
  6811. AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  6812. AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  6813. if(!BuyCrossbow[Client])
  6814. {
  6815. //Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Crossbow", Client, "Weapon", Client, "Crossbow Description", Client, 1, "Credit", Client);
  6816. Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Crossbow", Client, "Weapon", Client, "Crossbow Description", Client, 1, "Credit", Client);
  6817. AddMenuItem(menuhandle,"Crossbow", Translate_Formatting);
  6818. }
  6819. else
  6820. {
  6821. //Format(Translate_Formatting, 256, "%T - %T(%T)\n%T\n%i%T", "Crossbow", Client, "Weapon", Client, "No Stock", Client, "Crossbow Description", Client, 1, "Credit", Client);
  6822. Format(Translate_Formatting, 256, "%T - %T(%T)\n%T\n%i%T", "Crossbow", Client, "Weapon", Client, "No Stock", Client, "Crossbow Description", Client, 1, "Credit", Client);
  6823. AddMenuItem(menuhandle,"Crossbow", Translate_Formatting, ITEMDRAW_DISABLED);
  6824. }
  6825. AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  6826. AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  6827. if(!BuyUMP[Client])
  6828. {
  6829. Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "UMP", Client, "Weapon", Client, "UMP Description", Client, 1, "Credit", Client);
  6830. AddMenuItem(menuhandle,"UMP", Translate_Formatting);
  6831. }
  6832. else
  6833. {
  6834. Format(Translate_Formatting, 256, "%T - %T(%T)\n%T\n%i%T", "UMP", Client, "Weapon", Client, "No Stock", Client, "UMP Description", Client, 1, "Credit", Client);
  6835. AddMenuItem(menuhandle,"UMP", Translate_Formatting, ITEMDRAW_DISABLED);
  6836. }
  6837. }
  6838. if(Job[Client] == traitor)
  6839. {
  6840. if(!BuyRPG[Client])
  6841. {
  6842. Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "RPG-7", Client, "Weapon", Client, "RPG-7 Description", Client, 1, "Credit", Client);
  6843. AddMenuItem(menuhandle, "RPG-7", Translate_Formatting);
  6844. }
  6845. else
  6846. {
  6847. Format(Translate_Formatting, 256, "%T - %T(%T)\n%T\n%i%T", "RPG-7", Client, "Weapon", Client, "No Stock", Client, "RPG-7 Description", Client, 1, "Credit", Client);
  6848. AddMenuItem(menuhandle,"RPG-7", Translate_Formatting, ITEMDRAW_DISABLED);
  6849. }
  6850. AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  6851. AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  6852. Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Silenced Pistol", Client, "Weapon", Client, "Silenced Pistol Description", Client, 1, "Credit", Client);
  6853. AddMenuItem(menuhandle,"Silenced Pistol", Translate_Formatting);
  6854. Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "AWP", Client, "Weapon", Client, "AWP Description", Client, 1, "Credit", Client);
  6855. AddMenuItem(menuhandle,"AWP", Translate_Formatting);
  6856. AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  6857. AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  6858. Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Flare Gun", Client, "Weapon", Client, "Flare Gun Description", Client, 1, "Credit", Client);
  6859. AddMenuItem(menuhandle,"Flare Gun", Translate_Formatting);
  6860. AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  6861. AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  6862. Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Jihad", Client, "Passive Equipment", Client, "Jihad Description", Client, 1, "Credit", Client);
  6863. AddMenuItem(menuhandle,"Jihad", Translate_Formatting);
  6864. Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Fake Health Station", Client, "Active Equipment", Client, "Fake Health Station Description", Client, 1, "Credit", Client);
  6865. AddMenuItem(menuhandle, "Fake Health Station", Translate_Formatting);
  6866. AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  6867. AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  6868. if(Dagger[Client] || SuperCrowbar[Client])
  6869. {
  6870. Format(Translate_Formatting, 256, "%T - %T(%T)\n%T\n%i%T", "Super Crowbar", Client, "Weapon", Client, "already have knife type", Client, "Super Crowbar Description", Client, 1, "Credit", Client);
  6871. AddMenuItem(menuhandle, "Super Crowbar", Translate_Formatting, ITEMDRAW_DISABLED);
  6872. }
  6873. else
  6874. {
  6875. Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Super Crowbar", Client, "Weapon", Client, "Super Crowbar Description", Client, 1, "Credit", Client);
  6876. AddMenuItem(menuhandle, "Super Crowbar", Translate_Formatting);
  6877. }
  6878. AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  6879. AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  6880. if(!Disguise[Client])
  6881. {
  6882. Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Disguise", Client, "Active Equipment", Client, "Disguise Description", Client, 1, "Credit", Client);
  6883. AddMenuItem(menuhandle, "Disguise", Translate_Formatting);
  6884. }
  6885. else
  6886. {
  6887. Format(Translate_Formatting, 256, "%T - %T(%T)\n%T\n%i%T", "Disguise", Client, "Active Equipment", Client, "You already have", Client, "Disguise Description", Client, 1, "Credit", Client);
  6888. AddMenuItem(menuhandle, "Disguise", Translate_Formatting, ITEMDRAW_DISABLED);
  6889. }
  6890. if(JammerEntity[Client] && IsValidEdict(JammerEntity[Client]) && IsValidEntity(JammerEntity[Client]))
  6891. {
  6892. Format(Translate_Formatting, 256, "%T - %T(%T)\n%T\n%i%T", "Jammer", Client, "Active Equipment", Client, "You already active", Client, "Jammer Description", Client, 1, "Credit", Client);
  6893. AddMenuItem(menuhandle, "Jammer", Translate_Formatting, ITEMDRAW_DISABLED);
  6894. }
  6895. else
  6896. {
  6897. Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Jammer", Client, "Active Equipment", Client, "Jammer Description", Client, 1, "Credit", Client);
  6898. AddMenuItem(menuhandle, "Jammer", Translate_Formatting);
  6899. }
  6900. AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  6901. AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  6902. if(!BuyTVirus[Client])
  6903. {
  6904. Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "T-Virus", Client, "Weapon", Client, "T-Virus Description", Client, 1, "Credit", Client);
  6905. AddMenuItem(menuhandle,"T-Virus", Translate_Formatting);
  6906. }
  6907. else
  6908. {
  6909. Format(Translate_Formatting, 256, "%T - %T(%T)\n%T\n%i%T", "T-Virus", Client, "Weapon", Client, "No Stock", Client, "T-Virus Description", Client, 1, "Credit", Client);
  6910. AddMenuItem(menuhandle,"T-Virus", Translate_Formatting, ITEMDRAW_DISABLED);
  6911. }
  6912. AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  6913. AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  6914. if(!BuyTeleporter[Client])
  6915. {
  6916. Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Teleporter", Client, "Weapon", Client, "Teleporter Description", Client, 1, "Credit", Client);
  6917. AddMenuItem(menuhandle,"Teleporter", Translate_Formatting);
  6918. }
  6919. else
  6920. {
  6921. Format(Translate_Formatting, 256, "%T - %T(%T)\n%T\n%i%T", "Teleporter", Client, "Weapon", Client, "No Stock", Client, "Teleporter Description", Client, 1, "Credit", Client);
  6922. AddMenuItem(menuhandle,"Teleporter", Translate_Formatting, ITEMDRAW_DISABLED);
  6923. }
  6924. Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Silenced Sniper Rifle", Client, "Weapon", Client, "Silenced Sniper Rifle Description", Client, 1, "Credit", Client);
  6925. AddMenuItem(menuhandle,"Silenced Sniper Rifle", Translate_Formatting);
  6926. }
  6927. SetMenuExitButton(menuhandle, true);
  6928. DisplayMenu(menuhandle, Client, 10);
  6929. }
  6930.  
  6931. public CreditShop_CallBack(Handle:menu, MenuAction:action, Client, select)
  6932. {
  6933. if(action == MenuAction_Select)
  6934. {
  6935. new String:info[256], String:Translate_Formatting[256], bool:bought;
  6936. GetMenuItem(menu, select, info, 256);
  6937. CreateTimer(0.0, AcceptWeaponUse, Client);
  6938. BlockWeaponUse[Client] = true;
  6939. new weapon = GetEntPropEnt(Client, Prop_Data, "m_hActiveWeapon");
  6940. if(StrEqual(info, "Golden Gun", false))
  6941. {
  6942. if(Credit[Client] >= 1)
  6943. {
  6944. Credit[Client] -= 1;
  6945. bought = true;
  6946. if(weapon == GetPlayerWeaponSlot(Client, 1)) BlockWeaponUse[Client] = false;
  6947. new weapons = GetPlayerWeaponSlot(Client, 1);
  6948. if(IsValidEdict(weapons))
  6949. {
  6950. RemovePlayerItem(Client, weapons);
  6951. RemoveEdict(weapons);
  6952. }
  6953. weapons = GivePlayerItem(Client, "weapon_deagle");
  6954. SDKHook(weapons, SDKHook_Think, WeaponWorldModelThink);
  6955. GoldenGun[weapons] = true;
  6956. BuyGoldenGun[Client] = true;
  6957. SetEntProp(weapons, Prop_Send, "m_iClip1", 1);
  6958. SetEntProp(weapons, Prop_Send, "m_iPrimaryAmmoType", 0);
  6959. }
  6960. else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
  6961. }
  6962. if(StrEqual(info, "Body Armor", false))
  6963. {
  6964. if(Credit[Client] >= 1)
  6965. {
  6966. Credit[Client] -= 1;
  6967. bought = true;
  6968. SetEntProp(Client, Prop_Data, "m_ArmorValue", 9999);
  6969. }
  6970. else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
  6971. }
  6972. if(StrEqual(info, "Iron Shoes", false))
  6973. {
  6974. if(Credit[Client] >= 1)
  6975. {
  6976. Credit[Client] -= 1;
  6977. bought = true;
  6978. IronShoes[Client] = true;
  6979. }
  6980. else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
  6981. }
  6982. if(StrEqual(info, "Speed Boots", false))
  6983. {
  6984. if(Credit[Client] >= 1)
  6985. {
  6986. Credit[Client] -= 1;
  6987. bought = true;
  6988. SpeedBoots[Client] = true;
  6989. }
  6990. else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
  6991. }
  6992. if(StrEqual(info, "Radar", false))
  6993. {
  6994. if(Credit[Client] >= 1)
  6995. {
  6996. Credit[Client] -= 1;
  6997. bought = true;
  6998. Radar[Client] = true;
  6999. RadarCount[Client] = 0;
  7000. }
  7001. else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
  7002. }
  7003. if(StrEqual(info, "Knife", false))
  7004. {
  7005. if(Credit[Client] >= 1)
  7006. {
  7007. Credit[Client] -= 1;
  7008. bought = true;
  7009. if(weapon == GetPlayerWeaponSlot(Client, 2)) BlockWeaponUse[Client] = false;
  7010. BuyDagger[Client] = true;
  7011. Dagger[Client] = true;
  7012. new weapons = GetPlayerWeaponSlot(Client, 2);
  7013. if(IsValidEdict(weapons))
  7014. {
  7015. RemovePlayerItem(Client, weapons);
  7016. RemoveEdict(weapons);
  7017. }
  7018. GivePlayerItem(Client, "weapon_knife");
  7019. }
  7020. else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
  7021. }
  7022. if(StrEqual(info, "Dual Elite", false))
  7023. {
  7024. if(Credit[Client] >= 1)
  7025. {
  7026. Credit[Client] -= 1;
  7027. bought = true;
  7028. if(weapon == GetPlayerWeaponSlot(Client, 1)) BlockWeaponUse[Client] = false;
  7029. new weapons = GetPlayerWeaponSlot(Client, 1);
  7030. if(IsValidEdict(weapons))
  7031. {
  7032. RemovePlayerItem(Client, weapons);
  7033. RemoveEdict(weapons);
  7034. }
  7035. weapons = GivePlayerItem(Client, "weapon_elite");
  7036. }
  7037. else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
  7038. }
  7039. if(StrEqual(info, "AWP", false))
  7040. {
  7041. if(Credit[Client] >= 1)
  7042. {
  7043. Credit[Client] -= 1;
  7044. bought = true;
  7045. if(weapon == GetPlayerWeaponSlot(Client, 0)) BlockWeaponUse[Client] = false;
  7046. BuyAcceptWeapon[Client] = true;
  7047. new weapons = GetPlayerWeaponSlot(Client, 0);
  7048. if(IsValidEdict(weapons))
  7049. {
  7050. RemovePlayerItem(Client, weapons);
  7051. RemoveEdict(weapons);
  7052. }
  7053. weapons = GivePlayerItem(Client, "weapon_awp");
  7054. RPG[weapons] = false;
  7055. SetEntProp(weapons, Prop_Send, "m_iClip1", 5);
  7056. SetEntProp(weapons, Prop_Send, "m_iPrimaryAmmoType", 0);
  7057. }
  7058. else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
  7059. }
  7060. if(StrEqual(info, "SG552", false))
  7061. {
  7062. if(Credit[Client] >= 1)
  7063. {
  7064. Credit[Client] -= 1;
  7065. bought = true;
  7066. if(weapon == GetPlayerWeaponSlot(Client, 0)) BlockWeaponUse[Client] = false;
  7067. BuyAcceptWeapon[Client] = true;
  7068. new weapons = GetPlayerWeaponSlot(Client, 0);
  7069. if(IsValidEdict(weapons))
  7070. {
  7071. RemovePlayerItem(Client, weapons);
  7072. RemoveEdict(weapons);
  7073. }
  7074. weapons = GivePlayerItem(Client, "weapon_sg552");
  7075. BuySG552[Client] = true;
  7076. SetEntProp(weapons, Prop_Send, "m_iClip1", 60);
  7077. SetEntProp(weapons, Prop_Send, "m_iPrimaryAmmoType", 0);
  7078. }
  7079. else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
  7080. }
  7081. if(StrEqual(info, "RPG-7", false))
  7082. {
  7083. if(Credit[Client] >= 1)
  7084. {
  7085. Credit[Client] -= 1;
  7086. bought = true;
  7087. if(weapon == GetPlayerWeaponSlot(Client, 0)) BlockWeaponUse[Client] = false;
  7088. BuyAcceptWeapon[Client] = true;
  7089. new weapons = GetPlayerWeaponSlot(Client, 0);
  7090. if(IsValidEdict(weapons))
  7091. {
  7092. RemovePlayerItem(Client, weapons);
  7093. RemoveEdict(weapons);
  7094. }
  7095. weapons = GivePlayerItem(Client, "weapon_awp");
  7096. SDKHook(weapons, SDKHook_Think, WeaponWorldModelThink);
  7097. RPG[weapons] = true;
  7098. SetEntProp(weapons, Prop_Send, "m_iClip1", 1);
  7099. new Handle:pack = CreateDataPack();
  7100. WritePackCell(pack, Client);
  7101. WritePackCell(pack, 1);
  7102. WritePackCell(pack, weapons);
  7103. CreateTimer(0.0, SetClientiClip2_Pre, pack, TIMER_DATA_HNDL_CLOSE);
  7104. RPGFOV[Client] = 90;
  7105. BuyRPG[Client] = true;
  7106. CreateTimer(1.0, AttackDelayed, Client);
  7107. }
  7108. else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
  7109. }
  7110. if(StrEqual(info, "Silenced Pistol", false))
  7111. {
  7112. if(Credit[Client] >= 1)
  7113. {
  7114. Credit[Client] -= 1;
  7115. bought = true;
  7116. if(weapon == GetPlayerWeaponSlot(Client, 1)) BlockWeaponUse[Client] = false;
  7117. new weapons = GetPlayerWeaponSlot(Client, 1);
  7118. if(IsValidEdict(weapons))
  7119. {
  7120. RemovePlayerItem(Client, weapons);
  7121. RemoveEdict(weapons);
  7122. }
  7123. weapons = GivePlayerItem(Client, "weapon_usp");
  7124. }
  7125. else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
  7126. }
  7127. if(StrEqual(info, "Flare Gun", false))
  7128. {
  7129. if(Credit[Client] >= 1)
  7130. {
  7131. Credit[Client] -= 1;
  7132. bought = true;
  7133. if(weapon == GetPlayerWeaponSlot(Client, 1)) BlockWeaponUse[Client] = false;
  7134. new weapons = GetPlayerWeaponSlot(Client, 1);
  7135. if(IsValidEdict(weapons))
  7136. {
  7137. RemovePlayerItem(Client, weapons);
  7138. RemoveEdict(weapons);
  7139. }
  7140. weapons = GivePlayerItem(Client, "weapon_p228");
  7141. SDKHook(weapons, SDKHook_Think, WeaponWorldModelThink);
  7142. SetEntProp(weapons, Prop_Send, "m_iClip1", 4);
  7143. SendProxy_Hook(weapons, "m_iClip1", Prop_Int, Silenced_Think);
  7144. }
  7145. else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
  7146. }
  7147. if(StrEqual(info, "Jihad", false))
  7148. {
  7149. if(!IsJihad[Client])
  7150. {
  7151. if(Credit[Client] >= 1)
  7152. {
  7153. Credit[Client] -= 1;
  7154. bought = true;
  7155. new weapons = GivePlayerItem(Client, "weapon_smokegrenade");
  7156. Jihad[weapons] = true;
  7157. SDKHook(weapons, SDKHook_Think, WeaponWorldModelThink);
  7158. }
  7159. else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
  7160. }
  7161. else PrintChat(Client, "\x05%T", "Jihad was already started", Client);
  7162. }
  7163. if(StrEqual(info, "Super Crowbar", false))
  7164. {
  7165. if(Credit[Client] >= 1)
  7166. {
  7167. Credit[Client] -= 1;
  7168. bought = true;
  7169. SuperCrowbar[Client] = true;
  7170. }
  7171. else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
  7172. }
  7173. if(StrEqual(info, "Disguise", false))
  7174. {
  7175. if(Credit[Client] >= 1)
  7176. {
  7177. Credit[Client] -= 1;
  7178. bought = true;
  7179. Disguise[Client] = true;
  7180. PrintChat(Client, "Use 'H' Key");
  7181. }
  7182. else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
  7183. }
  7184. if(StrEqual(info, "Jammer", false))
  7185. {
  7186. if(Credit[Client] >= 1)
  7187. {
  7188. Credit[Client] -= 1;
  7189. bought = true;
  7190. new weapons = GivePlayerItem(Client, "weapon_smokegrenade");
  7191. DNASignalJammer[weapons] = true;
  7192. }
  7193. else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
  7194. }
  7195. if(StrEqual(info, "T-Virus", false))
  7196. {
  7197. if(Credit[Client] >= 1)
  7198. {
  7199. Credit[Client] -= 1;
  7200. bought = true;
  7201. if(weapon == GetPlayerWeaponSlot(Client, 0)) BlockWeaponUse[Client] = false;
  7202. BuyAcceptWeapon[Client] = true;
  7203. new weapons = GetPlayerWeaponSlot(Client, 0);
  7204. if(IsValidEdict(weapons))
  7205. {
  7206. RemovePlayerItem(Client, weapons);
  7207. RemoveEdict(weapons);
  7208. }
  7209. weapons = GivePlayerItem(Client, "weapon_tmp");
  7210. BuyTVirus[Client] = true;
  7211. TVirus[weapons] = true;
  7212. SetEntProp(weapons, Prop_Send, "m_iClip1", 1);
  7213. SetEntProp(weapons, Prop_Send, "m_iPrimaryAmmoType", 0);
  7214. }
  7215. else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
  7216. }
  7217. if(StrEqual(info, "Teleporter", false))
  7218. {
  7219. if(Credit[Client] >= 1)
  7220. {
  7221. Credit[Client] -= 1;
  7222. bought = true;
  7223. new weapons = GivePlayerItem(Client, "weapon_hegrenade");
  7224. BuyTeleporter[Client] = true;
  7225. TeleporterSavedPosition[Client] = false;
  7226. Teleporter[weapons] = true;
  7227. TeleporterDelay[Client] = false;
  7228. TeleportCount[weapons] = 8;
  7229. SDKHook(weapons, SDKHook_Think, WeaponWorldModelThink);
  7230. }
  7231. else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
  7232. }
  7233. if(StrEqual(info, "Crossbow", false))
  7234. {
  7235. if(Credit[Client] >= 1)
  7236. {
  7237. Credit[Client] -= 1;
  7238. bought = true;
  7239. if(weapon == GetPlayerWeaponSlot(Client, 0)) BlockWeaponUse[Client] = false;
  7240. BuyAcceptWeapon[Client] = true;
  7241. new weapons = GetPlayerWeaponSlot(Client, 0);
  7242. if(IsValidEdict(weapons))
  7243. {
  7244. RemovePlayerItem(Client, weapons);
  7245. RemoveEdict(weapons);
  7246. }
  7247. weapons = GivePlayerItem(Client, "weapon_aug");
  7248. SDKHook(weapons, SDKHook_Think, WeaponWorldModelThink);
  7249. Crossbow[weapons] = true;
  7250. SetEntProp(weapons, Prop_Send, "m_iClip1", 1);
  7251. new Handle:pack = CreateDataPack();
  7252. WritePackCell(pack, Client);
  7253. WritePackCell(pack, 20);
  7254. WritePackCell(pack, weapons);
  7255. CreateTimer(0.0, SetClientiClip2_Pre, pack, TIMER_DATA_HNDL_CLOSE);
  7256. BuyCrossbow[Client] = true;
  7257. CreateTimer(0.5, AttackDelayed, Client);
  7258. }
  7259. else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
  7260. }
  7261. if(StrEqual(info, "UMP", false))
  7262. {
  7263. if(Credit[Client] >= 1)
  7264. {
  7265. Credit[Client] -= 1;
  7266. bought = true;
  7267. if(weapon == GetPlayerWeaponSlot(Client, 0)) BlockWeaponUse[Client] = false;
  7268. BuyAcceptWeapon[Client] = true;
  7269. new weapons = GetPlayerWeaponSlot(Client, 0);
  7270. if(IsValidEdict(weapons))
  7271. {
  7272. RemovePlayerItem(Client, weapons);
  7273. RemoveEdict(weapons);
  7274. }
  7275. weapons = GivePlayerItem(Client, "weapon_ump45");
  7276. UMP[weapons] = true;
  7277. BuyUMP[Client] = true;
  7278. }
  7279. else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
  7280. }
  7281. if(StrEqual(info, "Silenced Sniper Rifle", false))
  7282. {
  7283. if(Credit[Client] >= 1)
  7284. {
  7285. Credit[Client] -= 1;
  7286. bought = true;
  7287. if(weapon == GetPlayerWeaponSlot(Client, 0)) BlockWeaponUse[Client] = false;
  7288. BuyAcceptWeapon[Client] = true;
  7289. new weapons = GetPlayerWeaponSlot(Client, 0);
  7290. if(IsValidEdict(weapons))
  7291. {
  7292. RemovePlayerItem(Client, weapons);
  7293. RemoveEdict(weapons);
  7294. }
  7295. weapons = GivePlayerItem(Client, "weapon_awp");
  7296. SDKHook(weapons, SDKHook_Think, WeaponWorldModelThink);
  7297. Silenced_Sniper_Rifle[weapons] = true;
  7298. SetEntProp(weapons, Prop_Send, "m_iClip1", 10);
  7299. SendProxy_Hook(weapons, "m_iClip1", Prop_Int, Silenced_Think);
  7300. }
  7301. else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
  7302. }
  7303. if(StrEqual(info, "Health Station", false))
  7304. {
  7305. if(Credit[Client] >= 1)
  7306. {
  7307. new weapons = GivePlayerItem(Client, "weapon_flashbang");
  7308. HealthStation[weapons] = true;
  7309. Credit[Client] -= 1;
  7310. bought = true;
  7311. }
  7312. else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
  7313. }
  7314. if(StrEqual(info, "Fake Health Station", false))
  7315. {
  7316. if(Credit[Client] >= 1)
  7317. {
  7318. new entity = Create_Prop(Client, "models/items/item_item_crate.mdl");
  7319. if(entity != -1)
  7320. {
  7321. IsFakeHealthBox[entity] = true;
  7322. FakeHealthBoxOwner[entity] = Client;
  7323. HealthBox[entity] = 150;
  7324. SetVariantInt(400);
  7325. AcceptEntityInput(entity, "SetHealth");
  7326. Credit[Client] -= 1;
  7327. bought = true;
  7328. }
  7329. }
  7330. else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
  7331. }
  7332. if(bought)
  7333. {
  7334. Format(Translate_Formatting, 256, "\x0748D1CC%T", "Credit_Buy", Client, info, Client, 1, "Credit", Client);
  7335. PrintChat(Client, Translate_Formatting);
  7336. EmitSoundToClient(Client, "ambient/levels/labs/coinslot1.wav", Client);
  7337. }
  7338. }
  7339. if(action == MenuAction_End)
  7340. {
  7341. CloseHandle(menu);
  7342. }
  7343. }
  7344.  
  7345. public Action:Jihad_Explosion(Handle:timer, any:Client)
  7346. {
  7347. if(JoinCheck(Client) && IsPlayerAlive(Client))
  7348. {
  7349. new Float:Position[3];
  7350. GetClientAbsOrigin(Client, Position);
  7351. makeExplosion(Client, -1, Position, "the_jihad", 300, 500, 0.0);
  7352. EmitSoundToAll("tttmusic/big_explosion.wav", Client, SNDCHAN_WEAPON, SNDLEVEL_NORMAL, SND_NOFLAGS, 1.0, SNDPITCH_NORMAL, -1, Position);
  7353. }
  7354. }
  7355.  
  7356. public Present(Client)
  7357. {
  7358. new Handle:menuhandle = CreateMenu(Present_CallBack);
  7359. SetMenuTitle(menuhandle, "선물 메뉴");
  7360. AddMenuItem(menuhandle, "Point", "포인트");
  7361. if(IsPlayerAlive(Client)) AddMenuItem(menuhandle, "Credit", "크레딧");
  7362. else AddMenuItem(menuhandle, "Credit", "크레딧", ITEMDRAW_DISABLED);
  7363. AddMenuItem(menuhandle, "Item", "아이템");
  7364. SetMenuExitButton(menuhandle, true);
  7365. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  7366. }
  7367.  
  7368. public Present_CallBack(Handle:menu, MenuAction:action, Client, select)
  7369. {
  7370. if(action == MenuAction_Select)
  7371. {
  7372. new String:info[256];
  7373. GetMenuItem(menu, select, info, 256);
  7374. if(StrEqual(info, "Point", false))
  7375. {
  7376. Present2(Client, 0);
  7377. }
  7378. if(StrEqual(info, "Credit", false))
  7379. {
  7380. Present2(Client, 1);
  7381. }
  7382. if(StrEqual(info, "Item", false))
  7383. {
  7384. Present2(Client, 2);
  7385. }
  7386. }
  7387. if(action == MenuAction_End)
  7388. {
  7389. CloseHandle(menu);
  7390. }
  7391. }
  7392.  
  7393. public Present2(Client, type)
  7394. {
  7395. new Handle:menuhandle = CreateMenu(Present2_CallBack), String:Formatting[256], String:Formatting2[256];
  7396. if(type == 1) SetMenuTitle(menuhandle, "타겟을 고르십시오(크레딧 선물)");
  7397. else if(!type) SetMenuTitle(menuhandle, "타겟을 고르십시오(포인트 선물)");
  7398. else SetMenuTitle(menuhandle, "타겟을 고르십시오(아이템 선물)");
  7399. if(type == 1)
  7400. {
  7401. for(new i=1; i<=MaxClients; i++)
  7402. {
  7403. if(JoinCheck(i) && i != Client && (!Ragdoll[i] || !CheckedBody[Ragdoll[i]]))
  7404. {
  7405. Format(Formatting, 256, "%i^%i", type, i);
  7406. Format(Formatting2, 256, "%N", i);
  7407. AddMenuItem(menuhandle, Formatting, Formatting2);
  7408. }
  7409. }
  7410. }
  7411. else
  7412. {
  7413. for(new i=1; i<=MaxClients; i++)
  7414. {
  7415. if(JoinCheck(i) && i != Client)
  7416. {
  7417. Format(Formatting, 256, "%i^%i", type, i);
  7418. Format(Formatting2, 256, "%N", i);
  7419. AddMenuItem(menuhandle, Formatting, Formatting2);
  7420. }
  7421. }
  7422. }
  7423. SetMenuExitButton(menuhandle, true);
  7424. SetMenuExitBackButton(menuhandle, true);
  7425. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  7426. }
  7427.  
  7428. public Present2_CallBack(Handle:menu, MenuAction:action, Client, select)
  7429. {
  7430. if(action == MenuAction_Select)
  7431. {
  7432. new String:info[256], String:EString[2][64];
  7433. GetMenuItem(menu, select, info, 256);
  7434. ExplodeString(info, "^", EString, 2, 64);
  7435. new type = StringToInt(EString[0]);
  7436. new Target = StringToInt(EString[1]);
  7437. SellPoint[Client] = 0;
  7438. if(type == 1) CreditPresent(Client, Target);
  7439. else if(!type) PointPresent(Client, Target);
  7440. else
  7441. {
  7442. new String:SteamID[256], String:query[512];
  7443. GetClientAuthString(Client, SteamID, 256);
  7444. new Handle:pack = CreateDataPack();
  7445. WritePackCell(pack, Client);
  7446. WritePackCell(pack, Target);
  7447. Format(query, 512, "SELECT * FROM inventory WHERE steamid = '%s' ORDER BY idx ASC;", SteamID);
  7448. SQL_TQuery(databasehandle, ItemPresent, query, pack);
  7449. }
  7450. }
  7451. if(action == MenuAction_Cancel)
  7452. {
  7453. if(select == MenuCancel_ExitBack)
  7454. {
  7455. Present(Client);
  7456. }
  7457. }
  7458. if(action == MenuAction_End)
  7459. {
  7460. CloseHandle(menu);
  7461. }
  7462. }
  7463.  
  7464. public CreditPresent(Client, Target)
  7465. {
  7466. new String:Formatting[256];
  7467. Format(Formatting, 256, "%i", Target);
  7468. new Handle:menuhandle = CreateMenu(CreditPresent_CallBack);
  7469. SetMenuTitle(menuhandle, "%N에게 크레딧 선물\n%i크레딧을 주시겠습니까?", Target, SellPoint[Client]);
  7470. if(SellPoint[Client]) AddMenuItem(menuhandle, Formatting, "네");
  7471. else AddMenuItem(menuhandle, Formatting, "네", ITEMDRAW_DISABLED);
  7472. AddMenuItem(menuhandle, Formatting, "취소");
  7473. if(Credit[Client] >= SellPoint[Client] + 1) AddMenuItem(menuhandle, Formatting, "+1");
  7474. else AddMenuItem(menuhandle, Formatting, "+1", ITEMDRAW_DISABLED);
  7475. if(Credit[Client] >= SellPoint[Client] + 10) AddMenuItem(menuhandle, Formatting, "+10");
  7476. else AddMenuItem(menuhandle, Formatting, "+10", ITEMDRAW_DISABLED);
  7477. if(Credit[Client] >= SellPoint[Client] + 100) AddMenuItem(menuhandle, Formatting, "+100");
  7478. else AddMenuItem(menuhandle, Formatting, "+100", ITEMDRAW_DISABLED);
  7479. if(Credit[Client] >= SellPoint[Client] + 1000) AddMenuItem(menuhandle, Formatting, "+1000");
  7480. else AddMenuItem(menuhandle, Formatting, "+1000", ITEMDRAW_DISABLED);
  7481. if(Credit[Client] >= SellPoint[Client] + 10000) AddMenuItem(menuhandle, Formatting, "+1만");
  7482. else AddMenuItem(menuhandle, Formatting, "+1만", ITEMDRAW_DISABLED);
  7483. if(Credit[Client] >= SellPoint[Client] + 100000) AddMenuItem(menuhandle, Formatting, "+10만");
  7484. else AddMenuItem(menuhandle, Formatting, "+10만", ITEMDRAW_DISABLED);
  7485. if(Credit[Client] >= SellPoint[Client] + 1000000) AddMenuItem(menuhandle, Formatting, "+100만");
  7486. else AddMenuItem(menuhandle, Formatting, "+100만", ITEMDRAW_DISABLED);
  7487. SetMenuPagination(menuhandle, MENU_NO_PAGINATION);
  7488. SetMenuExitButton(menuhandle, false);
  7489. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  7490. }
  7491.  
  7492. public CreditPresent_CallBack(Handle:menu, MenuAction:action, Client, select)
  7493. {
  7494. if(action == MenuAction_Select)
  7495. {
  7496. if(IsPlayerAlive(Client))
  7497. {
  7498. new String:StringNumber[256];
  7499. GetMenuItem(menu, select, StringNumber, 256);
  7500. new target = StringToInt(StringNumber);
  7501. if(select == 0)
  7502. {
  7503. Credit[Client] -= SellPoint[Client];
  7504. Credit[target] += SellPoint[Client];
  7505. PrintChat(Client, "\x05당신은 %N에게 %d크레딧을 줬습니다.", target, SellPoint[Client]);
  7506. PrintChat(target, "\x05당신은 %N에게 %d크레딧을 받았습니다.", Client, SellPoint[Client]);
  7507. }
  7508. if(select == 1)
  7509. {
  7510. Present2(Client, 1);
  7511. }
  7512. if(select >= 2)
  7513. {
  7514. new calcultae = 1;
  7515. for(new i = 2; i < select; i++)
  7516. {
  7517. calcultae *= 10;
  7518. }
  7519. SellPoint[Client] += calcultae;
  7520. }
  7521. if(select > 1)
  7522. {
  7523. CreditPresent(Client, StringToInt(StringNumber));
  7524. }
  7525. }
  7526. }
  7527. if(action == MenuAction_End)
  7528. {
  7529. CloseHandle(menu);
  7530. }
  7531. }
  7532.  
  7533. public PointPresent(Client, Target)
  7534. {
  7535. new String:Formatting[256];
  7536. Format(Formatting, 256, "%i", Target);
  7537. new Handle:menuhandle = CreateMenu(PointPresent_CallBack);
  7538. SetMenuTitle(menuhandle, "%N에게 포인트 선물\n%i포인트를 주시겠습니까?", Target, SellPoint[Client]);
  7539. if(SellPoint[Client]) AddMenuItem(menuhandle, Formatting, "네");
  7540. else AddMenuItem(menuhandle, Formatting, "네", ITEMDRAW_DISABLED);
  7541. AddMenuItem(menuhandle, Formatting, "취소");
  7542. if(Point[Client] >= SellPoint[Client] + 1) AddMenuItem(menuhandle, Formatting, "+1");
  7543. else AddMenuItem(menuhandle, Formatting, "+1", ITEMDRAW_DISABLED);
  7544. if(Point[Client] >= SellPoint[Client] + 10) AddMenuItem(menuhandle, Formatting, "+10");
  7545. else AddMenuItem(menuhandle, Formatting, "+10", ITEMDRAW_DISABLED);
  7546. if(Point[Client] >= SellPoint[Client] + 100) AddMenuItem(menuhandle, Formatting, "+100");
  7547. else AddMenuItem(menuhandle, Formatting, "+100", ITEMDRAW_DISABLED);
  7548. if(Point[Client] >= SellPoint[Client] + 1000) AddMenuItem(menuhandle, Formatting, "+1000");
  7549. else AddMenuItem(menuhandle, Formatting, "+1000", ITEMDRAW_DISABLED);
  7550. if(Point[Client] >= SellPoint[Client] + 10000) AddMenuItem(menuhandle, Formatting, "+1만");
  7551. else AddMenuItem(menuhandle, Formatting, "+1만", ITEMDRAW_DISABLED);
  7552. if(Point[Client] >= SellPoint[Client] + 100000) AddMenuItem(menuhandle, Formatting, "+10만");
  7553. else AddMenuItem(menuhandle, Formatting, "+10만", ITEMDRAW_DISABLED);
  7554. if(Point[Client] >= SellPoint[Client] + 1000000) AddMenuItem(menuhandle, Formatting, "+100만");
  7555. else AddMenuItem(menuhandle, Formatting, "+100만", ITEMDRAW_DISABLED);
  7556. SetMenuPagination(menuhandle, MENU_NO_PAGINATION);
  7557. SetMenuExitButton(menuhandle, false);
  7558. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  7559. }
  7560.  
  7561. public PointPresent_CallBack(Handle:menu, MenuAction:action, Client, select)
  7562. {
  7563. if(action == MenuAction_Select)
  7564. {
  7565. new String:StringNumber[256];
  7566. GetMenuItem(menu, select, StringNumber, 256);
  7567. new target = StringToInt(StringNumber);
  7568. if(select == 0)
  7569. {
  7570. Point[Client] -= SellPoint[Client];
  7571. SavePoint(Client);
  7572. Point[target] += SellPoint[Client];
  7573. SavePoint(target);
  7574. PrintChat(Client, "\x05당신은 %N에게 %d포인트를 줬습니다.", target, SellPoint[Client]);
  7575. PrintChat(target, "\x05당신은 %N에게 %d포인트를 받았습니다.", Client, SellPoint[Client]);
  7576. }
  7577. if(select == 1)
  7578. {
  7579. Present2(Client, 1);
  7580. }
  7581. if(select >= 2)
  7582. {
  7583. new calcultae = 1;
  7584. for(new i = 2; i < select; i++)
  7585. {
  7586. calcultae *= 10;
  7587. }
  7588. SellPoint[Client] += calcultae;
  7589. }
  7590. if(select > 1)
  7591. {
  7592. PointPresent(Client, StringToInt(StringNumber));
  7593. }
  7594. }
  7595. if(action == MenuAction_End)
  7596. {
  7597. CloseHandle(menu);
  7598. }
  7599. }
  7600.  
  7601. public ItemPresent(Handle:owner, Handle:hndl, const String:error[], any:pack)
  7602. {
  7603. ResetPack(pack);
  7604. new Client = ReadPackCell(pack);
  7605. new Target = ReadPackCell(pack);
  7606. if(hndl == INVALID_HANDLE)
  7607. {
  7608. PrintChat(Client, "\x03Don't have any type of items.");
  7609. Present(Client);
  7610. return;
  7611. }
  7612. new String:Formatting[256], String:Formatting2[256], bool:display;
  7613. new counted = SQL_GetRowCount(hndl);
  7614. new Handle:menuhandle = CreateMenu(ItemPresent_CallBack);
  7615. SetMenuTitle(menuhandle, "%N에게 아이템 선물", Target);
  7616. if(counted > 0)
  7617. {
  7618. if(SQL_HasResultSet(hndl))
  7619. {
  7620. while(SQL_FetchRow(hndl))
  7621. {
  7622. Format(Formatting, 256, "%i^%i", Target, SQL_FetchInt(hndl, 2));
  7623. Format(Formatting2, 256, "%s", ItemName[SQL_FetchInt(hndl, 2)]);
  7624. if(!IsVIPItem[SQL_FetchInt(hndl, 2)]) AddMenuItem(menuhandle, Formatting, Formatting2);
  7625. else AddMenuItem(menuhandle, Formatting, Formatting2, ITEMDRAW_DISABLED);
  7626. if(!display)
  7627. {
  7628. display = true;
  7629. }
  7630. }
  7631. }
  7632. }
  7633. if(display)
  7634. {
  7635. SetMenuExitButton(menuhandle, true);
  7636. SetMenuExitBackButton(menuhandle, true);
  7637. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  7638. }
  7639. else
  7640. {
  7641. PrintChat(Client, "\x03Don't have any type of items.");
  7642. Present(Client);
  7643. }
  7644. }
  7645.  
  7646. public ItemPresent_CallBack(Handle:menu, MenuAction:action, Client, select)
  7647. {
  7648. if(action == MenuAction_Select)
  7649. {
  7650. new String:info[256], String:EString[2][64], String:query[512], String:SteamID[256], String:TargetSteamID[256];
  7651. GetMenuItem(menu, select, info, 256);
  7652. ExplodeString(info, "^", EString, 2, 64);
  7653. new Target = StringToInt(EString[0]);
  7654. new Number = StringToInt(EString[1]);
  7655. GetClientAuthString(Client, SteamID, 256);
  7656. GetClientAuthString(Target, TargetSteamID, 256);
  7657. Format(query, 512, "INSERT INTO inventory(steamid, idx, type) values ('%s', '%d', '%d');", TargetSteamID, Number, ItemType[Number]);
  7658. SQL_TQuery(databasehandle, save_info, query);
  7659. Format(query, 512, "DELETE FROM inventory WHERE steamid = '%s' AND idx = '%i' limit 1;", SteamID, Number);
  7660. SQL_TQuery(databasehandle, save_info, query);
  7661. PrintChat(Client, "\x05당신은 %N에게 %s를 줬습니다.", Target, ItemName[Number]);
  7662. PrintChat(Target, "\x05당신은 %N에게 %s를 받았습니다.", Client, ItemName[Number]);
  7663. new String:Log[256], String:Time[30], String:ClientName[256], String:TargetName[256];
  7664. GetClientName(Client, ClientName, 256);
  7665. GetClientName(Target, TargetName, 256);
  7666. while(StrContains(ClientName, "'") != -1) ReplaceStringEx(ClientName, 256, "'", "`");
  7667. while(StrContains(TargetName, "'") != -1) ReplaceStringEx(TargetName, 256, "'", "`");
  7668. FormatTime(Time, 30, "%Y/%m/%d - %H:%M:%S", GetTime());
  7669. Format(Log, 256, "%s gift (%s)%i for %s", ClientName, ItemName[Number], Number, TargetName);
  7670. Format(query, 512, "INSERT INTO shoplog(steamid, log, type, date) values ('%s', '%s', '%i', '%s');", SteamID, Log, 5, Time);
  7671. SQL_TQuery(databasehandle, save_info, query);
  7672. Format(Log, 256, "%s receive %s(%i) for %s", TargetName, ItemName[Number], Number, ClientName);
  7673. Format(query, 512, "INSERT INTO shoplog(steamid, log, type, date) values ('%s', '%s', '%i', '%s');", TargetSteamID, Log, 6, Time);
  7674. SQL_TQuery(databasehandle, save_info, query);
  7675. }
  7676. if(action == MenuAction_Cancel)
  7677. {
  7678. if(select == MenuCancel_ExitBack)
  7679. {
  7680. Present2(Client, 2);
  7681. }
  7682. }
  7683. if(action == MenuAction_End)
  7684. {
  7685. CloseHandle(menu);
  7686. }
  7687. }
  7688.  
  7689. public MainMenu(Client)
  7690. {
  7691. new Handle:menuhandle = CreateMenu(MainMenu_CallBack), String:Translate_Formatting[128];
  7692. SetMenuTitle(menuhandle, "-- %T %T --", "main", Client, "menu", Client);
  7693. Format(Translate_Formatting, 128, "%T %T", "point", Client, "shop", Client);
  7694. AddMenuItem(menuhandle, "shop", Translate_Formatting);
  7695. Format(Translate_Formatting, 128, "%T", "options", Client);
  7696. //AddMenuItem(menuhandle, "options", Translate_Formatting);
  7697. AddMenuItem(menuhandle, "VIP", "VIP");
  7698. if(AdminCheck(Client)) AddMenuItem(menuhandle, "ADM", "Admin Menu");
  7699. SetMenuExitButton(menuhandle, true);
  7700. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  7701. }
  7702.  
  7703. public MainMenu_CallBack(Handle:menu, MenuAction:action, Client, select)
  7704. {
  7705. if(action == MenuAction_Select)
  7706. {
  7707. new String:info[256];
  7708. GetMenuItem(menu, select, info, 256);
  7709. if(StrEqual(info, "shop", false))
  7710. {
  7711. MainShop(Client);
  7712. }
  7713. /*
  7714. if(StrEqual(info, "options", false))
  7715. {
  7716. MainOption(Client);
  7717. }
  7718. */
  7719. if(StrEqual(info, "VIP", false))
  7720. {
  7721. if(!VIP[Client])
  7722. {
  7723. youarenotvip(Client);
  7724. }
  7725. else
  7726. {
  7727. VIPOption(Client);
  7728. }
  7729. }
  7730. if(StrEqual(info, "ADM", false))
  7731. {
  7732. ADMOption(Client);
  7733. }
  7734. }
  7735. if(action == MenuAction_End)
  7736. {
  7737. CloseHandle(menu);
  7738. }
  7739. }
  7740. /*
  7741. public MainOption(Client)
  7742. {
  7743. new Handle:menuhandle = CreateMenu(MainOption_CallBack), String:Translate_Formatting[128];
  7744. SetMenuTitle(menuhandle, "-- %T %T --", "main", Client, "options", Client);
  7745. Format(Translate_Formatting, 128, "%T %T", "shop", Client, "option", Client);
  7746. AddMenuItem(menuhandle, "Shop Option", Translate_Formatting);
  7747. AddMenuItem(menuhandle, "BGM Toggle", "BGM On/Off");
  7748. AddMenuItem(menuhandle, "BGM Volume", "BGM Volume");
  7749. SetMenuExitButton(menuhandle, true);
  7750. SetMenuExitBackButton(menuhandle, true);
  7751. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  7752. }
  7753.  
  7754. public MainOption_CallBack(Handle:menu, MenuAction:action, Client, select)
  7755. {
  7756. if(action == MenuAction_Select)
  7757. {
  7758. if(select == 0)
  7759. {
  7760. Option(Client);
  7761. }
  7762. if(select == 1)
  7763. {
  7764. new String:SteamID[256], String:query[512];
  7765. GetClientAuthString(Client ,SteamID, 256);
  7766. if(!BGM[Client])
  7767. {
  7768. BGM[Client] = true;
  7769. Format(query, 512, "UPDATE info SET bgm = '1' WHERE steamid = '%s';", SteamID);
  7770. SQL_TQuery(databasehandle, save_info, query, Client);
  7771. PrintChat(Client, "\x08FF0000EEBGM %T", "off", Client);
  7772. new String:Formatting[256];
  7773. Format(Formatting, 256, "tttmusic/%s", SoundData[SoundNumber][0]);
  7774. StopSound(Client, SNDCHAN_AUTO, Formatting);
  7775. }
  7776. else
  7777. {
  7778. BGM[Client] = false;
  7779. Format(query, 512, "UPDATE info SET bgm = '0' WHERE steamid = '%s';", SteamID);
  7780. SQL_TQuery(databasehandle, save_info, query, Client);
  7781. PrintChat(Client, "\x08FF0000EEBGM %T", "on", Client);
  7782. }
  7783. MainOption(Client);
  7784. }
  7785. if(select == 2)
  7786. {
  7787. if(!BGM[Client]) BGM_Volume_Option(Client);
  7788. else PrintChat(Client, "\x07FFFFFFBGM설정을 온 하셔야 합니다.");
  7789. }
  7790. }
  7791. if(action == MenuAction_Cancel)
  7792. {
  7793. if(select == MenuCancel_ExitBack)
  7794. {
  7795. MainMenu(Client);
  7796. }
  7797. }
  7798. if(action == MenuAction_End)
  7799. {
  7800. CloseHandle(menu);
  7801. }
  7802. }
  7803.  
  7804. public BGM_Volume_Option(Client)
  7805. {
  7806. new Handle:menuhandle = CreateMenu(BGM_Volume_Option_CallBack);
  7807. SetMenuTitle(menuhandle, "Setting Volume for BGM - %i%%", Volume[Client]);
  7808. AddMenuItem(menuhandle, "", "+10%", Volume[Client] <= 90 ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED);
  7809. AddMenuItem(menuhandle, "", "+5%", Volume[Client] <= 95 ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED);
  7810. AddMenuItem(menuhandle, "", "+1%", Volume[Client] <= 99 ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED);
  7811. AddMenuItem(menuhandle, "", " ");
  7812. AddMenuItem(menuhandle, "", "-1%", Volume[Client] >= 1 ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED);
  7813. AddMenuItem(menuhandle, "", "-5%", Volume[Client] >= 5 ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED);
  7814. AddMenuItem(menuhandle, "", "-10%", Volume[Client] >= 10 ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED);
  7815. SetMenuExitButton(menuhandle, true);
  7816. SetMenuExitBackButton(menuhandle, true);
  7817. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  7818. }
  7819.  
  7820. public BGM_Volume_Option_CallBack(Handle:menu, MenuAction:action, Client, select)
  7821. {
  7822. if(action == MenuAction_Select)
  7823. {
  7824. new String:SteamID[256], String:query[512];
  7825. GetClientAuthString(Client, SteamID, 256);
  7826. if(select == 0)
  7827. {
  7828. Volume[Client] += 10;
  7829. }
  7830. if(select == 1)
  7831. {
  7832. Volume[Client] += 5;
  7833. }
  7834. if(select == 2)
  7835. {
  7836. Volume[Client] += 1;
  7837. }
  7838. if(select == 4)
  7839. {
  7840. Volume[Client] -= 1;
  7841. }
  7842. if(select == 5)
  7843. {
  7844. Volume[Client] -= 5;
  7845. }
  7846. if(select == 6)
  7847. {
  7848. Volume[Client] -= 10;
  7849. }
  7850. Format(query, 512, "UPDATE info SET volume = '%i' WHERE steamid = '%s';", Volume[Client], SteamID);
  7851. SQL_TQuery(databasehandle, save_info, query, Client);
  7852. PrintChat(Client, "\x08FF0000EEBGM Volume : %i%%", Volume[Client]);
  7853. BGM_Volume_Option(Client);
  7854. }
  7855. if(action == MenuAction_Cancel)
  7856. {
  7857. if(select == MenuCancel_ExitBack)
  7858. {
  7859. MainOption(Client);
  7860. }
  7861. }
  7862. if(action == MenuAction_End)
  7863. {
  7864. CloseHandle(menu);
  7865. }
  7866. }
  7867. */
  7868. public youarenotvip(Client)
  7869. {
  7870. new Handle:menuhandle = CreateMenu(youarenotvip_CallBack);
  7871. SetMenuTitle(menuhandle, "-- You are not a VIP --");
  7872. AddMenuItem(menuhandle, "", "What do i get if i buy VIP?");
  7873. SetMenuExitButton(menuhandle, true);
  7874. SetMenuExitBackButton(menuhandle, true);
  7875. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  7876. }
  7877.  
  7878. public youarenotvip_CallBack(Handle:menu, MenuAction:action, Client, select)
  7879. {
  7880. if(action == MenuAction_Select)
  7881. {
  7882. if(select == 0)
  7883. {
  7884. VIPEffect(Client);
  7885. }
  7886. }
  7887. if(action == MenuAction_Cancel)
  7888. {
  7889. if(select == MenuCancel_ExitBack)
  7890. {
  7891. MainMenu(Client);
  7892. }
  7893. }
  7894. if(action == MenuAction_End)
  7895. {
  7896. CloseHandle(menu);
  7897. }
  7898. }
  7899.  
  7900. public VIPEffect(Client)
  7901. {
  7902. new Handle:menuhandle = CreateMenu(VIPEffect_CallBack);
  7903. SetMenuTitle(menuhandle, "-- VIP Effects --");
  7904. AddMenuItem(menuhandle, "", "Pistol(usp,elite,fiveseven) will be automatic.\n", ITEMDRAW_DISABLED);
  7905. AddMenuItem(menuhandle, "", "You will get VIP tag.\n", ITEMDRAW_DISABLED);
  7906. AddMenuItem(menuhandle, "", "You can change color of tag.\n", ITEMDRAW_DISABLED);
  7907. AddMenuItem(menuhandle, "", "you will be gain 1 extra credit.\n", ITEMDRAW_DISABLED);
  7908. AddMenuItem(menuhandle, "", "you get effect more on medic kit.\n", ITEMDRAW_DISABLED);
  7909. AddMenuItem(menuhandle, "", "you can setup light of tag.\n", ITEMDRAW_DISABLED);
  7910. AddMenuItem(menuhandle, "", "you can use VIP shop's skins for free.\n", ITEMDRAW_DISABLED);
  7911. SetMenuExitButton(menuhandle, true);
  7912. SetMenuExitBackButton(menuhandle, true);
  7913. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  7914. }
  7915.  
  7916. public VIPEffect_CallBack(Handle:menu, MenuAction:action, Client, select)
  7917. {
  7918. if(action == MenuAction_Cancel)
  7919. {
  7920. if(select == MenuCancel_ExitBack)
  7921. {
  7922. MainMenu(Client);
  7923. }
  7924. }
  7925. if(action == MenuAction_End)
  7926. {
  7927. CloseHandle(menu);
  7928. }
  7929. }
  7930.  
  7931. public VIPOption(Client)
  7932. {
  7933. new Handle:menuhandle = CreateMenu(VIPOption_CallBack);
  7934. SetMenuTitle(menuhandle, "-- VIP Menu --");
  7935. AddMenuItem(menuhandle, "", "What do i get if i buy VIP?");
  7936. AddMenuItem(menuhandle, "", "Set color of VIP Tag");
  7937. if(VIP[Client]) AddMenuItem(menuhandle, "", "VIP Shop");
  7938. SetMenuExitButton(menuhandle, true);
  7939. SetMenuExitBackButton(menuhandle, true);
  7940. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  7941. }
  7942.  
  7943. public VIPOption_CallBack(Handle:menu, MenuAction:action, Client, select)
  7944. {
  7945. if(action == MenuAction_Select)
  7946. {
  7947. if(select == 0)
  7948. {
  7949. VIPEffect(Client);
  7950. }
  7951. if(select == 1)
  7952. {
  7953. if(VIP[Client]) VIPTagChangeColor(Client);
  7954. }
  7955. if(select == 2)
  7956. {
  7957. if(VIP[Client]) VIPMainShop(Client);
  7958. }
  7959. }
  7960. if(action == MenuAction_Cancel)
  7961. {
  7962. if(select == MenuCancel_ExitBack)
  7963. {
  7964. MainMenu(Client);
  7965. }
  7966. }
  7967. if(action == MenuAction_End)
  7968. {
  7969. CloseHandle(menu);
  7970. }
  7971. }
  7972.  
  7973. public VIPTagChangeColor(Client)
  7974. {
  7975. new Handle:menuhandle = CreateMenu(VIPTagChangeColor_CallBack);
  7976. SetMenuTitle(menuhandle, "-- Set color of VIP Tag --");
  7977. AddMenuItem(menuhandle, "", "R(Red)");
  7978. AddMenuItem(menuhandle, "", "G(Green)");
  7979. AddMenuItem(menuhandle, "", "B(Blue)");
  7980. AddMenuItem(menuhandle, "", "A(Alpha)");
  7981. SetMenuExitButton(menuhandle, true);
  7982. SetMenuExitBackButton(menuhandle, true);
  7983. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  7984. }
  7985.  
  7986. public VIPTagChangeColor_CallBack(Handle:menu, MenuAction:action, Client, select)
  7987. {
  7988. if(action == MenuAction_Select)
  7989. {
  7990. VIPTagChangeColor2(Client, select+1);
  7991. }
  7992. if(action == MenuAction_Cancel)
  7993. {
  7994. if(select == MenuCancel_ExitBack)
  7995. {
  7996. VIPOption(Client);
  7997. }
  7998. }
  7999. if(action == MenuAction_End)
  8000. {
  8001. CloseHandle(menu);
  8002. }
  8003. }
  8004.  
  8005. public VIPTagChangeColor2(Client, Color)
  8006. {
  8007. new Handle:menuhandle = CreateMenu(VIPTagChangeColor2_CallBack);
  8008. if(Color == 1) SetMenuTitle(menuhandle, "-- Set Red Color VIP Tag --");
  8009. else if(Color == 2) SetMenuTitle(menuhandle, "-- Set Green Color VIP Tag --");
  8010. else if(Color == 3) SetMenuTitle(menuhandle, "-- Set Blue Color VIP Tag --");
  8011. else SetMenuTitle(menuhandle, "-- Set Alpha Color VIP Tag --");
  8012. new String:StringColor[256], String:Formatting[256];
  8013. IntToString(Color, StringColor, 256);
  8014. for(new i= 1; i <= 36; i++)
  8015. {
  8016. Format(Formatting, 256, "%i ~ %i", ((i-1)*7), i*7-1);
  8017. AddMenuItem(menuhandle, StringColor, Formatting);
  8018. }
  8019. AddMenuItem(menuhandle, StringColor, "252 ~ 255");
  8020. SetMenuExitButton(menuhandle, true);
  8021. SetMenuExitBackButton(menuhandle, true);
  8022. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  8023. }
  8024.  
  8025. public VIPTagChangeColor2_CallBack(Handle:menu, MenuAction:action, Client, select)
  8026. {
  8027. if(action == MenuAction_Select)
  8028. {
  8029. new String:info[256];
  8030. GetMenuItem(menu, select, info, 256);
  8031. VIPTagChangeColor3(Client, info, select);
  8032. }
  8033. if(action == MenuAction_Cancel)
  8034. {
  8035. if(select == MenuCancel_ExitBack)
  8036. {
  8037. VIPTagChangeColor(Client);
  8038. }
  8039. }
  8040. if(action == MenuAction_End)
  8041. {
  8042. CloseHandle(menu);
  8043. }
  8044. }
  8045.  
  8046. public VIPTagChangeColor3(Client, String:Color[256], Number)
  8047. {
  8048. new Handle:menuhandle = CreateMenu(VIPTagChangeColor3_CallBack);
  8049. if(StringToInt(Color) == 1) SetMenuTitle(menuhandle, "-- Set Red Color VIP Tag --");
  8050. else if(StringToInt(Color) == 2) SetMenuTitle(menuhandle, "-- Set Green Color VIP Tag --");
  8051. else if(StringToInt(Color) == 3) SetMenuTitle(menuhandle, "-- Set Blue Color VIP Tag --");
  8052. else SetMenuTitle(menuhandle, "-- Set Alpha Color VIP Tag --");
  8053. new String:Formatting[256], String:Color2[256];
  8054. if(Number == 36)
  8055. {
  8056. for(new i; i < 4; i++)
  8057. {
  8058. Format(Formatting, 256, "%i", Number*7+i);
  8059. Format(Color2, 256, "%s^%i", Color, Number*7+i);
  8060. AddMenuItem(menuhandle, Color2, Formatting);
  8061. }
  8062. }
  8063. else
  8064. {
  8065. for(new i; i < 7; i++)
  8066. {
  8067. Format(Formatting, 256, "%i", Number*7+i);
  8068. Format(Color2, 256, "%s^%i", Color, Number*7+i);
  8069. AddMenuItem(menuhandle, Color2, Formatting);
  8070. }
  8071. }
  8072. SetMenuExitButton(menuhandle, true);
  8073. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  8074. }
  8075.  
  8076. public VIPTagChangeColor3_CallBack(Handle:menu, MenuAction:action, Client, select)
  8077. {
  8078. if(action == MenuAction_Select)
  8079. {
  8080. new String:info[256], String:EString[2][128];
  8081. GetMenuItem(menu, select, info, 256);
  8082. ExplodeString(info, "^", EString, 2, 128);
  8083.  
  8084. new String:query[512], String:SteamID[256];
  8085. GetClientAuthString(Client, SteamID, 256);
  8086. if(StringToInt(EString[0]) == 1)
  8087. {
  8088. Format(query, 512, "UPDATE viptag SET red = '%i' WHERE steamid = '%s';", StringToInt(EString[1]), SteamID);
  8089. PrintChat(Client, "\x07FF3A3AYou are chosen Red code as %i%%.", StringToInt(EString[1]));
  8090. }
  8091. else if(StringToInt(EString[0]) == 2)
  8092. {
  8093. Format(query, 512, "UPDATE viptag SET green = '%i' WHERE steamid = '%s';", StringToInt(EString[1]), SteamID);
  8094. PrintChat(Client, "\x07FF3A3AYou are chosen Green code as %i%%.", StringToInt(EString[1]));
  8095. }
  8096. else if(StringToInt(EString[0]) == 3)
  8097. {
  8098. Format(query, 512, "UPDATE viptag SET blue = '%i' WHERE steamid = '%s';", StringToInt(EString[1]), SteamID);
  8099. PrintChat(Client, "\x07FF3A3AYou are chosen Blue code as %i%%.", StringToInt(EString[1]));
  8100. }
  8101. else
  8102. {
  8103. Format(query, 512, "UPDATE viptag SET alpha = '%i' WHERE steamid = '%s';", StringToInt(EString[1]), SteamID);
  8104. PrintChat(Client, "\x07FF3A3AYou are chosen Alpha code as %i%%.", StringToInt(EString[1]));
  8105. }
  8106. SQL_TQuery(databasehandle, save_info, query, Client);
  8107. Format(query, 512, "SELECT * FROM viptag WHERE steamid = '%s';", SteamID);
  8108. SQL_TQuery(databasehandle, viptag_check, query, Client);
  8109. }
  8110. if(action == MenuAction_End)
  8111. {
  8112. CloseHandle(menu);
  8113. }
  8114. }
  8115.  
  8116. public VIPMainShop(Client)
  8117. {
  8118. new Handle:menuhandle = CreateMenu(VIPMainShop_CallBack);
  8119. SetMenuTitle(menuhandle, "--- TTT VIP %T %T ---", "point", Client, "shop", Client);
  8120. for(new i = 1; i < MaxType+1; i++)
  8121. {
  8122. new String:Formatting[256];
  8123. Format(Formatting, 256, "%T %T(VIP)", TypeName[i][0], Client, "shop", Client);
  8124. AddMenuItem(menuhandle, "", Formatting);
  8125. }
  8126. SetMenuExitButton(menuhandle, true);
  8127. SetMenuExitBackButton(menuhandle, true);
  8128. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  8129. }
  8130.  
  8131. public VIPMainShop_CallBack(Handle:menu, MenuAction:action, Client, select)
  8132. {
  8133. if(action == MenuAction_Select)
  8134. {
  8135. VIPShop(Client, select+1);
  8136. }
  8137. if(action == MenuAction_Cancel)
  8138. {
  8139. if(select == MenuCancel_ExitBack)
  8140. {
  8141. VIPOption(Client);
  8142. }
  8143. }
  8144. if(action == MenuAction_End)
  8145. {
  8146. CloseHandle(menu);
  8147. }
  8148. }
  8149.  
  8150. public VIPShop(Client, Type)
  8151. {
  8152. new String:Formatting[256], String:Formatting2[256], bool:display;
  8153. new Handle:menuhandle = CreateMenu(VIPShop_CallBack);
  8154. SetMenuTitle(menuhandle, "--- TTT VIP %T %T ---", "point", Client, "shop", Client);
  8155. for(new i;i < MAX_ITEMS; i++)
  8156. {
  8157. if(ItemType[i] == Type && ItemPrice[i] && IsVIPItem[i])
  8158. {
  8159. if(VIP[Client])
  8160. {
  8161. Format(Formatting, 256, "%i", i);
  8162. Format(Formatting2, 256, "%s", ItemName[i]);
  8163. AddMenuItem(menuhandle, Formatting, Formatting2);
  8164. }
  8165. display = true;
  8166. }
  8167. }
  8168. SetMenuExitButton(menuhandle, true);
  8169. SetMenuExitBackButton(menuhandle, true);
  8170. if(!display)
  8171. {
  8172. Format(Formatting2, 256, "%T", "no items available", Client);
  8173. AddMenuItem(menuhandle, "", Formatting2, ITEMDRAW_DISABLED);
  8174. }
  8175. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  8176. }
  8177.  
  8178. public VIPShop_CallBack(Handle:menu, MenuAction:action, Client, select)
  8179. {
  8180. if(action == MenuAction_Select)
  8181. {
  8182. new String:StringNumber[256], Number;
  8183. GetMenuItem(menu, select, StringNumber, 256);
  8184. Number = StringToInt(StringNumber);
  8185. if(VIP[Client])
  8186. {
  8187. new String:query[512], String:SteamID[256];
  8188. GetClientAuthString(Client, SteamID, 256);
  8189. Format(query, 512, "INSERT INTO inventory(steamid, idx, type) values ('%s', '%d', '%d');", SteamID, Number, ItemType[Number]);
  8190. SQL_TQuery(databasehandle, save_info, query, Client);
  8191. PrintChat(Client, "You bought \x05%s.", ItemName[Number]);
  8192. Inventory(Client);
  8193. new String:Log[256], String:Time[30], String:ClientName[256];
  8194. GetClientName(Client, ClientName, 256);
  8195. while(StrContains(ClientName, "'") != -1) ReplaceStringEx(ClientName, 256, "'", "`");
  8196. FormatTime(Time, 30, "%Y/%m/%d - %H:%M:%S", GetTime());
  8197. Format(Log, 256, "%s buy %s(%i)", ClientName, ItemName[Number], Number);
  8198. Format(query, 512, "INSERT INTO shoplog(steamid, log, type, date) values ('%s', '%s', '%i', '%s');", SteamID, Log, 0, Time);
  8199. SQL_TQuery(databasehandle, save_info, query);
  8200. }
  8201. }
  8202. if(action == MenuAction_Cancel)
  8203. {
  8204. if(select == MenuCancel_ExitBack)
  8205. {
  8206. VIPMainShop(Client);
  8207. }
  8208. }
  8209. if(action == MenuAction_End)
  8210. {
  8211. CloseHandle(menu);
  8212. }
  8213. }
  8214.  
  8215. public ADMOption(Client)
  8216. {
  8217. new Handle:menuhandle = CreateMenu(ADMOption_CallBack);
  8218. SetMenuTitle(menuhandle, "-- Admin Menu --");
  8219. AddMenuItem(menuhandle, "", "Set ADM Tag Color ");
  8220. AddMenuItem(menuhandle, "", "User's Market Item Returning");
  8221. AddMenuItem(menuhandle, "", "Log");
  8222. SetMenuExitButton(menuhandle, true);
  8223. SetMenuExitBackButton(menuhandle, true);
  8224. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  8225. }
  8226.  
  8227. public ADMOption_CallBack(Handle:menu, MenuAction:action, Client, select)
  8228. {
  8229. if(action == MenuAction_Select)
  8230. {
  8231. if(select == 0)
  8232. {
  8233. ADMTagChangeColor(Client);
  8234. }
  8235. if(select == 1)
  8236. {
  8237. SQL_TQuery(databasehandle, CounterMarket_Admin_Sell_Item, "SELECT * FROM countermarket ORDER BY idx ASC;", Client);
  8238. }
  8239. if(select == 2)
  8240. {
  8241. Log_Year(Client);
  8242. }
  8243. }
  8244. if(action == MenuAction_Cancel)
  8245. {
  8246. if(select == MenuCancel_ExitBack)
  8247. {
  8248. MainMenu(Client);
  8249. }
  8250. }
  8251. if(action == MenuAction_End)
  8252. {
  8253. CloseHandle(menu);
  8254. }
  8255. }
  8256.  
  8257. public ADMTagChangeColor(Client)
  8258. {
  8259. new Handle:menuhandle = CreateMenu(ADMTagChangeColor_CallBack);
  8260. SetMenuTitle(menuhandle, "-- ADM Tag color set --");
  8261. AddMenuItem(menuhandle, "", "R(Red)");
  8262. AddMenuItem(menuhandle, "", "G(Green)");
  8263. AddMenuItem(menuhandle, "", "B(Blue)");
  8264. AddMenuItem(menuhandle, "", "A(Light)");
  8265. SetMenuExitButton(menuhandle, true);
  8266. SetMenuExitBackButton(menuhandle, true);
  8267. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  8268. }
  8269.  
  8270. public ADMTagChangeColor_CallBack(Handle:menu, MenuAction:action, Client, select)
  8271. {
  8272. if(action == MenuAction_Select)
  8273. {
  8274. ADMTagChangeColor2(Client, select+1);
  8275. }
  8276. if(action == MenuAction_Cancel)
  8277. {
  8278. if(select == MenuCancel_ExitBack)
  8279. {
  8280. VIPOption(Client);
  8281. }
  8282. }
  8283. if(action == MenuAction_End)
  8284. {
  8285. CloseHandle(menu);
  8286. }
  8287. }
  8288.  
  8289. public ADMTagChangeColor2(Client, Color)
  8290. {
  8291. new Handle:menuhandle = CreateMenu(ADMTagChangeColor2_CallBack);
  8292. if(Color == 1) SetMenuTitle(menuhandle, "-- ADM Tag red color set --");
  8293. else if(Color == 2) SetMenuTitle(menuhandle, "-- ADM Tag green color set --");
  8294. else if(Color == 3) SetMenuTitle(menuhandle, "-- ADM Tag blue color set --");
  8295. else SetMenuTitle(menuhandle, "-- ADM Tag light set --");
  8296. new String:StringColor[256], String:Formatting[256];
  8297. IntToString(Color, StringColor, 256);
  8298. for(new i= 1; i <= 36; i++)
  8299. {
  8300. Format(Formatting, 256, "%i ~ %i", ((i-1)*7), i*7-1);
  8301. AddMenuItem(menuhandle, StringColor, Formatting);
  8302. }
  8303. AddMenuItem(menuhandle, StringColor, "252 ~ 255");
  8304. SetMenuExitButton(menuhandle, true);
  8305. SetMenuExitBackButton(menuhandle, true);
  8306. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  8307. }
  8308.  
  8309. public ADMTagChangeColor2_CallBack(Handle:menu, MenuAction:action, Client, select)
  8310. {
  8311. if(action == MenuAction_Select)
  8312. {
  8313. new String:info[256];
  8314. GetMenuItem(menu, select, info, 256);
  8315. ADMTagChangeColor3(Client, info, select);
  8316. }
  8317. if(action == MenuAction_Cancel)
  8318. {
  8319. if(select == MenuCancel_ExitBack)
  8320. {
  8321. ADMTagChangeColor(Client);
  8322. }
  8323. }
  8324. if(action == MenuAction_End)
  8325. {
  8326. CloseHandle(menu);
  8327. }
  8328. }
  8329.  
  8330. public ADMTagChangeColor3(Client, String:Color[256], Number)
  8331. {
  8332. new Handle:menuhandle = CreateMenu(ADMTagChangeColor3_CallBack);
  8333. if(StringToInt(Color) == 1) SetMenuTitle(menuhandle, "-- ADM 태그 빨간색 수정 --");
  8334. else if(StringToInt(Color) == 2) SetMenuTitle(menuhandle, "-- ADM 태그 초록색 수정 --");
  8335. else if(StringToInt(Color) == 2) SetMenuTitle(menuhandle, "-- ADM 태그 파란색 수정 --");
  8336. else SetMenuTitle(menuhandle, "-- ADM 태그 투명값 수정 --");
  8337. new String:Formatting[256], String:Color2[256];
  8338. if(Number == 36)
  8339. {
  8340. for(new i; i < 4; i++)
  8341. {
  8342. Format(Formatting, 256, "%i", Number*7+i);
  8343. Format(Color2, 256, "%s^%i", Color, Number*7+i);
  8344. AddMenuItem(menuhandle, Color2, Formatting);
  8345. }
  8346. }
  8347. else
  8348. {
  8349. for(new i; i < 7; i++)
  8350. {
  8351. Format(Formatting, 256, "%i", Number*7+i);
  8352. Format(Color2, 256, "%s^%i", Color, Number*7+i);
  8353. AddMenuItem(menuhandle, Color2, Formatting);
  8354. }
  8355. }
  8356. SetMenuExitButton(menuhandle, true);
  8357. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  8358. }
  8359.  
  8360. public ADMTagChangeColor3_CallBack(Handle:menu, MenuAction:action, Client, select)
  8361. {
  8362. if(action == MenuAction_Select)
  8363. {
  8364. new String:info[256], String:EString[2][128];
  8365. GetMenuItem(menu, select, info, 256);
  8366. ExplodeString(info, "^", EString, 2, 128);
  8367.  
  8368. new String:query[512], String:SteamID[256];
  8369. GetClientAuthString(Client, SteamID, 256);
  8370. if(StringToInt(EString[0]) == 1)
  8371. {
  8372. Format(query, 512, "UPDATE admtag SET red = '%i' WHERE steamid = '%s';", StringToInt(EString[1]), SteamID);
  8373. PrintChat(Client, "\x07FF3A3ARed Code set to %i.", StringToInt(EString[1]));
  8374. }
  8375. else if(StringToInt(EString[0]) == 2)
  8376. {
  8377. Format(query, 512, "UPDATE admtag SET green = '%i' WHERE steamid = '%s';", StringToInt(EString[1]), SteamID);
  8378. PrintChat(Client, "\x07FF3A3AGreen Code set to %i.", StringToInt(EString[1]));
  8379. }
  8380. else if(StringToInt(EString[0]) == 3)
  8381. {
  8382. Format(query, 512, "UPDATE admtag SET blue = '%i' WHERE steamid = '%s';", StringToInt(EString[1]), SteamID);
  8383. PrintChat(Client, "\x07FF3A3ABlue Code set to %i.", StringToInt(EString[1]));
  8384. }
  8385. else
  8386. {
  8387. Format(query, 512, "UPDATE admtag SET alpha = '%i' WHERE steamid = '%s';", StringToInt(EString[1]), SteamID);
  8388. PrintChat(Client, "\x07FF3A3Aalpha Code set to %i.", StringToInt(EString[1]));
  8389. }
  8390. SQL_TQuery(databasehandle, save_info, query, Client);
  8391. Format(query, 512, "SELECT * FROM admtag WHERE steamid = '%s';", SteamID);
  8392. SQL_TQuery(databasehandle, admtag_check, query, Client);
  8393. }
  8394. if(action == MenuAction_End)
  8395. {
  8396. CloseHandle(menu);
  8397. }
  8398. }
  8399.  
  8400. public Log_Year(Client)
  8401. {
  8402. new Handle:menuhandle = CreateMenu(Log_Year_CallBack);
  8403. SetMenuTitle(menuhandle, "Select year.(Log)");
  8404. AddMenuItem(menuhandle, "2012", "2012");
  8405. AddMenuItem(menuhandle, "2013", "2013");
  8406. SetMenuExitButton(menuhandle, true);
  8407. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  8408. }
  8409.  
  8410. public Log_Year_CallBack(Handle:menu, MenuAction:action, Client, select)
  8411. {
  8412. if(action == MenuAction_Select)
  8413. {
  8414. new String:info[256];
  8415. GetMenuItem(menu, select, info, 256);
  8416. Log_Month(Client, info);
  8417. }
  8418. if(action == MenuAction_End)
  8419. {
  8420. CloseHandle(menu);
  8421. }
  8422. }
  8423.  
  8424. public Log_Month(Client, String:info[256])
  8425. {
  8426. new Handle:menuhandle = CreateMenu(Log_Month_CallBack);
  8427. SetMenuTitle(menuhandle, "Select month.(Log):%s", info);
  8428. new String:Formatting[256], String:Formatting2[256];
  8429. for(new i=1; i<=12; i++)
  8430. {
  8431. if(i < 10) Format(Formatting, 256, "%s/0%i", info, i);
  8432. else Format(Formatting, 256, "%s/%i", info, i);
  8433. Format(Formatting2, 256, "%i Month", i);
  8434. AddMenuItem(menuhandle, Formatting, Formatting2);
  8435. }
  8436. SetMenuExitButton(menuhandle, true);
  8437. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  8438. }
  8439.  
  8440. public Log_Month_CallBack(Handle:menu, MenuAction:action, Client, select)
  8441. {
  8442. if(action == MenuAction_Select)
  8443. {
  8444. new String:info[256];
  8445. GetMenuItem(menu, select, info, 256);
  8446. Log_Day(Client, info);
  8447. }
  8448. if(action == MenuAction_End)
  8449. {
  8450. CloseHandle(menu);
  8451. }
  8452. }
  8453.  
  8454. public Log_Day(Client, String:info[256])
  8455. {
  8456. new Handle:menuhandle = CreateMenu(Log_Day_CallBack);
  8457. SetMenuTitle(menuhandle, "Select day.(Log):%s", info);
  8458. new String:Formatting[256], String:Formatting2[256];
  8459. for(new i=1; i<=31; i++)
  8460. {
  8461. if(i < 10) Format(Formatting, 256, "%s/0%i", info, i);
  8462. else Format(Formatting, 256, "%s/%i", info, i);
  8463. Format(Formatting2, 256, "%i Day", i);
  8464. AddMenuItem(menuhandle, Formatting, Formatting2);
  8465. }
  8466. SetMenuExitButton(menuhandle, true);
  8467. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  8468. }
  8469.  
  8470. public Log_Day_CallBack(Handle:menu, MenuAction:action, Client, select)
  8471. {
  8472. if(action == MenuAction_Select)
  8473. {
  8474. new String:info[256];
  8475. GetMenuItem(menu, select, info, 256);
  8476. Log_Hour(Client, info);
  8477. }
  8478. if(action == MenuAction_End)
  8479. {
  8480. CloseHandle(menu);
  8481. }
  8482. }
  8483.  
  8484. public Log_Hour(Client, String:info[256])
  8485. {
  8486. new Handle:menuhandle = CreateMenu(Log_Hour_CallBack);
  8487. SetMenuTitle(menuhandle, "Select time.(Log):%s", info);
  8488. new String:Formatting[256], String:Formatting2[256];
  8489. AddMenuItem(menuhandle, info, "See hour set logs");
  8490. for(new i; i<24; i++)
  8491. {
  8492. if(i < 10) Format(Formatting, 256, "%s - 0%i", info, i);
  8493. else Format(Formatting, 256, "%s - %i", info, i);
  8494. Format(Formatting2, 256, "%i시", i);
  8495. AddMenuItem(menuhandle, Formatting, Formatting2);
  8496. }
  8497. SetMenuExitButton(menuhandle, true);
  8498. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  8499. }
  8500.  
  8501. public Log_Hour_CallBack(Handle:menu, MenuAction:action, Client, select)
  8502. {
  8503. if(action == MenuAction_Select)
  8504. {
  8505. new String:info[256];
  8506. GetMenuItem(menu, select, info, 256);
  8507. if(!select) Log_Type(Client, info);
  8508. if(select) Log_Minute(Client, info);
  8509. }
  8510. if(action == MenuAction_End)
  8511. {
  8512. CloseHandle(menu);
  8513. }
  8514. }
  8515.  
  8516. public Log_Minute(Client, String:info[256])
  8517. {
  8518. new Handle:menuhandle = CreateMenu(Log_Minute_CallBack);
  8519. SetMenuTitle(menuhandle, "Select minutes.(Log):%s", info);
  8520. new String:Formatting[256], String:Formatting2[256];
  8521. AddMenuItem(menuhandle, info, "See Minute set log");
  8522. for(new i; i<=59; i++)
  8523. {
  8524. if(i < 10) Format(Formatting, 256, "%s:0%i", info, i);
  8525. else Format(Formatting, 256, "%s:%i", info, i);
  8526. Format(Formatting2, 256, "%i Min", i);
  8527. AddMenuItem(menuhandle, Formatting, Formatting2);
  8528. }
  8529. SetMenuExitButton(menuhandle, true);
  8530. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  8531. }
  8532.  
  8533. public Log_Minute_CallBack(Handle:menu, MenuAction:action, Client, select)
  8534. {
  8535. if(action == MenuAction_Select)
  8536. {
  8537. new String:info[256];
  8538. GetMenuItem(menu, select, info, 256);
  8539. Log_Type(Client, info);
  8540. }
  8541. if(action == MenuAction_End)
  8542. {
  8543. CloseHandle(menu);
  8544. }
  8545. }
  8546.  
  8547. public Log_Type(Client, String:info[256])
  8548. {
  8549. new Handle:menuhandle = CreateMenu(Log_Type_CallBack);
  8550. SetMenuTitle(menuhandle, "로그 타입을 정하세요.(로그):%s", info);
  8551. AddMenuItem(menuhandle, info, "전체 로그 보기");
  8552. AddMenuItem(menuhandle, info, "Death 로그 보기");
  8553. AddMenuItem(menuhandle, info, "Hurt 로그 보기");
  8554. AddMenuItem(menuhandle, info, "get DNA 로그 보기");
  8555. AddMenuItem(menuhandle, info, "DNA result 로그 보기");
  8556. AddMenuItem(menuhandle, info, "귓속말 로그 보기");
  8557. AddMenuItem(menuhandle, info, "넉백 로그 보기");
  8558. AddMenuItem(menuhandle, info, "DNA Scan 시작 로그 보기");
  8559. SetMenuExitButton(menuhandle, true);
  8560. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  8561. }
  8562.  
  8563. public Log_Type_CallBack(Handle:menu, MenuAction:action, Client, select)
  8564. {
  8565. if(action == MenuAction_Select)
  8566. {
  8567. new String:info[256];
  8568. GetMenuItem(menu, select, info, 256);
  8569. if(!select)
  8570. {
  8571. new Handle:pack = CreateDataPack();
  8572. WritePackCell(pack, Client);
  8573. WritePackString(pack, info);
  8574. SQL_TQuery(databasehandle, ShowLog, "SELECT * FROM log;", pack);
  8575. }
  8576. else
  8577. {
  8578. new String:Formatting[256];
  8579. Format(Formatting, 256, "SELECT * FROM log WHERE type = '%i';", select-1);
  8580. new Handle:pack = CreateDataPack();
  8581. WritePackCell(pack, Client);
  8582. WritePackString(pack, info);
  8583. SQL_TQuery(databasehandle, ShowLog, Formatting, pack);
  8584. }
  8585. }
  8586. if(action == MenuAction_End)
  8587. {
  8588. CloseHandle(menu);
  8589. }
  8590. }
  8591.  
  8592. public ShowLog(Handle:owner, Handle:handle, const String:error[], any:pack)
  8593. {
  8594. ResetPack(pack);
  8595. new Client = ReadPackCell(pack);
  8596. new String:Time[128], String:Date[128], String:Log[256], bool:check, count;
  8597. ReadPackString(pack, Time, 128);
  8598. if(handle == INVALID_HANDLE)
  8599. {
  8600. LogError("Show Log Error: %s", error);
  8601. PrintChat(Client, "Show Log Error");
  8602. }
  8603. else if(SQL_GetRowCount(handle))
  8604. {
  8605. new Handle:menuhandle = CreateMenu(NULL_CallBack);
  8606. SetMenuTitle(menuhandle, "Log : %s", Time);
  8607. new counted = SQL_GetRowCount(handle);
  8608. if(counted > 0)
  8609. {
  8610. if(SQL_HasResultSet(handle))
  8611. {
  8612. while(SQL_FetchRow(handle))
  8613. {
  8614. SQL_FetchString(handle, 2, Date, 128);
  8615. if(StrContains(Date, Time, false) == 0)
  8616. {
  8617. SQL_FetchString(handle, 1, Log, 256);
  8618. if(count % 3 != 0)
  8619. {
  8620. AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  8621. AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  8622. }
  8623. Format(Log, 256, "%s{%s}", Log, Date);
  8624. AddMenuItem(menuhandle, Log, Log, ITEMDRAW_DISABLED);
  8625. check = true;
  8626. count++;
  8627. }
  8628. }
  8629. }
  8630. }
  8631. if(check)
  8632. {
  8633. SetMenuExitButton(menuhandle, true);
  8634. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  8635. }
  8636. else PrintChat(Client, "해당 로그가 존재하지 않습니다.");
  8637. }
  8638. }
  8639.  
  8640. public WeaponMenu(Client)
  8641. {
  8642. new Handle:menuhandle = CreateMenu(WeaponMenu_CallBack);
  8643. SetMenuTitle(menuhandle, "-- 무기 메뉴 --");
  8644. AddMenuItem(menuhandle, "light_dynamic", "light");
  8645. AddMenuItem(menuhandle, "weapon_mac10", "mac10");
  8646. AddMenuItem(menuhandle, "weapon_tmp", "tmp");
  8647. AddMenuItem(menuhandle, "weapon_mp5navy", "MP5");
  8648. AddMenuItem(menuhandle, "weapon_p90", "피구공");
  8649. AddMenuItem(menuhandle, "weapon_scout", "스카웃");
  8650. AddMenuItem(menuhandle, "weapon_m4a1", "M4A1");
  8651. AddMenuItem(menuhandle, "weapon_ak47", "AK47");
  8652. AddMenuItem(menuhandle, "weapon_galil", "갈릴");
  8653. AddMenuItem(menuhandle, "weapon_m3", "펌프샷건");
  8654. AddMenuItem(menuhandle, "weapon_xm1014", "자동샷건");
  8655. AddMenuItem(menuhandle, "weapon_m249", "M249");
  8656. AddMenuItem(menuhandle, "weapon_glock", "글록");
  8657. AddMenuItem(menuhandle, "weapon_deagle", "데글");
  8658. AddMenuItem(menuhandle, "weapon_fiveseven", "파이브세븐");
  8659. SetMenuExitButton(menuhandle, true);
  8660. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  8661. }
  8662.  
  8663. public WeaponMenu_CallBack(Handle:menu, MenuAction:action, Client, select)
  8664. {
  8665. if(action == MenuAction_Select)
  8666. {
  8667. new String:info[256], String:CurrentMap[256];
  8668. GetMenuItem(menu, select, info, 256);
  8669. GetCurrentMap(CurrentMap, 256);
  8670. new Float:cleyepos[3], Float:cleyeangle[3], Float:resultposition[3], Float:normalvector[3];
  8671. GetClientEyePosition(Client, cleyepos);
  8672. GetClientEyeAngles(Client, cleyeangle);
  8673. new Handle:traceresulthandle = INVALID_HANDLE;
  8674. traceresulthandle = TR_TraceRayFilterEx(cleyepos, cleyeangle, MASK_SOLID, RayType_Infinite, tracerayfilternoplayer, Client);
  8675. if(TR_DidHit(traceresulthandle) == true)
  8676. {
  8677. TR_GetEndPosition(resultposition, traceresulthandle);
  8678. TR_GetPlaneNormal(traceresulthandle, normalvector);
  8679. NormalizeVector(normalvector, normalvector);
  8680. ScaleVector(normalvector, 5.0);
  8681. AddVectors(resultposition, normalvector, resultposition);
  8682. new Handle:kv= CreateKeyValues("TTTWeapons");
  8683. if(FileExists(Path))
  8684. {
  8685. FileToKeyValues(kv, Path);
  8686. }
  8687. new String:LastBuffer[256];
  8688. KvGotoFirstSubKey(kv);
  8689. do
  8690. {
  8691. new String:buffer[256];
  8692. KvGetSectionName(kv, buffer, sizeof(buffer));
  8693. if(StrEqual(buffer, CurrentMap, false))
  8694. {
  8695. KvJumpToKey(kv, CurrentMap, false);
  8696. KvGotoFirstSubKey(kv);
  8697. do
  8698. {
  8699. KvGetSectionName(kv, buffer, sizeof(buffer));
  8700. LastBuffer = buffer;
  8701. }
  8702. while(KvGotoNextKey(kv));
  8703. break;
  8704. }
  8705. }while(KvGotoNextKey(kv));
  8706. KvRewind(kv);
  8707. KvJumpToKey(kv, CurrentMap, true);
  8708. ReplaceStringEx(LastBuffer, 256, CurrentMap, "");
  8709. new Count = StringToInt(LastBuffer);
  8710. Format(LastBuffer, 256, "%i", Count+1);
  8711. KvJumpToKey(kv, LastBuffer, true);
  8712. KvSetVector(kv, "weapon", resultposition);
  8713. KvSetString(kv, "weapon2", info);
  8714. KvRewind(kv);
  8715. KeyValuesToFile(kv, Path);
  8716. CloseHandle(kv);
  8717. new entity = CreateEntityByName(info);
  8718. if(StrContains(info, "light", false) == 0)
  8719. {
  8720. DispatchKeyValue(entity, "_light", "255 255 255");
  8721. DispatchKeyValue(entity, "brightness", "3");
  8722. DispatchKeyValue(entity, "spotlight_radius", "1000");
  8723. DispatchKeyValue(entity, "pitch", "-90");
  8724. DispatchKeyValue(entity, "distance", "300");
  8725. }
  8726. DispatchSpawn(entity);
  8727. if(StrContains(info, "light", false) == 0)
  8728. {
  8729. AcceptEntityInput(entity, "TurnOn");
  8730. }
  8731. TeleportEntity(entity, resultposition, NULL_VECTOR, NULL_VECTOR);
  8732. PrintChatAll("\x03%s Spawned %.1f %.1f %.1f", info, resultposition[0], resultposition[1], resultposition[2]);
  8733. WeaponMenu(Client);
  8734. }
  8735. else PrintChat(Client, "\x03Error.\x05 잘못된 위치입니다.");
  8736. CloseHandle(traceresulthandle);
  8737. }
  8738. if(action == MenuAction_End)
  8739. {
  8740. CloseHandle(menu);
  8741. }
  8742. }
  8743.  
  8744. public Action:TextMsg(UserMsg:msg_id, Handle:bf, const players[], playersNum, bool:reliable, bool:init)
  8745. {
  8746. decl String:buffer[256];
  8747.  
  8748. buffer[0] = '\0';
  8749. BfReadString(bf, buffer, sizeof(buffer), false);
  8750.  
  8751. //팀원 때렸다고 txt뜨는거
  8752. if(StrContains(buffer, "Game_teammate_attack") != -1)
  8753. {
  8754. return Plugin_Handled;
  8755. }
  8756. //팀원 죽였다고 뜨는거
  8757. if(StrContains(buffer, "Killed_Teammate") != -1)
  8758. {
  8759. return Plugin_Handled;
  8760. }
  8761. return Plugin_Continue;
  8762. }
  8763.  
  8764. public Action:SayText2(UserMsg:msg_id, Handle:bf, const players[], playersNum, bool:reliable, bool:init)
  8765. {
  8766. decl String:buffer[256], String:buffer2[256];
  8767.  
  8768. buffer[0] = '\0';
  8769. BfReadString(bf, buffer, sizeof(buffer), false);
  8770. BfReadString(bf, buffer2, sizeof(buffer2), false);
  8771.  
  8772. //닉네임 바꿨다고 뜨는거
  8773. if(StrContains(buffer2, "#Cstrike_Name_Change") != -1)
  8774. {
  8775. return Plugin_Handled;
  8776. }
  8777. return Plugin_Continue;
  8778. }
  8779.  
  8780. public Action:hookRadioText(UserMsg:msg_id, Handle:bf, const players[], playersNum, bool:reliable, bool:init)
  8781. {
  8782. return Plugin_Handled;
  8783. }
  8784.  
  8785. public OnEntityCreated(entity, const String:classname[])
  8786. {
  8787. if(entity < 2048 && entity >= 0) ResetData_Entity(entity);
  8788. if(StrEqual(classname, "predicted_viewmodel", false))
  8789. {
  8790. SDKHook(entity, SDKHook_Spawn, OnEntitySpawned);
  8791. }
  8792. }
  8793.  
  8794. public Action:Missile(Handle:timer, any:Client)
  8795. {
  8796. if(JoinCheck(Client))
  8797. {
  8798. new Float:cleyepos[3], Float:cleyeangle[3], Float:Fwd[3];
  8799. GetClientEyePosition(Client, cleyepos);
  8800. GetClientEyeAngles(Client, cleyeangle);
  8801. GetAngleVectors(cleyeangle, Fwd, NULL_VECTOR, NULL_VECTOR);
  8802. NormalizeVector(Fwd, Fwd);
  8803. ScaleVector(Fwd, SquareRoot((16.0*16.0)+(16.0*16.0)));
  8804. AddVectors(cleyepos, Fwd, cleyepos);
  8805. Create_Missile(Client, cleyepos, cleyeangle, 2500.0, MissileTouchHook);
  8806. EmitSoundToAll("tttmusic/rpgfire1.mp3", Client, SNDCHAN_WEAPON, ATTN_TO_SNDLEVEL(0.28));
  8807. }
  8808. }
  8809.  
  8810. public OnEntitySpawned(entity)
  8811. {
  8812. new Owner = GetEntPropEnt(entity, Prop_Send, "m_hOwner");
  8813. if ((Owner > 0) && (Owner <= MaxClients))
  8814. {
  8815. if (GetEntProp(entity, Prop_Send, "m_nViewModelIndex") == 0)
  8816. {
  8817. ClientVM[Owner][0] = entity;
  8818. }
  8819. else if (GetEntProp(entity, Prop_Send, "m_nViewModelIndex") == 1)
  8820. {
  8821. ClientVM[Owner][1] = entity;
  8822. }
  8823. }
  8824. }
  8825.  
  8826. public bool:tracerayfilternoplayer(entity, mask, any:data){
  8827.  
  8828. if(!JoinCheck(entity)){
  8829.  
  8830. return true;
  8831.  
  8832. }else{
  8833.  
  8834. return false;
  8835.  
  8836. }
  8837.  
  8838. }
  8839.  
  8840. public bool:tracerayfilteronlyplayer(entity, mask, any:data){
  8841.  
  8842. if(JoinCheck(entity)){
  8843.  
  8844. return true;
  8845.  
  8846. }else{
  8847.  
  8848. return false;
  8849.  
  8850. }
  8851.  
  8852. }
  8853.  
  8854. public bool:tracerayfilteronlyplayer2(entity, mask, any:data){
  8855.  
  8856. if(JoinCheck(entity) && entity != data){
  8857.  
  8858. return true;
  8859.  
  8860. }else{
  8861.  
  8862. return false;
  8863.  
  8864. }
  8865.  
  8866. }
  8867.  
  8868. public bool:tracerayfilternoragdoll(entity, mask, any:data){
  8869.  
  8870. if(!JoinCheck(entity)){
  8871.  
  8872. if(!IsRagdoll[entity]){
  8873.  
  8874. return true;
  8875.  
  8876. }else{
  8877.  
  8878. return false;
  8879.  
  8880. }
  8881.  
  8882. }else{
  8883.  
  8884. return false;
  8885.  
  8886. }
  8887.  
  8888. }
  8889.  
  8890. public bool:tracerayfilterdefault(entity, mask, any:data)
  8891. {
  8892. if(entity != data)
  8893. return true;
  8894. else
  8895. return false;
  8896. }
  8897.  
  8898. public bool:tracerayfilternotarrow(entity, mask, any:data)
  8899. {
  8900. new String:classname[256];
  8901. if(IsValidEdict(entity)) GetEdictClassname(entity, classname, 256);
  8902. if(entity != data && !StrEqual(classname, "hegrenade_projectile"))
  8903. return true;
  8904. else
  8905. return false;
  8906. }
  8907.  
  8908. public bool:tracerayfilterrocket(entity, mask, any:data)
  8909. {
  8910. //로켓을 쏜 사람이 아니고, 그 사람의 물건도 아닐때만 필터에 감지
  8911. new owner = GetEntPropEnt(entity, Prop_Send, "m_hOwnerEntity");//닿은 물건의 주인을 구한다
  8912. if(entity != data && owner != data)
  8913. {
  8914. return true;
  8915. }
  8916. else
  8917. {
  8918. return false;
  8919. }
  8920. }
  8921.  
  8922. public bool:tracerayfilterrocketnotplayer(entity, mask, any:data)
  8923. {
  8924. //로켓을 쏜 사람이 아니고, 그 사람의 물건도 아닐때만 필터에 감지
  8925. new owner = GetEntPropEnt(entity, Prop_Send, "m_hOwnerEntity");//닿은 물건의 주인을 구한다
  8926. if(entity != data && owner != data)
  8927. {
  8928. if(!JoinCheck(entity)) return true;
  8929. else return false;
  8930. }
  8931. else
  8932. {
  8933. return false;
  8934. }
  8935. }
  8936.  
  8937. public bool:tracerayfilternotdefault(entity, contentsMask, any:data)
  8938. {
  8939. if(entity != data)
  8940. return false;
  8941.  
  8942. return true;
  8943. }
  8944.  
  8945. stock bool:JoinCheck(Client)
  8946. {
  8947. if(Client > 0 && Client <= MaxClients)
  8948. {
  8949. if(IsClientConnected(Client) == true)
  8950. {
  8951. if(IsClientInGame(Client) == true)
  8952. {
  8953. return true;
  8954. }
  8955. else return false;
  8956. }
  8957. else return false;
  8958. }
  8959. else return false;
  8960. }
  8961.  
  8962. stock FormatTime_Hud(Client, Float:time, String:strTime[], iSize)
  8963. {
  8964. new second, minute;
  8965. decl String:st_sec[128], String:st_min[128];
  8966. second = RoundToZero(GetEngineTime() - time);
  8967. if(second >= 60)
  8968. {
  8969. minute = second / 60;
  8970. second = second % 60;
  8971. }
  8972. if(minute < 10)
  8973. Format(st_min, 128, "0%d%T", minute, "minute", Client);
  8974. else
  8975. Format(st_min, 128, "%d%T", minute, "minute", Client);
  8976. if(second < 10)
  8977. Format(st_sec, 128, "0%d%T", second, "second", Client);
  8978. else
  8979. Format(st_sec, 128, "%d%T", second, "second", Client);
  8980. Format(strTime, iSize, "%s%s", st_min, st_sec);
  8981. }
  8982.  
  8983. stock FormatTime_Hud2(Client, time, String:strTime[], iSize)
  8984. {
  8985. new second, minute;
  8986. decl String:st_sec[128], String:st_min[128];
  8987. second = time;
  8988. if(second >= 60)
  8989. {
  8990. minute = second / 60;
  8991. second = second % 60;
  8992. }
  8993. if(minute < 10)
  8994. Format(st_min, 128, "0%d%T", minute, "minute", Client);
  8995. else
  8996. Format(st_min, 128, "%d%T", minute, "minute", Client);
  8997. if(second < 10)
  8998. Format(st_sec, 128, "0%d%T", second, "second", Client);
  8999. else
  9000. Format(st_sec, 128, "%d%T", second, "second", Client);
  9001. Format(strTime, iSize, "%s%s", st_min, st_sec);
  9002. }
  9003.  
  9004. stock FormatTime_Hud3(Float:time, String:strTime[], iSize)
  9005. {
  9006. new second, minute, hour;
  9007. decl String:st_sec[128], String:st_min[128], String:st_hr[128];
  9008. second = RoundToNearest(time);
  9009. if(second >= 60)
  9010. {
  9011. minute = second / 60;
  9012. second = second % 60;
  9013. }
  9014. if(minute >= 60)
  9015. {
  9016. hour = minute / 60;
  9017. minute = minute % 60;
  9018. }
  9019. if(hour < 10)
  9020. Format(st_hr, 128, "0%d:", hour);
  9021. else
  9022. Format(st_hr, 128, "%d:", hour);
  9023. if(minute < 10)
  9024. Format(st_min, 128, "0%d:", minute);
  9025. else
  9026. Format(st_min, 128, "%d:", minute);
  9027. if(second < 10)
  9028. Format(st_sec, 128, "0%d", second);
  9029. else
  9030. Format(st_sec, 128, "%d", second);
  9031. Format(strTime, iSize, "%s%s%s", st_hr, st_min, st_sec);
  9032. }
  9033.  
  9034. stock GetRandomPlayer(bool:IsTraitor, R1 = -1, R2 = -1, R3 = -1, R4 = -1, R5 = -1, R6 = -1, R7 = -1, R8 = -1, R9 = -1, R10 = -1, R11 = -1, R12 = -1)
  9035. {
  9036. new iList[MAXPLAYERS];
  9037. new iCount;
  9038. new String:SteamID[256], String:Time_Hour[3];
  9039. FormatTime(Time_Hour, 3, "%H", GetTime());
  9040. for(new i = 1; i <= MaxClients; i++)
  9041. {
  9042. if((IsClientInGame(i)) && (GetClientTeam(i) != 1) && IsPlayerAlive(i) && i != Bot && i != R1 && i != R2 && i != R3 && i != R4 && i != R5 && i != R6 && i != R7 && i != R8 && i != R9 && i != R10 && i != R11 && i != R12)
  9043. {
  9044. GetClientAuthString(i, SteamID, 256);
  9045. if((StringToInt(Time_Hour) != 20 && StringToInt(Time_Hour) != 21) || !StrEqual(SteamID, BJ_SteamID) || !IsTraitor )
  9046. {
  9047. iList[iCount] = i;
  9048. iCount++;
  9049. }
  9050. }
  9051. }
  9052. if(iCount == 0)
  9053. {
  9054. return -1;
  9055. }
  9056. new iRandomIndex = GetRandomInt(0, iCount-1);
  9057. return iList[iRandomIndex];
  9058. }
  9059.  
  9060. stock ResetData_Player(Client)
  9061. {
  9062. Fun[Client] = false;
  9063. BlockWeaponUse[Client] = false;
  9064. BuyAcceptWeapon[Client] = false;
  9065. IsHeadShot[Client] = false;
  9066. Weapon[Client] = "";
  9067. Job[Client] = 0;
  9068. Sprites[Client] = 0;
  9069. DNASprites[Client] = 0;
  9070. Credit[Client] = 0;
  9071. TraitorKillList[Client] = "";
  9072. IronShoes[Client] = false;
  9073. SpeedBoots[Client] = false;
  9074. Radar[Client] = false;
  9075. RadarCount[Client] = 0;
  9076. Dagger[Client] = false;
  9077. SuperCrowbar[Client] = false;
  9078. SetEntProp(Client, Prop_Data, "m_ArmorValue", 0);
  9079. DNASample[Client][0] = "";
  9080. DNASample[Client][1] = "";
  9081. DNAScanning[Client] = false;
  9082. ScanCount[Client] = 0;
  9083. HealDelay[Client] = false;
  9084. HealSoundDelay[Client] = false;
  9085. HitLog[Client] = "";
  9086. AttackLog[Client] = "";
  9087. Ragdoll[Client] = 0;
  9088. ChosenJoin[Client] = false;
  9089. BuyDagger[Client] = false;
  9090. BuyGoldenGun[Client] = false;
  9091. BuyRPG[Client] = false;
  9092. BuySG552[Client] = false;
  9093. BuyTVirus[Client] = false;
  9094. IsJihad[Client] = false;
  9095. Disguise[Client] = false;
  9096. IsDisguise[Client] = false;
  9097. JammerEntity[Client] = 0;
  9098. BuyTeleporter[Client] = false;
  9099. TeleporterSavedPosition[Client] = false;
  9100. TeleporterDelay[Client] = false;
  9101. BuyCrossbow[Client] = false;
  9102. BuyUMP[Client] = false;
  9103. JihadSpark[Client] = 0;
  9104. for(new i; i < 5; i++)
  9105. {
  9106. Sample[Client][i][0] = "";
  9107. Sample[Client][i][1] = "";
  9108. }
  9109. LastSteamID[Client] = NULL_STRING;
  9110. VIP_Trails_RotatingEntity[Client] = 0;
  9111. }
  9112.  
  9113. stock ResetData_Entity(entity)
  9114. {
  9115. IsRagdoll[entity] = false;
  9116. for(new i; i<6;i++)
  9117. {
  9118. TargetDescription[entity][i] = "";
  9119. TargetDescription_bool[entity][i] = false;
  9120. }
  9121. CheckedBody[entity] = false;
  9122. RemainCredit[entity] = 0;
  9123. DNAInformation[entity] = "";
  9124. IsHealthBox[entity] = false;
  9125. HealthBox[entity] = 0;
  9126. IsVIPHealthBox[entity] = false;
  9127. IsDetectorHealthBox[entity] = false;
  9128. IsFakeHealthBox[entity] = false;
  9129. FakeHealthBoxOwner[entity] = 0;
  9130. GoldenGun[entity] = false;
  9131. Jihad[entity] = false;
  9132. RPG[entity] = false;
  9133. DNASignalJammer[entity] = false;
  9134. TVirus[entity] = false;
  9135. Teleporter[entity] = false;
  9136. TeleportCount[entity] = 0;
  9137. Crossbow[entity] = false;
  9138. UMP[entity] = false;
  9139. Silenced_Sniper_Rifle[entity] = false;
  9140. if(!JoinCheck(entity))
  9141. {
  9142. SDKUnhook(entity, SDKHook_PostThinkPost, OnPostThinkPost);
  9143. SDKUnhook(entity, SDKHook_PostThink, OnPostThink);
  9144. }
  9145. }
  9146.  
  9147. stock bool:AdminCheck(Client)
  9148. {
  9149. //return (GetUserAdmin(Client) == INVALID_ADMIN_ID) ? 0 : 1;
  9150. if(GetUserAdmin(Client) != INVALID_ADMIN_ID)
  9151. {
  9152. if(GetAdminFlag(GetUserAdmin(Client), Admin_Root)) return true;
  9153. else return false;
  9154. }
  9155. return false;
  9156. }
  9157.  
  9158. stock sendKeyHintTextMsg(client, String:msg[], any:...)
  9159. {
  9160. new Handle:hudhandle = INVALID_HANDLE;
  9161. hudhandle = StartMessageOne("KeyHintText", client);
  9162.  
  9163. if(hudhandle != INVALID_HANDLE)
  9164. {
  9165. new String:txt[255];
  9166. VFormat(txt, sizeof(txt), msg, 3);
  9167. BfWriteByte(hudhandle, 1);
  9168. BfWriteString(hudhandle, txt);
  9169. EndMessage();
  9170. }
  9171. }
  9172.  
  9173. stock RGBToHex(R, G, B, A=255, bool:withAlpha=false)
  9174. {
  9175. return withAlpha ? ((R & 0xff) << 24) | ((G & 0xff) << 16) | ((B & 0xff) << 8) | (A & 0xff) : ((R & 0xff) << 16) | ((G & 0xff) << 8) | (B & 0xff);
  9176. }
  9177.  
  9178. stock AddFolderToDownloadsTable(const String:sDirectory[], const String:contain_word[] = "")
  9179. {
  9180. decl String:sFilename[128], String:sPath[256];
  9181. new Handle:hDirectory = OpenDirectory(sDirectory);
  9182. if(hDirectory != INVALID_HANDLE)
  9183. {
  9184. decl FileType:Type;
  9185.  
  9186. while(ReadDirEntry(hDirectory, sFilename, sizeof(sFilename), Type))
  9187. {
  9188. if(Type == FileType_Directory)
  9189. {
  9190. if(FindCharInString(sFilename, '.') == -1)
  9191. {
  9192. Format(sPath, sizeof(sPath), "%s/%s", sDirectory, sFilename);
  9193. AddFolderToDownloadsTable(sPath, contain_word);
  9194. }
  9195. }
  9196. else if(Type == FileType_File)
  9197. {
  9198. if(StrContains(sFilename, contain_word, false) != -1)
  9199. {
  9200. Format(sPath, sizeof(sPath), "%s/%s", sDirectory, sFilename);
  9201. AddFileToDownloadsTable(sPath);
  9202.  
  9203. new iPos = FindCharInString(sPath, '.', true);
  9204.  
  9205. if(iPos != -1)
  9206. {
  9207. if(StrEqual(sPath[iPos], ".mdl") || StrEqual(sPath[iPos], ".vmt"))
  9208. {
  9209. PrecacheModel(sPath, true);
  9210. }
  9211. else if(StrEqual(sPath[iPos], ".mp3") || StrEqual(sPath[iPos], ".wav"))
  9212. {
  9213. ReplaceStringEx(sPath, sizeof(sPath), "sound/", "");
  9214. PrecacheSound(sPath, true);
  9215. }
  9216. }
  9217. }
  9218. }
  9219. }
  9220. CloseHandle(hDirectory);
  9221. }
  9222. }
  9223.  
  9224. stock PrintChat(client, const String:message[], any:...)
  9225. {
  9226. /********************Print Chat********************/
  9227. decl String:buffer[512];
  9228. SetGlobalTransTarget(client);
  9229. VFormat(buffer, sizeof(buffer), message, 3);
  9230. new UserMsg:index = GetUserMessageId("SayText2");
  9231. if(index == INVALID_MESSAGE_ID) {
  9232. PrintToChat(client, message);
  9233. return;
  9234. }
  9235. new Handle:bf = StartMessageOne("SayText2", client, USERMSG_RELIABLE|USERMSG_BLOCKHOOKS);
  9236. BfWriteByte(bf, client);
  9237. BfWriteByte(bf, 0);
  9238. BfWriteString(bf, buffer);
  9239. EndMessage();
  9240. /********************Print Console********************/
  9241. new String:buffer2[500];
  9242. VFormat(buffer2, sizeof(buffer2), message, 3);
  9243. RemoveChatCode(buffer2, buffer2, sizeof(buffer2));
  9244. ReplaceString(buffer2, strlen(buffer2), "%", "%%");
  9245. PrintToConsole(client, buffer2);
  9246. }
  9247.  
  9248. stock RemoveChatCode(const String:message[], String:buffer[], bufferlen)
  9249. {
  9250. strcopy(buffer, bufferlen, message);
  9251. while(StrContains(buffer, "\x01") != -1) ReplaceString(buffer, bufferlen, "\x01", "");
  9252. while(StrContains(buffer, "\x03") != -1) ReplaceString(buffer, bufferlen, "\x03", "");
  9253. while(StrContains(buffer, "\x04") != -1) ReplaceString(buffer, bufferlen, "\x04", "");
  9254. while(StrContains(buffer, "\x05") != -1) ReplaceString(buffer, bufferlen, "\x05", "");
  9255. while(StrContains(buffer, "\x07") != -1)
  9256. {
  9257. new test = StrContains(buffer, "\x07");
  9258. ReplaceStringEx(buffer, bufferlen, "\x07", "");
  9259. for(new i; i<6; i++) Format(buffer[test], strlen(buffer), "%s", buffer[test+1]);
  9260. }
  9261. while(StrContains(buffer, "\x08") != -1)
  9262. {
  9263. new test = StrContains(buffer, "\x08");
  9264. ReplaceStringEx(buffer, bufferlen, "\x08", "");
  9265. for(new i; i<8; i++) Format(buffer[test], strlen(buffer), "%s", buffer[test+1]);
  9266. }
  9267. }
  9268.  
  9269. stock PrintChatAll(const String:format[], any:...)
  9270. {
  9271. decl String:buffer[192];
  9272. for(new i = 1; i <= MaxClients; i++)
  9273. {
  9274. if(IsClientInGame(i))
  9275. {
  9276. SetGlobalTransTarget(i);
  9277. VFormat(buffer, sizeof(buffer), format, 2);
  9278. PrintChat(i, buffer);
  9279. }
  9280. }
  9281. }
  9282.  
  9283. stock CreateVMT(Client, Float:pos[3], const String:Model[], Float:size, bool:Follow=true)
  9284. {
  9285. new sprite = CreateEntityByName("env_sprite");
  9286. if(!IsModelPrecached(Model))
  9287. {
  9288. PrecacheModel(Model, true);
  9289. }
  9290. new String:spritename[128];
  9291. Format(spritename, 128, "sprite%d%f", GetURandomInt(), GetRandomFloat());
  9292. DispatchKeyValue(sprite, "targetname", spritename);
  9293. DispatchKeyValueFloat(sprite, "HDRColorScale", 1.0);
  9294. DispatchKeyValue(sprite, "renderamt", "255");
  9295. DispatchKeyValue(sprite, "rendercolor", "255 255 255");
  9296. DispatchKeyValue(sprite, "spawnflags", "1");
  9297. DispatchKeyValue(sprite, "rendermode", "5");
  9298. DispatchKeyValue(sprite, "model", Model);
  9299. DispatchKeyValue(sprite, "framerate", "0");
  9300. DispatchKeyValueFloat(sprite, "scale", size);
  9301. DispatchSpawn(sprite);
  9302. SetEntityModel(sprite, Model);
  9303. TeleportEntity(sprite, pos, NULL_VECTOR, NULL_VECTOR);
  9304. if(Follow)
  9305. {
  9306. SetVariantString("!activator");
  9307. AcceptEntityInput(sprite, "SetParent", Client, sprite, 0);
  9308. }
  9309. return sprite;
  9310. }
  9311.  
  9312. public Action:Hook_SetTransmit(entity, Client)
  9313. {
  9314. new sprite = Sprites[Client];
  9315. if(sprite && IsValidEdict(sprite))
  9316. {
  9317. if(sprite == entity)
  9318. {
  9319. return Plugin_Handled;
  9320. }
  9321. }
  9322. if(JoinCheck(Client) && IsPlayerAlive(Client) && Job[Client] != traitor)
  9323. {
  9324. return Plugin_Handled;
  9325. }
  9326. if(JoinCheck(Client))
  9327. {
  9328. new String:SteamID[256], String:Time_Hour[3];
  9329. GetClientAuthString(Client, SteamID, 256);
  9330. FormatTime(Time_Hour, 3, "%H", GetTime());
  9331. if(StrEqual(SteamID, BJ_SteamID) && !IsPlayerAlive(Client) && (StringToInt(Time_Hour) == 20 || StringToInt(Time_Hour) == 21)) return Plugin_Handled;
  9332. }
  9333. return Plugin_Continue;
  9334. }
  9335.  
  9336. public Action:Hook_SetTransmit2(entity, Client)
  9337. {
  9338. new sprite = DNASprites[Client];
  9339. if((sprite && IsValidEdict(sprite) && sprite == entity) || !IsPlayerAlive(Client))
  9340. {
  9341. return Plugin_Continue;
  9342. }
  9343. return Plugin_Handled;
  9344. }
  9345.  
  9346. public Action:Hook_SetTransmit3(entity, Client)
  9347. {
  9348. new sprite = Sprites[Client];
  9349. if(sprite && IsValidEdict(sprite))
  9350. {
  9351. if(sprite == entity)
  9352. {
  9353. return Plugin_Handled;
  9354. }
  9355. }
  9356. if(JoinCheck(Client))
  9357. {
  9358. if(JoinCheck(GetClientAimTarget(Client, false)) && entity == Sprites[GetClientAimTarget(Client, false)])
  9359. {
  9360. return Plugin_Continue;
  9361. }
  9362. }
  9363. return Plugin_Handled;
  9364. }
  9365.  
  9366. public Action:Hook_SetTransmit4(Target, Client)
  9367. {
  9368. if(JoinCheck(Client))
  9369. {
  9370. Visible[Target][Client] = true;
  9371. }
  9372. }
  9373.  
  9374. public Action:Hook_SetTransmit5(Target, Client)
  9375. {
  9376. if(JoinCheck(Client))
  9377. {
  9378. if(Job[Client] == detector) return Plugin_Continue;
  9379. return Plugin_Handled;
  9380. }
  9381. return Plugin_Continue;
  9382. }
  9383.  
  9384. public Action:Silenced_Think(entity, const String:propname[], &iValue, element)
  9385. {
  9386. new Owner = GetEntPropEnt(entity, Prop_Send, "m_hOwnerEntity");
  9387. if(JoinCheck(Owner))
  9388. {
  9389. new weapons = GetEntPropEnt(Owner, Prop_Data, "m_hActiveWeapon");
  9390. if(weapons == entity)
  9391. {
  9392. SetClientiClip2(weapons, Owner, GetEntProp(weapons, Prop_Send, "m_iClip1"));
  9393. iValue = -1;
  9394. return Plugin_Changed;
  9395. }
  9396. }
  9397. return Plugin_Continue;
  9398. }
  9399.  
  9400. public Action:Hook_OnWeaponEquip(client, weapon)
  9401. {
  9402. new String:WeaponName[32];
  9403. GetEdictClassname(weapon, WeaponName, 32);
  9404.  
  9405. if(StrEqual(WeaponName, "weapon_usp"))
  9406. {
  9407. SetEntProp(weapon, Prop_Send, "m_bSilencerOn", 1);
  9408. SetEntProp(weapon, Prop_Send, "m_weaponMode", 1);
  9409. }
  9410. if(StrEqual(WeaponName, "weapon_knife"))
  9411. {
  9412. SDKHook(weapon, SDKHook_SetTransmit, SetTransmit_CallBack);
  9413. }
  9414. }
  9415.  
  9416. stock Weapon_SetViewModelIndex(client, PModel)
  9417. {
  9418. new EntEffects = GetEntProp(ClientVM[client][0], Prop_Send, "m_fEffects");
  9419. EntEffects |= EF_NODRAW;
  9420. SetEntProp(ClientVM[client][0], Prop_Send, "m_fEffects", EntEffects);
  9421.  
  9422. EntEffects = GetEntProp(ClientVM[client][1], Prop_Send, "m_fEffects");
  9423. EntEffects &= ~EF_NODRAW;
  9424. SetEntProp(ClientVM[client][1], Prop_Send, "m_fEffects", EntEffects);
  9425.  
  9426. SetEntProp(ClientVM[client][1], Prop_Send, "m_nModelIndex", PModel);
  9427. SetEntPropEnt(ClientVM[client][1], Prop_Send, "m_hWeapon", GetEntPropEnt(ClientVM[client][0], Prop_Send, "m_hWeapon"));
  9428.  
  9429. SetEntProp(ClientVM[client][1], Prop_Send, "m_nSequence", GetEntProp(ClientVM[client][0], Prop_Send, "m_nSequence"));
  9430. SetEntPropFloat(ClientVM[client][1], Prop_Send, "m_flPlaybackRate", GetEntPropFloat(ClientVM[client][0], Prop_Send, "m_flPlaybackRate"));
  9431.  
  9432. IsCustom[client] = true;
  9433. }
  9434.  
  9435. stock Create_Missile(Client, Float:pos[3], Float:angle[3], Float:speed, SDKHookCB:callback)
  9436. {
  9437. new Float:anglevector[3];
  9438. GetAngleVectors(angle, anglevector, NULL_VECTOR, NULL_VECTOR);
  9439. NormalizeVector(anglevector, anglevector);
  9440. ScaleVector(anglevector, speed);
  9441. new entity = CreateEntityByName("hegrenade_projectile");
  9442. DispatchSpawn(entity);
  9443. new Float:vecmax[3] = {1.0, 1.0, 1.0};
  9444. new Float:vecmin[3] = {-1.0, -1.0, -1.0};
  9445. SetEntPropVector(entity, Prop_Send, "m_vecMins", vecmin);
  9446. SetEntPropVector(entity, Prop_Send, "m_vecMaxs", vecmax);
  9447. SetEntityMoveType(entity, MOVETYPE_FLY);
  9448. SetEntityModel(entity, "models/weapons/w_missile_launch.mdl");
  9449. TeleportEntity(entity, pos, angle, anglevector);
  9450. SetEntPropEnt(entity, Prop_Send, "m_hOwnerEntity", Client);
  9451. SDKHook(entity, SDKHook_StartTouch, callback);
  9452. return entity;
  9453. }
  9454.  
  9455. public Action:MissileTouchHook(entity, other)
  9456. {
  9457. new Client = GetEntPropEnt(entity, Prop_Send, "m_hOwnerEntity"), Float:entityposition[3];
  9458. GetEntPropVector(entity, Prop_Send, "m_vecOrigin", entityposition);
  9459. makeExplosion(Client, entity, entityposition, "RPG-7", 200, 250, 0.0);
  9460. EmitSoundToAll("weapons/explode3.wav", entity, SNDCHAN_WEAPON, SNDLEVEL_NORMAL, SND_NOFLAGS, 1.0, SNDPITCH_NORMAL, -1, entityposition);
  9461. AcceptEntityInput(entity, "Kill");
  9462. }
  9463.  
  9464. stock makeExplosion(attacker = 0, inflictor = -1, const Float:attackposition[3], const String:weaponname[] = "", magnitude = 100, radiusoverride = 0, Float:damageforce = 0.0, flags = 0)
  9465. {
  9466. new explosion = CreateEntityByName("env_explosion");
  9467. if(explosion != -1)
  9468. {
  9469. DispatchKeyValueVector(explosion, "Origin", attackposition);
  9470. decl String:intbuffer[64];
  9471. IntToString(magnitude, intbuffer, 64);
  9472. DispatchKeyValue(explosion,"iMagnitude", intbuffer);
  9473. if(radiusoverride > 0)
  9474. {
  9475. IntToString(radiusoverride, intbuffer, 64);
  9476. DispatchKeyValue(explosion,"iRadiusOverride", intbuffer);
  9477. }
  9478. if(damageforce > 0.0)
  9479. {
  9480. DispatchKeyValueFloat(explosion,"DamageForce", damageforce);
  9481. }
  9482. if(flags != 0)
  9483. {
  9484. IntToString(flags, intbuffer, 64);
  9485. DispatchKeyValue(explosion,"spawnflags", intbuffer);
  9486. }
  9487. //웨폰네임 오버라이드
  9488. if(!StrEqual(weaponname, "", false))
  9489. {
  9490. DispatchKeyValue(explosion,"classname", weaponname);
  9491. if(inflictor != -1)
  9492. {
  9493. DispatchKeyValue(inflictor,"classname", weaponname);
  9494. }
  9495. }
  9496. DispatchSpawn(explosion);
  9497. if(attacker != -1)
  9498. {
  9499. SetEntPropEnt(explosion, Prop_Send, "m_hOwnerEntity", attacker);
  9500. }
  9501. if(inflictor != -1)
  9502. {
  9503. SetEntPropEnt(explosion, Prop_Data, "m_hInflictor", inflictor);
  9504. }
  9505. AcceptEntityInput(explosion, "Explode");
  9506. if(~flags & 0x00000002)
  9507. {
  9508. AcceptEntityInput(explosion, "Kill");
  9509. }
  9510. return explosion;
  9511. }
  9512. else
  9513. {
  9514. return -1;
  9515. }
  9516. }
  9517.  
  9518. stock bool:makeDamage(attacker, target, damage, damagetype, Float:damageradius, const Float:attackposition[3], const String:weaponname[] = "")
  9519. {
  9520. new pointhurt = CreateEntityByName("point_hurt");
  9521. if(pointhurt != -1)
  9522. {
  9523. if(target != -1)
  9524. {
  9525. decl String:targetname[64];
  9526. Format(targetname, 128, "%f%f", GetEngineTime(), GetRandomFloat());
  9527. DispatchKeyValue(target,"TargetName", targetname);
  9528. DispatchKeyValue(pointhurt,"DamageTarget", targetname);
  9529. }
  9530. DispatchKeyValueVector(pointhurt, "Origin", attackposition);
  9531. decl String:number[64];
  9532. IntToString(damage, number, 64);
  9533. DispatchKeyValue(pointhurt,"Damage", number);
  9534. IntToString(damagetype, number, 64);
  9535. DispatchKeyValue(pointhurt,"DamageType", number);
  9536. DispatchKeyValueFloat(pointhurt, "DamageRadius", damageradius);
  9537. if(!StrEqual(weaponname, "", false))
  9538. {
  9539. DispatchKeyValue(pointhurt,"classname", weaponname);
  9540. }
  9541. DispatchSpawn(pointhurt);
  9542. AcceptEntityInput(pointhurt, "Hurt", attacker != -1 ? attacker : 0);
  9543. AcceptEntityInput(pointhurt, "Kill");
  9544. return true;
  9545. }
  9546. else
  9547. {
  9548. return false;
  9549. }
  9550. }
  9551.  
  9552. stock makeExplosionDamage(Client, Float:entityposition[3], Float:radius, Float:damage, const String:WeaponName[], bool:explosion = true, flags = 0)
  9553. {
  9554. for(new i=1; i<=MaxClients; i++)
  9555. {
  9556. if(JoinCheck(i) && IsPlayerAlive(i) && GetClientTeam(Client) != GetClientTeam(i))
  9557. {
  9558. new Float:Position[3];
  9559. GetClientEyePosition(i, Position);
  9560. new Handle:traceresulthandle = TR_TraceRayFilterEx(entityposition, Position, MASK_SOLID, RayType_EndPoint, tracerayfilteronlymap);
  9561. if(!TR_DidHit(traceresulthandle))
  9562. {
  9563. new Float:dist = GetVectorDistance(entityposition, Position);
  9564. if(dist < radius)
  9565. {
  9566. new Float:percent = (radius-dist)*(100/radius);
  9567. makeDamage(Client, i, RoundToNearest(damage*percent/100), DMG_BLAST, 0.0, entityposition, WeaponName);
  9568. }
  9569. }
  9570. }
  9571. }
  9572. if(explosion) makeExplosion(Client, -1, entityposition, "", 0, 0, 0.0, flags);
  9573. }
  9574.  
  9575. stock makeRadiusDamage(Client, Float:entityposition[3], Float:radius, Float:damage, const String:WeaponName[], bool:explosion = true, flags = 0)
  9576. {
  9577. for(new i=1; i<=MaxClients; i++)
  9578. {
  9579. if(JoinCheck(i) && IsPlayerAlive(i))
  9580. {
  9581. new Float:Position[3];
  9582. GetClientAbsOrigin(i, Position);
  9583. new Float:dist = GetVectorDistance(entityposition, Position);
  9584. if(dist <= radius)
  9585. {
  9586. makeDamage(Client, i, RoundToNearest(damage), DMG_BLAST, 0.0, entityposition, WeaponName);
  9587. }
  9588. }
  9589. }
  9590. if(explosion) makeExplosion(Client, -1, entityposition, "", 0, 0, 0.0, flags);
  9591. }
  9592.  
  9593. public bool:tracerayfilteronlymap(entity, mask, any:data)
  9594. {
  9595. if(entity == 0)
  9596. return true;
  9597. else
  9598. return false;
  9599. }
  9600.  
  9601. stock Create_Prop(Client, String:Model[], bool:onair = false)
  9602. {
  9603. new Float:pos[3], Float:angle[3], entity = -1;
  9604. GetClientEyePosition(Client, pos);
  9605. GetClientEyeAngles(Client, angle);
  9606.  
  9607. new Handle:traceresulthandle = INVALID_HANDLE, Float:resultposition[3], Float:normalvector[3], Float:targetPosition[3];
  9608. traceresulthandle = TR_TraceRayFilterEx(pos, angle, MASK_SOLID, RayType_Infinite, tracerayfilternoplayer, Client);
  9609.  
  9610. if(TR_DidHit(traceresulthandle) == true)
  9611. {
  9612. TR_GetEndPosition(resultposition, traceresulthandle);
  9613. TR_GetPlaneNormal(traceresulthandle, normalvector);
  9614. NormalizeVector(normalvector, normalvector);
  9615. ScaleVector(normalvector, 20.0);
  9616. AddVectors(resultposition, normalvector, resultposition);
  9617. for(new i=1; i <= MaxClients; i++)
  9618. {
  9619. if(JoinCheck(i) && IsPlayerAlive(i) && Client != i)
  9620. {
  9621. GetClientEyePosition(i, targetPosition);
  9622. targetPosition[2] = resultposition[2];
  9623. if(GetVectorDistance(targetPosition, resultposition, false) < 70.0)
  9624. {
  9625. PrintChat(Client, "\x07FFFF3A%T", "Stuck", Client);
  9626. return -1;
  9627. }
  9628. }
  9629. }
  9630. if(GetVectorDistance(pos, resultposition, false) < 70.0)
  9631. {
  9632. PrintChat(Client, "\x07FFFF3A%T", "Stuck", Client);
  9633. return -1;
  9634. }
  9635. if(!onair)
  9636. {
  9637. new Float:Angles[3];
  9638. Angles[0] = 90.0;
  9639. new Handle:traceresulthandle2 = INVALID_HANDLE;
  9640. traceresulthandle2 = TR_TraceRayFilterEx(resultposition, Angles, MASK_SOLID, RayType_Infinite, tracerayfilterdefault);
  9641. if(TR_DidHit(traceresulthandle2) == true)
  9642. {
  9643. TR_GetEndPosition(resultposition, traceresulthandle2);
  9644. for(new i=1; i <= MaxClients; i++)
  9645. {
  9646. if(JoinCheck(i) && IsPlayerAlive(i))
  9647. {
  9648. GetClientEyePosition(i, targetPosition);
  9649. targetPosition[2] = resultposition[2];
  9650. if(GetVectorDistance(targetPosition, resultposition, false) < 70.0)
  9651. {
  9652. PrintChat(Client, "\x07FFFF3A%T", "Stuck", Client);
  9653. return -1;
  9654. }
  9655. }
  9656. }
  9657. }
  9658. CloseHandle(traceresulthandle2);
  9659. }
  9660. if(!IsModelPrecached(Model)) PrecacheModel(Model, true);
  9661. entity = CreateEntityByName("prop_physics");
  9662. DispatchKeyValue(entity, "model", Model);
  9663. DispatchSpawn(entity);
  9664. SetEntityModel(entity, Model);
  9665. TeleportEntity(entity, resultposition, NULL_VECTOR, NULL_VECTOR);
  9666. SetEntProp(entity, Prop_Send, "m_CollisionGroup", 0);
  9667. }
  9668. else return -1;
  9669. CloseHandle(traceresulthandle);
  9670. return entity;
  9671. }
  9672.  
  9673. public Action:SendProp_Alive(entity, const String:propname[], &iValue, element)
  9674. {
  9675. if(IsValidClient_Alive(element))
  9676. {
  9677. iValue = 1;
  9678. return Plugin_Changed;
  9679. }
  9680. return Plugin_Continue;
  9681. }
  9682.  
  9683. public Action:SendProp_Team(entity, const String:propname[], &iValue, element)
  9684. {
  9685. if(JoinCheck(element) && roundstart)
  9686. {
  9687. if(Job[element] == detector)
  9688. {
  9689. iValue = 3;
  9690. return Plugin_Changed;
  9691. }
  9692. else if(IsValidClient_Alive(element))
  9693. {
  9694. iValue = 2;
  9695. return Plugin_Changed;
  9696. }
  9697. }
  9698. return Plugin_Continue;
  9699. }
  9700.  
  9701. public Action:SendProp_AllSpot(entity, const String:propname[], &iValue, element)
  9702. {
  9703. if(JoinCheck(element))
  9704. {
  9705. iValue = 1;
  9706. return Plugin_Changed;
  9707. }
  9708. return Plugin_Continue;
  9709. }
  9710.  
  9711. public Action:SendProp_C4(entity, const String:propname[], &iValue, element)
  9712. {
  9713. iValue = -1;
  9714. return Plugin_Changed;
  9715. }
  9716.  
  9717. stock IsValidClient_Alive(Client, bool:replaycheck = true)
  9718. {
  9719. if(JoinCheck(Client))
  9720. {
  9721. if(IsPlayerAlive(Client)) return true;
  9722. else if(Ragdoll[Client] != 0)
  9723. {
  9724. if(CheckedBody[Ragdoll[Client]]) return false;
  9725. else return true;
  9726. }
  9727. }
  9728. return false;
  9729. }
  9730.  
  9731. public SQL_Connecting(Handle:owner, Handle:dbhandle, const String:error[], any:data)
  9732. {
  9733. if(dbhandle == INVALID_HANDLE)
  9734. {
  9735. LogError("SQL Connecting Failed %s", error);
  9736. }
  9737. else
  9738. {
  9739. databasehandle = dbhandle;
  9740.  
  9741. //글자 설정(UTF-8)
  9742. SQL_TQuery(databasehandle, configcharset, "SET NAMES 'UTF8'", 0, DBPrio_High);
  9743.  
  9744. //플레이어 데이터 테이블 생성
  9745. SQL_TQuery(databasehandle, CheckInfo, "create table if not exists info(id bigint primary key not null AUTO_INCREMENT, steamid varchar(256) CHARACTER SET utf8, nick varchar(256) CHARACTER SET utf8, point bigint DEFAULT 0, vip bigint default 0, karma bigint default 1000, playingtime FLOAT DEFAULT '0.0');");
  9746. SQL_TQuery(databasehandle, CheckInfo, "create table if not exists inventory(id bigint primary key not null AUTO_INCREMENT, steamid varchar(256) CHARACTER SET utf8, idx bigint, type bigint);");
  9747. SQL_TQuery(databasehandle, CheckInfo, "create table if not exists countermarket(id bigint primary key not null AUTO_INCREMENT, steamid varchar(256) CHARACTER SET utf8, nick varchar(256) CHARACTER SET utf8, idx bigint, price bigint);");
  9748. SQL_TQuery(databasehandle, CheckInfo, "create table if not exists vip(id bigint primary key not null AUTO_INCREMENT, steamid varchar(256) CHARACTER SET utf8, year bigint, month bigint, day bigint, hour bigint, minute bigint);");
  9749. SQL_TQuery(databasehandle, CheckInfo, "create table if not exists viptag(id bigint primary key not null AUTO_INCREMENT, steamid varchar(256) CHARACTER SET utf8, red bigint DEFAULT 255, green bigint DEFAULT 255, blue bigint DEFAULT 58, alpha bigint DEFAULT 255);");
  9750. SQL_TQuery(databasehandle, CheckInfo, "create table if not exists admtag(id bigint primary key not null AUTO_INCREMENT, steamid varchar(256) CHARACTER SET utf8, red bigint DEFAULT 198, green bigint DEFAULT 198, blue bigint DEFAULT 198, alpha bigint DEFAULT 255);");
  9751. SQL_TQuery(databasehandle, CheckInfo, "create table if not exists shoplog(id bigint primary key not null AUTO_INCREMENT, steamid varchar(256) CHARACTER SET utf8, log varchar(256) CHARACTER SET utf8, type bigint, date varchar(256) CHARACTER SET utf8);");
  9752. SQL_TQuery(databasehandle, CheckInfo, "create table if not exists restrictitem(id bigint primary key not null AUTO_INCREMENT, steamid varchar(256) CHARACTER SET utf8, idx bigint);");
  9753. for(new i = 1; i < MaxType+1; i++)
  9754. {
  9755. new String:Formatting[256];
  9756. Format(Formatting, 256, "create table if not exists %s(id bigint primary key not null AUTO_INCREMENT, steamid varchar(256) CHARACTER SET utf8, idx bigint, options bigint);", TypeName[i][1]);
  9757. SQL_TQuery(databasehandle, CheckInfo, Formatting, 0);
  9758. }
  9759. }
  9760. }
  9761.  
  9762. public configcharset(Handle:owner, Handle:hndl, const String:error[], any:data)
  9763. {
  9764. if(hndl == INVALID_HANDLE)
  9765. {
  9766. LogError("Database Character Set Failed. %s", error);
  9767. }
  9768. }
  9769.  
  9770. public CheckInfo(Handle:owner, Handle:hndl, const String:error[], any:data)
  9771. {
  9772. if(hndl == INVALID_HANDLE)
  9773. {
  9774. LogError("Player Data Table Creating Failed. %s", error);
  9775. }
  9776. }
  9777.  
  9778. public save_info(Handle:owner, Handle:handle, const String:error[], any:data)
  9779. {
  9780. if(handle == INVALID_HANDLE)
  9781. {
  9782. LogError("save ERROR: %s", error);
  9783. }
  9784. }
  9785.  
  9786. public save_info_nolog(Handle:owner, Handle:handle, const String:error[], any:data)
  9787. {
  9788. }
  9789.  
  9790. public check_query(Handle:hndl, Handle:handle, const String:error[], any:Client)
  9791. {
  9792. if(hndl == INVALID_HANDLE)
  9793. {
  9794. LogError("ERROR: %s", error);
  9795. PrintChat(Client, "%s", error);
  9796. return;
  9797. }
  9798. }
  9799.  
  9800. public delete_inventory(Handle:owner, Handle:handle, const String:error[], any:Client)
  9801. {
  9802. if(handle == INVALID_HANDLE)
  9803. {
  9804. LogError("deleteinventory ERROR: %s", error);
  9805. }
  9806. if(handle != INVALID_HANDLE)
  9807. {
  9808. Inventory(Client);
  9809. }
  9810. }
  9811.  
  9812. public delete_countermarket_item(Handle:owner, Handle:handle, const String:error[], any:pack)
  9813. {
  9814. ResetPack(pack);
  9815. new Client = ReadPackCell(pack);
  9816. new String:StringNumber[128];
  9817. ReadPackString(pack, StringNumber, 128);
  9818. if(handle == INVALID_HANDLE)
  9819. {
  9820. LogError("delete countermarketERROR: %s", error);
  9821. }
  9822. if(handle != INVALID_HANDLE)
  9823. {
  9824. new String:query[512], String:SteamID[256];
  9825. GetClientAuthString(Client, SteamID, 256);
  9826. if(!StringToInt(StringNumber))
  9827. {
  9828. Format(query, 512, "SELECT * FROM countermarket WHERE steamid = '%s' ORDER BY idx ASC;", SteamID);
  9829. SQL_TQuery(databasehandle, CounterMarket_My_Sell_Item, query, Client);
  9830. }
  9831. else SQL_TQuery(databasehandle, CounterMarket_Admin_Sell_Item, "SELECT * FROM countermarket ORDER BY idx ASC;", Client);
  9832. }
  9833. }
  9834.  
  9835. public info_check(Handle:owner, Handle:handle, const String:error[], any:Client)
  9836. {
  9837. new String:query[512], String:steamid[256], String:ClientName[256], String:CheckName[256];
  9838. GetClientAuthString(Client, steamid, sizeof(steamid));
  9839. if(handle == INVALID_HANDLE)
  9840. {
  9841. LogError("infocheck ERROR: %s", error);
  9842. return;
  9843. }
  9844. else if(SQL_GetRowCount(handle))
  9845. {
  9846. new counted = SQL_GetRowCount(handle);
  9847. if(counted > 0)
  9848. {
  9849. if(SQL_HasResultSet(handle))
  9850. {
  9851. while(SQL_FetchRow(handle))
  9852. {
  9853. SQL_FetchString(handle, 2, CheckName, 256);
  9854. Point[Client] = SQL_FetchInt(handle, 3);
  9855. VIP[Client] = SQL_FetchInt(handle, 4)==1?2:0;
  9856. Karma[Client] = SQL_FetchInt(handle, 5);
  9857. PlayingTime[Client] = SQL_FetchFloat(handle, 6);
  9858. GetClientName(Client, ClientName, 256);
  9859. if(!StrEqual(CheckName, ClientName))
  9860. {
  9861. ChangeNickname(Client);
  9862. }
  9863. }
  9864. }
  9865. }
  9866. }
  9867. else
  9868. {
  9869. Format(query, 512, "INSERT INTO info(steamid, nick) VALUES('%s', '%N');", steamid, Client);
  9870. SQL_TQuery(databasehandle, save_info, query, Client);
  9871. PlayingTime[Client] = 0.0;
  9872. Karma[Client] = 1000;
  9873. }
  9874. if(VIP[Client])
  9875. {
  9876. Format(query, 512, "SELECT * FROM viptag WHERE steamid = '%s';", steamid);
  9877. SQL_TQuery(databasehandle, viptag_check, query, Client);
  9878. }
  9879. if(AdminCheck(Client))
  9880. {
  9881. Format(query, 512, "SELECT * FROM admtag WHERE steamid = '%s';", steamid);
  9882. SQL_TQuery(databasehandle, admtag_check, query, Client);
  9883. }
  9884. DataLoaded[Client][0] = true;
  9885. }
  9886.  
  9887. public vip_check(Handle:owner, Handle:handle, const String:error[], any:Client)
  9888. {
  9889. if(handle == INVALID_HANDLE)
  9890. {
  9891. LogError("vip check ERROR: %s", error);
  9892. }
  9893. else if(SQL_GetRowCount(handle))
  9894. {
  9895. new counted = SQL_GetRowCount(handle);
  9896. if(counted > 0)
  9897. {
  9898. if(SQL_HasResultSet(handle))
  9899. {
  9900. while(SQL_FetchRow(handle))
  9901. {
  9902. if(!VIP[Client])
  9903. {
  9904. VIP[Client] = 1;
  9905. }
  9906. Due_VIP_Check(Client, SQL_FetchInt(handle, 2), SQL_FetchInt(handle, 3), SQL_FetchInt(handle, 4), SQL_FetchInt(handle, 5), SQL_FetchInt(handle, 6));
  9907. }
  9908. }
  9909. }
  9910. }
  9911. }
  9912.  
  9913. public viptag_check(Handle:owner, Handle:handle, const String:error[], any:Client)
  9914. {
  9915. new String:query[512], String:steamid[256];
  9916. GetClientAuthString(Client, steamid, sizeof(steamid));
  9917. if(handle == INVALID_HANDLE)
  9918. {
  9919. LogError("viptagcheck ERROR: %s", error);
  9920. }
  9921. else if(SQL_GetRowCount(handle))
  9922. {
  9923. new counted = SQL_GetRowCount(handle);
  9924. if(counted > 0)
  9925. {
  9926. if(SQL_HasResultSet(handle))
  9927. {
  9928. while(SQL_FetchRow(handle))
  9929. {
  9930. new R = SQL_FetchInt(handle, 2);
  9931. new G = SQL_FetchInt(handle, 3);
  9932. new B = SQL_FetchInt(handle, 4);
  9933. new A = SQL_FetchInt(handle, 5);
  9934. TagColor[Client] = RGBToHex(R, G, B, A, true);
  9935. if(A <= 10)
  9936. TagColor[Client] = 0;
  9937. }
  9938. }
  9939. }
  9940. }
  9941. else
  9942. {
  9943. Format(query, 512, "INSERT INTO viptag(steamid) VALUES('%s');", steamid);
  9944. SQL_TQuery(databasehandle, save_info, query, Client);
  9945. TagColor[Client] = RGBToHex(255, 255, 58, 255, true);
  9946. }
  9947. }
  9948.  
  9949. public admtag_check(Handle:owner, Handle:handle, const String:error[], any:Client)
  9950. {
  9951. new String:query[512], String:steamid[256];
  9952. GetClientAuthString(Client, steamid, sizeof(steamid));
  9953. if(handle == INVALID_HANDLE)
  9954. {
  9955. LogError("admintagcheck ERROR: %s", error);
  9956. }
  9957. else if(SQL_GetRowCount(handle))
  9958. {
  9959. new counted = SQL_GetRowCount(handle);
  9960. if(counted > 0)
  9961. {
  9962. if(SQL_HasResultSet(handle))
  9963. {
  9964. while(SQL_FetchRow(handle))
  9965. {
  9966. new R = SQL_FetchInt(handle, 2);
  9967. new G = SQL_FetchInt(handle, 3);
  9968. new B = SQL_FetchInt(handle, 4);
  9969. new A = SQL_FetchInt(handle, 5);
  9970. TagColor[Client] = RGBToHex(R, G, B, A, true);
  9971. if(A <= 10)
  9972. TagColor[Client] = 0;
  9973. }
  9974. }
  9975. }
  9976. }
  9977. else
  9978. {
  9979. Format(query, 512, "INSERT INTO admtag(steamid) VALUES('%s');", steamid);
  9980. SQL_TQuery(databasehandle, save_info, query, Client);
  9981. TagColor[Client] = RGBToHex(198, 198, 198, 255, true);
  9982. }
  9983. }
  9984.  
  9985. public skin_check(Handle:owner, Handle:handle, const String:error[], any:Client)
  9986. {
  9987. if(handle == INVALID_HANDLE)
  9988. {
  9989. LogError("skin check ERROR: %s", error);
  9990. return;
  9991. }
  9992. else if(SQL_GetRowCount(handle))
  9993. {
  9994. new counted = SQL_GetRowCount(handle);
  9995. if(counted > 0)
  9996. {
  9997. if(SQL_HasResultSet(handle))
  9998. {
  9999. while(SQL_FetchRow(handle))
  10000. {
  10001. ItemID[Client][SkinType] = SQL_FetchInt(handle, 2);
  10002. ItemExist[Client][SkinType] = true;
  10003. ItemOn[Client][SkinType] = bool:SQL_FetchInt(handle, 3);
  10004. }
  10005. }
  10006. }
  10007. }
  10008. DataLoaded[Client][1] = true;
  10009. }
  10010.  
  10011. public vmskin_check(Handle:owner, Handle:handle, const String:error[], any:Client)
  10012. {
  10013. if(handle == INVALID_HANDLE)
  10014. {
  10015. LogError("view model skin check ERROR: %s", error);
  10016. return;
  10017. }
  10018. else if(SQL_GetRowCount(handle))
  10019. {
  10020. new counted = SQL_GetRowCount(handle);
  10021. if(counted > 0)
  10022. {
  10023. if(SQL_HasResultSet(handle))
  10024. {
  10025. while(SQL_FetchRow(handle))
  10026. {
  10027. ItemID[Client][VMSkinType] = SQL_FetchInt(handle, 2);
  10028. ItemExist[Client][VMSkinType] = true;
  10029. ItemOn[Client][VMSkinType] = bool:SQL_FetchInt(handle, 3);
  10030. }
  10031. }
  10032. }
  10033. }
  10034. DataLoaded[Client][2] = true;
  10035. }
  10036.  
  10037. public restrict_check(Handle:owner, Handle:handle, const String:error[], any:Client)
  10038. {
  10039. if(handle == INVALID_HANDLE)
  10040. {
  10041. LogError("restrict check ERROR: %s", error);
  10042. }
  10043. else if(SQL_GetRowCount(handle))
  10044. {
  10045. new counted = SQL_GetRowCount(handle);
  10046. if(counted > 0)
  10047. {
  10048. if(SQL_HasResultSet(handle))
  10049. {
  10050. while(SQL_FetchRow(handle))
  10051. {
  10052. if(IsRestrictItem[SQL_FetchInt(handle, 2)]) RestrictItem[Client][SQL_FetchInt(handle, 2)] = true;
  10053. }
  10054. }
  10055. }
  10056. }
  10057. }
  10058.  
  10059. public MainShop(Client)
  10060. {
  10061. new Handle:menuhandle = CreateMenu(MainShop_CallBack), String:Translate_Formatting[256];
  10062. Format(Translate_Formatting, 256, "%T", "point shop", Client);
  10063. SetMenuTitle(menuhandle, Translate_Formatting);
  10064. Format(Translate_Formatting, 256, "%T", "my info", Client);
  10065. AddMenuItem(menuhandle, "", Translate_Formatting);
  10066. Format(Translate_Formatting, 256, "%T", "my inventory", Client);
  10067. AddMenuItem(menuhandle, "", Translate_Formatting);
  10068. Format(Translate_Formatting, 256, "%T", "my equip item", Client);
  10069. AddMenuItem(menuhandle, "", Translate_Formatting);
  10070. Format(Translate_Formatting, 256, "%T", "buy item", Client);
  10071. AddMenuItem(menuhandle, "", Translate_Formatting);
  10072. Format(Translate_Formatting, 256, "%T", "option", Client);
  10073. AddMenuItem(menuhandle, "", Translate_Formatting);
  10074. Format(Translate_Formatting, 256, "%T", "flea market", Client);
  10075. AddMenuItem(menuhandle, "", Translate_Formatting);
  10076. Format(Translate_Formatting, 256, "%T", "wealth", Client);
  10077. AddMenuItem(menuhandle, "", Translate_Formatting);
  10078. SetMenuPagination(menuhandle, MENU_NO_PAGINATION);
  10079. SetMenuExitButton(menuhandle, true);
  10080. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  10081. }
  10082.  
  10083. public MainShop_CallBack(Handle:menu, MenuAction:action, Client, select)
  10084. {
  10085. if(action == MenuAction_Select)
  10086. {
  10087. new String:SteamID[256], String:query[512];
  10088. GetClientAuthString(Client, SteamID, 256);
  10089. if(select == 0)
  10090. {
  10091. TargetInfo(Client, Client);
  10092. }
  10093. if(select == 1)
  10094. {
  10095. Inventory(Client);
  10096. }
  10097. if(select == 2)
  10098. {
  10099. MyItem(Client);
  10100. }
  10101. if(select == 3)
  10102. {
  10103. PointShop(Client);
  10104. }
  10105. if(select == 4)
  10106. {
  10107. Option(Client);
  10108. }
  10109. if(select == 5)
  10110. {
  10111. CounterMarket(Client);
  10112. }
  10113. if(select == 6)
  10114. {
  10115. Format(query, 512, "SELECT * FROM info WHERE NOT steamid = '%s' AND NOT steamid = '%s' ORDER BY point DESC limit 9;", Server_Master_SteamID, Server_SubMaster_SteamID);
  10116. SQL_TQuery(databasehandle, top9, query, Client);
  10117. }
  10118. if(select == 7)
  10119. {
  10120. ShopLog_Year(Client, false);
  10121. }
  10122. }
  10123. if(action == MenuAction_End)
  10124. {
  10125. CloseHandle(menu);
  10126. }
  10127. }
  10128.  
  10129. stock TargetInfo(Observer, Target)
  10130. {
  10131. new String:Formatting[256], String:CName[256], String:steamid[256], String:PlayTime[256];
  10132. GetClientName(Target, CName, 256);
  10133. GetClientAuthString(Target, steamid, 256);
  10134. FormatTime_Hud3(PlayingTime[Target], PlayTime, 256);
  10135. new Handle:menuhandle;
  10136. if(Observer == Target)
  10137. {
  10138. menuhandle = CreateMenu(MyInfo_CallBack);
  10139. }
  10140. else
  10141. {
  10142. menuhandle = CreateMenu(NULL_CallBack);
  10143. }
  10144. SetMenuTitle(menuhandle, "--- %N%T ---", Target, "person's info", Observer);
  10145. Format(Formatting, 256, "%T : %s", "nick", Observer, CName);
  10146. AddMenuItem(menuhandle, "", Formatting, ITEMDRAW_DISABLED);
  10147. Format(Formatting, 256, "%T : %s", "steamid", Observer, steamid);
  10148. AddMenuItem(menuhandle, "", Formatting, ITEMDRAW_DISABLED);
  10149. Format(Formatting, 256, "%T : %s\n========================", "playing time", Observer, PlayTime);
  10150. AddMenuItem(menuhandle, "", Formatting, ITEMDRAW_DISABLED);
  10151. /*if(StrEqual(steamid, Server_Master_SteamID, false)) Format(Formatting, 256, "%T : %T", "point", Observer, "very many", Observer);
  10152. else Format(Formatting, 256, "%T : %i", "point", Observer, Point[Target]);*/
  10153. Format(Formatting, 256, "%T : %i", "point", Observer, Point[Target]);
  10154. AddMenuItem(menuhandle, "", Formatting, ITEMDRAW_DISABLED);
  10155. for(new i = 1; i < MaxType+1; i++)
  10156. {
  10157. if(ItemExist[Target][i])
  10158. {
  10159. Format(Formatting, 256, "%T %T : %s", TypeName[i][0], Observer, "name", Observer, ItemName[ItemID[Target][i]]);
  10160. if(IsPlayerAlive(Observer)) Format(Formatting, 256, "%T %T : BLOCK", TypeName[i][0], Observer, "name", Observer);
  10161. AddMenuItem(menuhandle, "", Formatting, ITEMDRAW_DISABLED);
  10162. }
  10163. else
  10164. {
  10165. Format(Formatting, 256, "%T %T : %T", TypeName[i][0], Observer, "name", Observer, "none", Observer);
  10166. if(IsPlayerAlive(Observer)) Format(Formatting, 256, "%T %T : BLOCK", TypeName[i][0], Observer, "name", Observer);
  10167. AddMenuItem(menuhandle, "", Formatting, ITEMDRAW_DISABLED);
  10168. }
  10169. }
  10170. SetMenuExitButton(menuhandle, true);
  10171. if(Observer == Target)
  10172. {
  10173. SetMenuExitBackButton(menuhandle, true);
  10174. }
  10175. DisplayMenu(menuhandle, Observer, MENU_TIME_FOREVER);
  10176. }
  10177.  
  10178. public MyInfo_CallBack(Handle:menu, MenuAction:action, Client, select)
  10179. {
  10180. if(action == MenuAction_Cancel)
  10181. {
  10182. if(select == MenuCancel_ExitBack)
  10183. {
  10184. MainShop(Client);
  10185. }
  10186. }
  10187. if(action == MenuAction_End)
  10188. {
  10189. CloseHandle(menu);
  10190. }
  10191. }
  10192.  
  10193. public NULL_CallBack(Handle:menu, MenuAction:action, Client, select){}
  10194.  
  10195. public Inventory(Client)
  10196. {
  10197. new Handle:menuhandle = CreateMenu(Inventory_CallBack), String:Translate_Formatting[256];
  10198. SetMenuTitle(menuhandle, "--- %T ---", "my inventory", Client);
  10199. Format(Translate_Formatting, 256, "%T", "all of type", Client);
  10200. AddMenuItem(menuhandle, "", Translate_Formatting);
  10201. for(new i = 1; i < MaxType+1; i++)
  10202. {
  10203. Format(Translate_Formatting, 256, "%T", TypeName[i][0], Client);
  10204. AddMenuItem(menuhandle, "", Translate_Formatting);
  10205. }
  10206. SetMenuExitButton(menuhandle, true);
  10207. SetMenuExitBackButton(menuhandle, true);
  10208. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  10209. }
  10210.  
  10211. public Inventory_CallBack(Handle:menu, MenuAction:action, Client, select)
  10212. {
  10213. if(action == MenuAction_Select)
  10214. {
  10215. new String:SteamID[256], String:query[512];
  10216. GetClientAuthString(Client, SteamID, 256);
  10217. if(select == 0) Format(query, 512, "SELECT * FROM inventory WHERE steamid = '%s' ORDER BY idx ASC;", SteamID);
  10218. else Format(query, 512, "SELECT * FROM inventory WHERE steamid = '%s' AND type = '%i' ORDER BY idx ASC;", SteamID, select);
  10219. SQL_TQuery(databasehandle, inventory, query, Client);
  10220. }
  10221. if(action == MenuAction_Cancel)
  10222. {
  10223. if(select == MenuCancel_ExitBack)
  10224. {
  10225. MainShop(Client);
  10226. }
  10227. }
  10228. if(action == MenuAction_End)
  10229. {
  10230. CloseHandle(menu);
  10231. }
  10232. }
  10233.  
  10234. public inventory(Handle:owner, Handle:hndl, const String:error[], any:Client)
  10235. {
  10236. if(hndl == INVALID_HANDLE)
  10237. {
  10238. PrintChat(Client, "\x03아무런 아이템을 가지고 있지 않으십니다.");
  10239. Inventory(Client);
  10240. return;
  10241. }
  10242. new count[MAX_ITEMS], String:Formatting[256], String:Formatting2[256], bool:display;
  10243. new counted = SQL_GetRowCount(hndl);
  10244. if(counted > 0)
  10245. {
  10246. if(SQL_HasResultSet(hndl))
  10247. {
  10248. while(SQL_FetchRow(hndl))
  10249. {
  10250. count[SQL_FetchInt(hndl, 2)] += 1;
  10251. }
  10252. }
  10253. }
  10254. new Handle:menuhandle = CreateMenu(inventory_CallBack);
  10255. SetMenuTitle(menuhandle, "--- %T ---", "my inventory", Client);
  10256. for(new i; i < MAX_ITEMS; i++)
  10257. {
  10258. if(count[i] > 0)
  10259. {
  10260. Format(Formatting, 256, "%i", i);
  10261. Format(Formatting2, 256, "%s - %i개", ItemName[i], count[i]);
  10262. AddMenuItem(menuhandle, Formatting, Formatting2);
  10263. if(!display)
  10264. {
  10265. display = true;
  10266. }
  10267. }
  10268. }
  10269. if(display)
  10270. {
  10271. SetMenuExitButton(menuhandle, true);
  10272. SetMenuExitBackButton(menuhandle, true);
  10273. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  10274. }
  10275. else
  10276. {
  10277. PrintChat(Client, "\x03아무런 아이템을 가지고 있지 않으십니다.");
  10278. Inventory(Client);
  10279. }
  10280. }
  10281.  
  10282. public inventory_CallBack(Handle:menu, MenuAction:action, Client, select)
  10283. {
  10284. if(action == MenuAction_Select)
  10285. {
  10286. new String:StringNumber[256], Number;
  10287. GetMenuItem(menu, select, StringNumber, 256);
  10288. Number = StringToInt(StringNumber);
  10289. Prompt(Client, Number);
  10290. }
  10291. if(action == MenuAction_Cancel)
  10292. {
  10293. if(select == MenuCancel_ExitBack)
  10294. {
  10295. Inventory(Client);
  10296. }
  10297. }
  10298. if(action == MenuAction_End)
  10299. {
  10300. CloseHandle(menu);
  10301. }
  10302. }
  10303.  
  10304. public Prompt(Client, Number)
  10305. {
  10306. new Handle:menuhandle = CreateMenu(Prompt_CallBack), String:Formatting[256];
  10307. SetMenuTitle(menuhandle, "--- %T ---", "my inventory", Client);
  10308. Format(Formatting, 256, "%i", Number);
  10309. AddMenuItem(menuhandle, Formatting, "Use");
  10310. if(VIP[Client]) AddMenuItem(menuhandle, Formatting, "Trash it");
  10311. else
  10312. {
  10313. AddMenuItem(menuhandle, Formatting, "sell in 1/2 cost");
  10314. AddMenuItem(menuhandle, Formatting, "Trash it");
  10315. }
  10316. SetMenuExitButton(menuhandle, true);
  10317. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  10318. }
  10319.  
  10320. public Prompt_CallBack(Handle:menu, MenuAction:action, Client, select)
  10321. {
  10322. if(action == MenuAction_Select)
  10323. {
  10324. new String:StringNumber[256], Number, String:SteamID[256], String:query[512];
  10325. GetMenuItem(menu, select, StringNumber, 256);
  10326. GetClientAuthString(Client, SteamID, 256);
  10327. Number = StringToInt(StringNumber);
  10328. if(select == 0 && DataLoaded[Client][0] && DataLoaded[Client][1] && DataLoaded[Client][2])
  10329. {
  10330. new String:Log[256], String:Time[30], String:ClientName[256];
  10331. GetClientName(Client, ClientName, 256);
  10332. while(StrContains(ClientName, "'") != -1) ReplaceStringEx(ClientName, 256, "'", "`");
  10333. FormatTime(Time, 30, "%Y/%m/%d - %H:%M:%S", GetTime());
  10334. if(ItemExist[Client][ItemType[Number]])
  10335. {
  10336. Format(query, 512, "DELETE FROM %s WHERE steamid = '%s';", TypeName[ItemType[Number]][1], SteamID);
  10337. SQL_TQuery(databasehandle, save_info, query, Client);
  10338. Format(query, 512, "INSERT INTO inventory(steamid, idx, type) values ('%s', '%d', '%d');", SteamID, ItemID[Client][ItemType[Number]], ItemType[Number]);
  10339. SQL_TQuery(databasehandle, save_info, query, Client);
  10340. Format(Log, 256, "%s unequip %s(%i)", ClientName, ItemName[ItemID[Client][ItemType[Number]]], ItemID[Client][ItemType[Number]]);
  10341. Format(query, 512, "INSERT INTO shoplog(steamid, log, type, date) values ('%s', '%s', '%i', '%s');", SteamID, Log, 4, Time);
  10342. SQL_TQuery(databasehandle, save_info, query);
  10343. }
  10344. Format(query, 512, "INSERT INTO %s(steamid, idx, options) values ('%s', '%d', '1');", TypeName[ItemType[Number]][1], SteamID, Number);
  10345. SQL_TQuery(databasehandle, save_info, query, Client);
  10346. ItemID[Client][ItemType[Number]] = Number;
  10347. ItemExist[Client][ItemType[Number]] = true;
  10348. ItemOn[Client][ItemType[Number]] = true;
  10349. if(ItemType[Number] == VMSkinType && IsPlayerAlive(Client))
  10350. {
  10351. new weapons = GetPlayerWeaponSlot(Client, 2);
  10352. if(IsValidEdict(weapons))
  10353. {
  10354. RemovePlayerItem(Client, weapons);
  10355. RemoveEdict(weapons);
  10356. }
  10357. GivePlayerItem(Client, "weapon_knife");
  10358. }
  10359. Format(query, 512, "DELETE FROM inventory WHERE steamid = '%s' AND idx = '%i' limit 1;", SteamID, Number);
  10360. SQL_TQuery(databasehandle, delete_inventory, query, Client);
  10361. PrintChat(Client, "You Equipped\x04%s\x01.", ItemName[Number]);
  10362. Format(Log, 256, "%s use %s(%i)", ClientName, ItemName[Number], Number);
  10363. Format(query, 512, "INSERT INTO shoplog(steamid, log, type, date) values ('%s', '%s', '%i', '%s');", SteamID, Log, 2, Time);
  10364. SQL_TQuery(databasehandle, save_info, query);
  10365. }
  10366. if(select == 1)
  10367. {
  10368. if(VIP[Client])
  10369. {
  10370. Format(query, 512, "DELETE FROM inventory WHERE steamid = '%s' AND idx = '%i' limit 1;", SteamID, Number);
  10371. SQL_TQuery(databasehandle, delete_inventory, query, Client);
  10372. PrintChat(Client, "You trashed \x04%s\x01.", ItemName[Number]);
  10373. new String:Log[256], String:Time[30], String:ClientName[256];
  10374. GetClientName(Client, ClientName, 256);
  10375. while(StrContains(ClientName, "'") != -1) ReplaceStringEx(ClientName, 256, "'", "`");
  10376. FormatTime(Time, 30, "%Y/%m/%d - %H:%M:%S", GetTime());
  10377. Format(Log, 256, "%s drop %s(%i)", ClientName, ItemName[Number], Number);
  10378. Format(query, 512, "INSERT INTO shoplog(steamid, log, type, date) values ('%s', '%s', '%i', '%s');", SteamID, Log, 3, Time);
  10379. SQL_TQuery(databasehandle, save_info, query);
  10380. }
  10381. else
  10382. {
  10383. Format(query, 512, "DELETE FROM inventory WHERE steamid = '%s' AND idx = '%i' limit 1;", SteamID, Number);
  10384. SQL_TQuery(databasehandle, delete_inventory, query, Client);
  10385. Point[Client] += RoundToNearest(float(ItemPrice[Number])/2.0);
  10386. SavePoint(Client);
  10387. PrintChat(Client, "\x04%s\x01을/를 %d포인트에 파셨습니다.", ItemName[Number], RoundToNearest(float(ItemPrice[Number])/2.0));
  10388. new String:Log[256], String:Time[30], String:ClientName[256];
  10389. GetClientName(Client, ClientName, 256);
  10390. while(StrContains(ClientName, "'") != -1) ReplaceStringEx(ClientName, 256, "'", "`");
  10391. FormatTime(Time, 30, "%Y/%m/%d - %H:%M:%S", GetTime());
  10392. Format(Log, 256, "%s sell %s(%i)", ClientName, ItemName[Number], Number);
  10393. Format(query, 512, "INSERT INTO shoplog(steamid, log, type, date) values ('%s', '%s', '%i', '%s');", SteamID, Log, 2, Time);
  10394. SQL_TQuery(databasehandle, save_info, query);
  10395. }
  10396. }
  10397. if(select == 2)
  10398. {
  10399. Format(query, 512, "DELETE FROM inventory WHERE steamid = '%s' AND idx = '%i' limit 1;", SteamID, Number);
  10400. SQL_TQuery(databasehandle, delete_inventory, query, Client);
  10401. PrintChat(Client, "You trashed\x04%s\x01.", ItemName[Number]);
  10402. new String:Log[256], String:Time[30], String:ClientName[256];
  10403. GetClientName(Client, ClientName, 256);
  10404. while(StrContains(ClientName, "'") != -1) ReplaceStringEx(ClientName, 256, "'", "`");
  10405. FormatTime(Time, 30, "%Y/%m/%d - %H:%M:%S", GetTime());
  10406. Format(Log, 256, "%s drop %s(%i)", ClientName, ItemName[Number], Number);
  10407. Format(query, 512, "INSERT INTO shoplog(steamid, log, type, date) values ('%s', '%s', '%i', '%s');", SteamID, Log, 3, Time);
  10408. SQL_TQuery(databasehandle, save_info, query);
  10409. }
  10410. }
  10411. if(action == MenuAction_End)
  10412. {
  10413. CloseHandle(menu);
  10414. }
  10415. }
  10416.  
  10417. public MyItem(Client)
  10418. {
  10419. new Handle:menuhandle = CreateMenu(MyItem_CallBack);
  10420. SetMenuTitle(menuhandle, "--- %T(%T) ---", "my equip item", Client, "take out item", Client);
  10421. new String:Formatting[256], String:StringNumber[256];
  10422. for(new i = 1; i < MaxType+1; i++)
  10423. {
  10424. if(ItemExist[Client][i])
  10425. {
  10426. Format(Formatting, 256, "%T %T : %s", TypeName[i][0], Client, "name", Client, ItemName[ItemID[Client][i]]);
  10427. Format(StringNumber, 256, "%i", ItemID[Client][i]);
  10428. AddMenuItem(menuhandle, StringNumber, Formatting);
  10429. }
  10430. else
  10431. {
  10432. Format(Formatting, 256, "%T %T : %T", TypeName[i][0], Client, "name", Client, "none", Client);
  10433. AddMenuItem(menuhandle, "", Formatting, ITEMDRAW_DISABLED);
  10434. }
  10435. }
  10436. SetMenuExitButton(menuhandle, true);
  10437. SetMenuExitBackButton(menuhandle, true);
  10438. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  10439. }
  10440.  
  10441. public MyItem_CallBack(Handle:menu, MenuAction:action, Client, select)
  10442. {
  10443. if(action == MenuAction_Select)
  10444. {
  10445. if(DataLoaded[Client][0] && DataLoaded[Client][1] && DataLoaded[Client][2])
  10446. {
  10447. new String:StringNumber[256], Number;
  10448. GetMenuItem(menu, select, StringNumber, 256);
  10449. Number = StringToInt(StringNumber);
  10450. PrintChat(Client, "You unequipped \x03%s\x01.", ItemName[Number]);
  10451. new String:query[512], String:SteamID[256];
  10452. GetClientAuthString(Client, SteamID, 256);
  10453. ItemExist[Client][ItemType[Number]] = false;
  10454. ItemID[Client][ItemType[Number]] = 0;
  10455. if(ItemType[Number] == VMSkinType && IsPlayerAlive(Client))
  10456. {
  10457. new weapons = GetPlayerWeaponSlot(Client, 2);
  10458. if(IsValidEdict(weapons))
  10459. {
  10460. RemovePlayerItem(Client, weapons);
  10461. RemoveEdict(weapons);
  10462. }
  10463. GivePlayerItem(Client, "weapon_knife");
  10464. }
  10465. Format(query, 512, "DELETE FROM %s WHERE steamid = '%s';", TypeName[ItemType[Number]][1], SteamID);
  10466. SQL_TQuery(databasehandle, save_info, query, Client);
  10467. Format(query, 512, "INSERT INTO inventory(steamid, idx, type) values ('%s', '%d', '%d');", SteamID, Number, ItemType[Number]);
  10468. SQL_TQuery(databasehandle, save_info, query, Client);
  10469. new String:Log[256], String:Time[30], String:ClientName[256];
  10470. GetClientName(Client, ClientName, 256);
  10471. while(StrContains(ClientName, "'") != -1) ReplaceStringEx(ClientName, 256, "'", "`");
  10472. FormatTime(Time, 30, "%Y/%m/%d - %H:%M:%S", GetTime());
  10473. Format(Log, 256, "%s unequip %s(%i)", ClientName, ItemName[Number], Number);
  10474. Format(query, 512, "INSERT INTO shoplog(steamid, log, type, date) values ('%s', '%s', '%i', '%s');", SteamID, Log, 4, Time);
  10475. SQL_TQuery(databasehandle, save_info, query);
  10476. }
  10477. }
  10478. if(action == MenuAction_Cancel)
  10479. {
  10480. if(select == MenuCancel_ExitBack)
  10481. {
  10482. MainShop(Client);
  10483. }
  10484. }
  10485. if(action == MenuAction_End)
  10486. {
  10487. CloseHandle(menu);
  10488. }
  10489. }
  10490.  
  10491. public PointShop(Client)
  10492. {
  10493. new Handle:menuhandle = CreateMenu(PointShop_CallBack);
  10494. SetMenuTitle(menuhandle, "--- TTT %T %T ---", "point", Client, "shop", Client);
  10495. for(new i = 1; i < MaxType+1; i++)
  10496. {
  10497. new String:Formatting[256];
  10498. Format(Formatting, 256, "%T %T", TypeName[i][0], Client, "shop", Client);
  10499. AddMenuItem(menuhandle, "", Formatting);
  10500. }
  10501. SetMenuExitButton(menuhandle, true);
  10502. SetMenuExitBackButton(menuhandle, true);
  10503. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  10504. }
  10505.  
  10506. public PointShop_CallBack(Handle:menu, MenuAction:action, Client, select)
  10507. {
  10508. if(action == MenuAction_Select)
  10509. {
  10510. Shop(Client, select+1);
  10511. }
  10512. if(action == MenuAction_Cancel)
  10513. {
  10514. if(select == MenuCancel_ExitBack)
  10515. {
  10516. MainShop(Client);
  10517. }
  10518. }
  10519. if(action == MenuAction_End)
  10520. {
  10521. CloseHandle(menu);
  10522. }
  10523. }
  10524.  
  10525. public Shop(Client, Type)
  10526. {
  10527. new String:Formatting[256], String:Formatting2[256], bool:display;
  10528. new Handle:menuhandle = CreateMenu(Shop_CallBack);
  10529. SetMenuTitle(menuhandle, "--- TTT %T %T ---", "point", Client, "shop", Client);
  10530. for(new i;i < MAX_ITEMS; i++)
  10531. {
  10532. if(ItemType[i] == Type && ItemPrice[i] && !IsVIPItem[i])
  10533. {
  10534. Format(Formatting, 256, "%i", i);
  10535. if(IsRestrictItem[i])
  10536. {
  10537. if(RestrictItem[Client][i])
  10538. {
  10539. Format(Formatting2, 256, "%s %i%T(Cant buy anymore.)", ItemName[i], ItemPrice[i], "point", Client);
  10540. AddMenuItem(menuhandle, Formatting, Formatting2, ITEMDRAW_DISABLED);
  10541. }
  10542. else if(Point[Client] >= ItemPrice[i])
  10543. {
  10544. Format(Formatting2, 256, "%s %i%T", ItemName[i], ItemPrice[i], "point", Client);
  10545. AddMenuItem(menuhandle, Formatting, Formatting2);
  10546. }
  10547. else
  10548. {
  10549. Format(Formatting2, 256, "%s %i%T(You don't have enough points.)", ItemName[i], ItemPrice[i], "point", Client);
  10550. AddMenuItem(menuhandle, Formatting, Formatting2, ITEMDRAW_DISABLED);
  10551. }
  10552. }
  10553. else
  10554. {
  10555. if(Point[Client] >= ItemPrice[i])
  10556. {
  10557. Format(Formatting2, 256, "%s %i%T", ItemName[i], ItemPrice[i], "point", Client);
  10558. AddMenuItem(menuhandle, Formatting, Formatting2);
  10559. }
  10560. else
  10561. {
  10562. Format(Formatting2, 256, "%s %i%T(You don't have enough points.)", ItemName[i], ItemPrice[i], "point", Client);
  10563. AddMenuItem(menuhandle, Formatting, Formatting2, ITEMDRAW_DISABLED);
  10564. }
  10565. }
  10566. display = true;
  10567. }
  10568. }
  10569. SetMenuExitButton(menuhandle, true);
  10570. SetMenuExitBackButton(menuhandle, true);
  10571. if(!display)
  10572. {
  10573. Format(Formatting2, 256, "%T", "no items available", Client);
  10574. AddMenuItem(menuhandle, "", Formatting2, ITEMDRAW_DISABLED);
  10575. }
  10576. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  10577. }
  10578.  
  10579. public Shop_CallBack(Handle:menu, MenuAction:action, Client, select)
  10580. {
  10581. if(action == MenuAction_Select)
  10582. {
  10583. new String:StringNumber[256], Number;
  10584. GetMenuItem(menu, select, StringNumber, 256);
  10585. Number = StringToInt(StringNumber);
  10586. if(Point[Client] >= ItemPrice[Number])
  10587. {
  10588. new String:query[512], String:SteamID[256];
  10589. GetClientAuthString(Client, SteamID, 256);
  10590. Point[Client] -= ItemPrice[Number];
  10591. SavePoint(Client);
  10592. Format(query, 512, "INSERT INTO inventory(steamid, idx, type) values ('%s', '%d', '%d');", SteamID, Number, ItemType[Number]);
  10593. SQL_TQuery(databasehandle, save_info, query, Client);
  10594. PrintChat(Client, "You bought \x05%s.", ItemName[Number]);
  10595. Inventory(Client);
  10596. new String:Log[256], String:Time[30], String:ClientName[256];
  10597. GetClientName(Client, ClientName, 256);
  10598. while(StrContains(ClientName, "'") != -1) ReplaceStringEx(ClientName, 256, "'", "`");
  10599. FormatTime(Time, 30, "%Y/%m/%d - %H:%M:%S", GetTime());
  10600. Format(Log, 256, "%s buy %s(%i)", ClientName, ItemName[Number], Number);
  10601. Format(query, 512, "INSERT INTO shoplog(steamid, log, type, date) values ('%s', '%s', '%i', '%s');", SteamID, Log, 0, Time);
  10602. SQL_TQuery(databasehandle, save_info, query);
  10603. if(IsRestrictItem[Number])
  10604. {
  10605. Format(query, 512, "INSERT INTO restrictitem(steamid, idx) values ('%s', '%d');", SteamID, Number);
  10606. SQL_TQuery(databasehandle, save_info, query, Client);
  10607. RestrictItem[Client][Number] = true;
  10608. }
  10609. }
  10610. }
  10611. if(action == MenuAction_Cancel)
  10612. {
  10613. if(select == MenuCancel_ExitBack)
  10614. {
  10615. PointShop(Client);
  10616. }
  10617. }
  10618. if(action == MenuAction_End)
  10619. {
  10620. CloseHandle(menu);
  10621. }
  10622. }
  10623.  
  10624. public Option(Client)
  10625. {
  10626. new Handle:menuhandle = CreateMenu(Option_CallBack);
  10627. SetMenuTitle(menuhandle, "--- TTT %T %T(%T) ---", "point", Client, "shop", Client, "option", Client);
  10628. for(new i = 1; i < MaxType+1; i++)
  10629. {
  10630. new String:Formatting[256], String:Formatting2[256];
  10631. Format(Formatting, 256, "%i", i);
  10632. Format(Formatting2, 256, "%T %T/%T", TypeName[i][0], Client, "on", Client, "off", Client);
  10633. AddMenuItem(menuhandle, Formatting, Formatting2);
  10634. }
  10635. SetMenuExitButton(menuhandle, true);
  10636. SetMenuExitBackButton(menuhandle, true);
  10637. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  10638. }
  10639.  
  10640. public Option_CallBack(Handle:menu, MenuAction:action, Client, select)
  10641. {
  10642. if(action == MenuAction_Select)
  10643. {
  10644. new String:StringType[256], Type;
  10645. GetMenuItem(menu, select, StringType, 256);
  10646. Type = StringToInt(StringType);
  10647. if(ItemExist[Client][Type])
  10648. {
  10649. new String:SteamID[256], String:query[512];
  10650. GetClientAuthString(Client, SteamID, 256);
  10651. ItemOn[Client][Type] = !ItemOn[Client][Type];
  10652. Format(query, 512, "UPDATE %s SET options = '%i' WHERE steamid = '%s';", TypeName[Type][1], ItemOn[Client][Type], SteamID);
  10653. SQL_TQuery(databasehandle, save_info, query, Client);
  10654. if(ItemOn[Client][Type])
  10655. {
  10656. PrintChat(Client, "\x05%T %T", TypeName[Type][0], Client, "on", Client);
  10657. }
  10658. else
  10659. {
  10660. PrintChat(Client, "\x05%T %T", TypeName[Type][0], Client, "off", Client);
  10661. }
  10662. if(Type == VMSkinType)
  10663. {
  10664. if(IsPlayerAlive(Client))
  10665. {
  10666. new weapons = GetPlayerWeaponSlot(Client, 2);
  10667. if(IsValidEdict(weapons))
  10668. {
  10669. RemovePlayerItem(Client, weapons);
  10670. RemoveEdict(weapons);
  10671. }
  10672. GivePlayerItem(Client, "weapon_knife");
  10673. }
  10674. }
  10675. }
  10676. else
  10677. {
  10678. PrintChat(Client, "\x05%T%T", TypeName[Type][0], Client, "does not exist", Client);
  10679. }
  10680. Option(Client);
  10681. }
  10682. if(action == MenuAction_Cancel)
  10683. {
  10684. if(select == MenuCancel_ExitBack)
  10685. {
  10686. MainShop(Client);
  10687. }
  10688. }
  10689. if(action == MenuAction_End)
  10690. {
  10691. CloseHandle(menu);
  10692. }
  10693. }
  10694.  
  10695. public CounterMarket(Client)
  10696. {
  10697. new Handle:menuhandle = CreateMenu(CounterMarket_CallBack), String:Translate_Formatting[128];
  10698. SetMenuTitle(menuhandle, "--- %T ---", "flea market", Client);
  10699. Format(Translate_Formatting, 128, "%T", "buy", Client);
  10700. AddMenuItem(menuhandle, "", Translate_Formatting);
  10701. Format(Translate_Formatting, 128, "%T", "sell", Client);
  10702. AddMenuItem(menuhandle, "", Translate_Formatting);
  10703. AddMenuItem(menuhandle, "", "See my selling items");
  10704. SetMenuExitButton(menuhandle, true);
  10705. SetMenuExitBackButton(menuhandle, true);
  10706. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  10707. }
  10708.  
  10709. public CounterMarket_CallBack(Handle:menu, MenuAction:action, Client, select)
  10710. {
  10711. if(action == MenuAction_Select)
  10712. {
  10713. new String:SteamID[256], String:query[512];
  10714. GetClientAuthString(Client, SteamID, 256);
  10715. if(select == 0)
  10716. {
  10717. Format(query, 512, "SELECT * FROM countermarket ORDER BY id ASC;");
  10718. SQL_TQuery(databasehandle, CounterMarket_Buy, query, Client);
  10719. }
  10720. if(select == 1)
  10721. {
  10722. Format(query, 512, "SELECT * FROM inventory WHERE steamid = '%s' ORDER BY idx ASC;", SteamID);
  10723. SQL_TQuery(databasehandle, CounterMarket_Sell, query, Client);
  10724. }
  10725. if(select == 2)
  10726. {
  10727. Format(query, 512, "SELECT * FROM countermarket WHERE steamid = '%s' ORDER BY idx ASC;", SteamID);
  10728. SQL_TQuery(databasehandle, CounterMarket_My_Sell_Item, query, Client);
  10729. }
  10730. }
  10731. if(action == MenuAction_Cancel)
  10732. {
  10733. if(select == MenuCancel_ExitBack)
  10734. {
  10735. MainShop(Client);
  10736. }
  10737. }
  10738. if(action == MenuAction_End)
  10739. {
  10740. CloseHandle(menu);
  10741. }
  10742. }
  10743.  
  10744. public CounterMarket_Buy(Handle:owner, Handle:hndl, const String:error[], any:Client)
  10745. {
  10746. if(hndl == INVALID_HANDLE)
  10747. {
  10748. PrintChat(Client, "\x03No Available Items.");
  10749. CounterMarket(Client);
  10750. return;
  10751. }
  10752. new String:Formatting[256], String:Formatting2[256], bool:display, count;
  10753. new counted = SQL_GetRowCount(hndl);
  10754. new Handle:menuhandle = CreateMenu(CounterMarket_Buy_CallBack);
  10755. SetMenuTitle(menuhandle, "--- User Market Place (Buy) ---");
  10756. if(counted > 0)
  10757. {
  10758. if(SQL_HasResultSet(hndl))
  10759. {
  10760. while(SQL_FetchRow(hndl))
  10761. {
  10762. decl String:Uploader[256], String:SteamID[256];
  10763. SQL_FetchString(hndl, 2, Uploader, 256);
  10764. SQL_FetchString(hndl, 1, SteamID, 256);
  10765. Format(Formatting, 256, "%i^%i^%s^%i", SQL_FetchInt(hndl, 3), SQL_FetchInt(hndl, 4), SteamID, SQL_FetchInt(hndl, 0));
  10766. Format(Formatting2, 256, "Name : %s\n%s - %iPoint", Uploader, ItemName[SQL_FetchInt(hndl, 3)], SQL_FetchInt(hndl, 4));
  10767. if(Point[Client] >= SQL_FetchInt(hndl, 4)) AddMenuItem(menuhandle, Formatting, Formatting2);
  10768. else AddMenuItem(menuhandle, Formatting, Formatting2, ITEMDRAW_DISABLED);
  10769. if(count % 4 != 3) AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  10770. count++;
  10771. if(!display)
  10772. {
  10773. display = true;
  10774. }
  10775. }
  10776. }
  10777. }
  10778. if(display)
  10779. {
  10780. SetMenuExitButton(menuhandle, true);
  10781. SetMenuExitBackButton(menuhandle, true);
  10782. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  10783. }
  10784. else
  10785. {
  10786. PrintChat(Client, "\x03No Available Items.");
  10787. CounterMarket(Client);
  10788. }
  10789. }
  10790.  
  10791. public CounterMarket_Buy_CallBack(Handle:menu, MenuAction:action, Client, select)
  10792. {
  10793. if(action == MenuAction_Select)
  10794. {
  10795. new String:StringNumber[256], String:EString[4][128];
  10796. GetMenuItem(menu, select, StringNumber, 256);
  10797. if(StrEqual(StringNumber, "")) return;
  10798. ExplodeString(StringNumber, "^", EString, 4, 128);
  10799. CheckBuy(Client, EString[0], EString[1], EString[2], EString[3]);
  10800. }
  10801. if(action == MenuAction_Cancel)
  10802. {
  10803. if(select == MenuCancel_ExitBack)
  10804. {
  10805. CounterMarket(Client);
  10806. }
  10807. }
  10808. if(action == MenuAction_End)
  10809. {
  10810. CloseHandle(menu);
  10811. }
  10812. }
  10813.  
  10814. public CheckBuy(Client, String:Number[128], String:Price[128], String:SteamID[128], String:ID[128])
  10815. {
  10816. new String:Formatting[256];
  10817. Format(Formatting, 256, "%s^%s^%s^%s", Number, Price, SteamID, ID);
  10818. new Handle:menuhandle = CreateMenu(CheckBuy_CallBack);
  10819. SetMenuTitle(menuhandle, "-- Confirm --\n%s %s points", ItemName[StringToInt(Number)], Price);
  10820. AddMenuItem(menuhandle, Formatting, "Yes");
  10821. AddMenuItem(menuhandle, Formatting, "No");
  10822. SetMenuExitButton(menuhandle, false);
  10823. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  10824. }
  10825.  
  10826. public CheckBuy_CallBack(Handle:menu, MenuAction:action, Client, select)
  10827. {
  10828. if(action == MenuAction_Select)
  10829. {
  10830. new String:StringNumber[256], String:EString[4][128];
  10831. GetMenuItem(menu, select, StringNumber, 256);
  10832. ExplodeString(StringNumber, "^", EString, 4, 128);
  10833. new String:query[512], String:SteamID[256];
  10834. GetClientAuthString(Client, SteamID, 256);
  10835. if(select == 0)
  10836. {
  10837. if(Point[Client] >= StringToInt(EString[1]))
  10838. {
  10839. new Handle:pack = CreateDataPack();
  10840. WritePackCell(pack, Client);
  10841. WritePackString(pack, EString[0]);
  10842. WritePackString(pack, EString[1]);
  10843. WritePackString(pack, EString[2]);
  10844. WritePackString(pack, EString[3]);
  10845. Format(query, 512, "SELECT * FROM countermarket ORDER BY id ASC;");
  10846. SQL_TQuery(databasehandle, CheckBuy_LastCheck, query, pack);
  10847. }
  10848. }
  10849. if(select == 1)
  10850. {
  10851. Format(query, 512, "SELECT * FROM countermarket ORDER BY id ASC;");
  10852. SQL_TQuery(databasehandle, CounterMarket_Buy, query, Client);
  10853. }
  10854. }
  10855. if(action == MenuAction_End)
  10856. {
  10857. CloseHandle(menu);
  10858. }
  10859. }
  10860.  
  10861. public CheckBuy_LastCheck(Handle:owner, Handle:hndl, const String:error[], any:pack)
  10862. {
  10863. ResetPack(pack);
  10864. new Client = ReadPackCell(pack);
  10865. new String:EString[4][128];
  10866. ReadPackString(pack, EString[0], 128);
  10867. ReadPackString(pack, EString[1], 128);
  10868. ReadPackString(pack, EString[2], 128);
  10869. ReadPackString(pack, EString[3], 128);
  10870. new bool:CheckExist;
  10871. if(hndl == INVALID_HANDLE)
  10872. {
  10873. PrintChat(Client, "\x03아무런 아이템을 판매하지 않습니다.");
  10874. CounterMarket(Client);
  10875. return;
  10876. }
  10877. new counted = SQL_GetRowCount(hndl);
  10878. if(counted > 0)
  10879. {
  10880. if(SQL_HasResultSet(hndl))
  10881. {
  10882. while(SQL_FetchRow(hndl))
  10883. {
  10884. if(SQL_FetchInt(hndl, 0) == StringToInt(EString[3]))
  10885. {
  10886. new String:query[512], String:SteamID[256];
  10887. GetClientAuthString(Client, SteamID, 256);
  10888. Point[Client] -= StringToInt(EString[1]);
  10889. SavePoint(Client);
  10890. Format(query, 512, "INSERT INTO inventory(steamid, idx, type) values ('%s', '%d', '%d');", SteamID, StringToInt(EString[0]), ItemType[StringToInt(EString[0])]);
  10891. SQL_TQuery(databasehandle, save_info, query, Client);
  10892. PrintChat(Client, "\x07FF3A3A%s\x01를 거래장터에서 \x07FF3A3A%i포인트\x01의 가격에 구매하셨습니다.", ItemName[StringToInt(EString[0])], StringToInt(EString[1]));
  10893. Inventory(Client);
  10894. Format(query, 512, "DELETE FROM countermarket WHERE steamid = '%s' AND id = '%i' limit 1;", EString[2], StringToInt(EString[3]));
  10895. SQL_TQuery(databasehandle, save_info, query);
  10896. Format(query, 512, "SELECT * FROM info WHERE steamid = '%s';", EString[2]);
  10897. SQL_TQuery(databasehandle, GetUploader, query, StringToInt(EString[1]));
  10898. CheckExist = true;
  10899. new String:Log[256], String:Time[30], String:ClientName[256];
  10900. GetClientName(Client, ClientName, 256);
  10901. while(StrContains(ClientName, "'") != -1) ReplaceStringEx(ClientName, 256, "'", "`");
  10902. FormatTime(Time, 30, "%Y/%m/%d - %H:%M:%S", GetTime());
  10903. Format(Log, 256, "%s countermarket buy %s(%i) for %s price %i", ClientName, ItemName[StringToInt(EString[0])], StringToInt(EString[0]), EString[2], StringToInt(EString[1]));
  10904. Format(query, 512, "INSERT INTO shoplog(steamid, log, type, date) values ('%s', '%s', '%i', '%s');", SteamID, Log, 8, Time);
  10905. SQL_TQuery(databasehandle, save_info, query);
  10906. Format(Log, 256, "%s countermarket sell %s(%i) for %s(%s) price %i", EString[2], ItemName[StringToInt(EString[0])], StringToInt(EString[0]), ClientName, SteamID, StringToInt(EString[1]));
  10907. Format(query, 512, "INSERT INTO shoplog(steamid, log, type, date) values ('%s', '%s', '%i', '%s');", EString[2], Log, 9, Time);
  10908. SQL_TQuery(databasehandle, save_info, query);
  10909. }
  10910. }
  10911. }
  10912. }
  10913. if(!CheckExist)
  10914. {
  10915. PrintChat(Client, "\x05다른 누군가가 이미 사셨습니다.");
  10916. }
  10917. }
  10918.  
  10919. public GetUploader(Handle:owner, Handle:hndl, const String:error[], any:price)
  10920. {
  10921. new String:SteamID[256], target = -1;
  10922. new counted = SQL_GetRowCount(hndl);
  10923. if(counted > 0)
  10924. {
  10925. if(SQL_HasResultSet(hndl))
  10926. {
  10927. while(SQL_FetchRow(hndl))
  10928. {
  10929. SQL_FetchString(hndl, 1, SteamID, sizeof(SteamID));
  10930. for(new i = 1; i <= MaxClients; i++)
  10931. {
  10932. if(IsClientInGame(i))
  10933. {
  10934. new String:TargetSteamID[256];
  10935. GetClientAuthString(i, TargetSteamID, 256);
  10936. if(StrEqual(TargetSteamID, SteamID, false))
  10937. {
  10938. target = i;
  10939. }
  10940. }
  10941. }
  10942. if(target == -1)
  10943. {
  10944. new String:query[512];
  10945. Format(query, 512, "UPDATE info SET point = '%i' WHERE steamid = '%s';", SQL_FetchInt(hndl, 3)+price, SteamID);
  10946. SQL_TQuery(databasehandle, save_info, query, target);
  10947. }
  10948. else
  10949. {
  10950. new String:query[512];
  10951. PrintChat(target, "\x05누군가가 유저거래장터의 당신의 아이템을 구매하셨습니다.(수익금:%i)", price);
  10952. Point[target] += price;
  10953. SavePoint(target);
  10954. Format(query, 512, "UPDATE info SET point = '%i' WHERE steamid = '%s';", Point[target], SteamID);
  10955. SQL_TQuery(databasehandle, save_info, query, target);
  10956. break;
  10957. }
  10958. }
  10959. }
  10960. }
  10961. }
  10962.  
  10963. public CounterMarket_Sell(Handle:owner, Handle:hndl, const String:error[], any:Client)
  10964. {
  10965. if(hndl == INVALID_HANDLE)
  10966. {
  10967. PrintChat(Client, "\x03아무런 아이템을 가지고 있지 않으십니다.");
  10968. CounterMarket(Client);
  10969. return;
  10970. }
  10971. new String:Formatting[256], String:Formatting2[256], bool:display;
  10972. new counted = SQL_GetRowCount(hndl);
  10973. new Handle:menuhandle = CreateMenu(CounterMarket_Sell_CallBack);
  10974. SetMenuTitle(menuhandle, "--- 유저 거래 장터 (팝니다) ---");
  10975. if(counted > 0)
  10976. {
  10977. if(SQL_HasResultSet(hndl))
  10978. {
  10979. while(SQL_FetchRow(hndl))
  10980. {
  10981. Format(Formatting, 256, "%i", SQL_FetchInt(hndl, 2));
  10982. Format(Formatting2, 256, "%s", ItemName[SQL_FetchInt(hndl, 2)]);
  10983. if(!IsVIPItem[SQL_FetchInt(hndl, 2)]) AddMenuItem(menuhandle, Formatting, Formatting2);
  10984. else AddMenuItem(menuhandle, Formatting, Formatting2, ITEMDRAW_DISABLED);
  10985. if(!display)
  10986. {
  10987. display = true;
  10988. }
  10989. }
  10990. }
  10991. }
  10992. if(display)
  10993. {
  10994. SetMenuExitButton(menuhandle, true);
  10995. SetMenuExitBackButton(menuhandle, true);
  10996. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  10997. }
  10998. else
  10999. {
  11000. PrintChat(Client, "\x03아무런 아이템을 가지고 있지 않으십니다.");
  11001. CounterMarket(Client);
  11002. }
  11003. }
  11004.  
  11005. public CounterMarket_Sell_CallBack(Handle:menu, MenuAction:action, Client, select)
  11006. {
  11007. if(action == MenuAction_Select)
  11008. {
  11009. new String:StringNumber[256];
  11010. GetMenuItem(menu, select, StringNumber, 256);
  11011. SellPoint[Client] = 0;
  11012. CheckSell(Client, StringNumber);
  11013. }
  11014. if(action == MenuAction_Cancel)
  11015. {
  11016. if(select == MenuCancel_ExitBack)
  11017. {
  11018. CounterMarket(Client);
  11019. }
  11020. }
  11021. if(action == MenuAction_End)
  11022. {
  11023. CloseHandle(menu);
  11024. }
  11025. }
  11026.  
  11027. public CheckSell(Client, String:Number[256])
  11028. {
  11029. new String:Formatting[256];
  11030. Format(Formatting, 256, "%s", Number);
  11031. new Handle:menuhandle = CreateMenu(CheckSell_CallBack);
  11032. SetMenuTitle(menuhandle, "-- 확인 작업 --\n%s %i포인트에 파시겠습니까?", ItemName[StringToInt(Number)], SellPoint[Client]);
  11033. AddMenuItem(menuhandle, Formatting, "네");
  11034. AddMenuItem(menuhandle, Formatting, "판매를 취소합니다.");
  11035. AddMenuItem(menuhandle, Formatting, "+1포인트");
  11036. AddMenuItem(menuhandle, Formatting, "+10포인트");
  11037. AddMenuItem(menuhandle, Formatting, "+100포인트");
  11038. AddMenuItem(menuhandle, Formatting, "+1000포인트");
  11039. AddMenuItem(menuhandle, Formatting, "+1만포인트");
  11040. AddMenuItem(menuhandle, Formatting, "+10만포인트");
  11041. AddMenuItem(menuhandle, Formatting, "+100만포인트");
  11042. SetMenuPagination(menuhandle, MENU_NO_PAGINATION);
  11043. SetMenuExitButton(menuhandle, false);
  11044. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  11045. }
  11046.  
  11047. public CheckSell_CallBack(Handle:menu, MenuAction:action, Client, select)
  11048. {
  11049. if(action == MenuAction_Select)
  11050. {
  11051. new String:StringNumber[256];
  11052. GetMenuItem(menu, select, StringNumber, 256);
  11053. new String:query[512], String:SteamID[256];
  11054. GetClientAuthString(Client, SteamID, 256);
  11055. if(select == 0)
  11056. {
  11057. Format(query, 512, "DELETE FROM inventory WHERE steamid = '%s' AND idx = '%i' limit 1;", SteamID, StringToInt(StringNumber));
  11058. SQL_TQuery(databasehandle, save_info, query, Client);
  11059. PrintChat(Client, "\x07FF3A3A%s\x01를 거래장터에서 \x07FF3A3A%i포인트\x01의 가격에 판매합니다.", ItemName[StringToInt(StringNumber)], SellPoint[Client]);
  11060. Format(query, 512, "INSERT INTO countermarket(steamid, idx, price) values ('%s', '%d', '%d');", SteamID, StringToInt(StringNumber), SellPoint[Client]);
  11061. SQL_TQuery(databasehandle, save_info, query);
  11062. ChangeNickname(Client);
  11063. new String:Log[256], String:Time[30], String:ClientName[256];
  11064. GetClientName(Client, ClientName, 256);
  11065. while(StrContains(ClientName, "'") != -1) ReplaceStringEx(ClientName, 256, "'", "`");
  11066. FormatTime(Time, 30, "%Y/%m/%d - %H:%M:%S", GetTime());
  11067. Format(Log, 256, "%s countermarket upload %s(%i) price %i", ClientName, ItemName[StringToInt(StringNumber)], StringToInt(StringNumber), SellPoint[Client]);
  11068. Format(query, 512, "INSERT INTO shoplog(steamid, log, type, date) values ('%s', '%s', '%i', '%s');", SteamID, Log, 7, Time);
  11069. SQL_TQuery(databasehandle, save_info, query);
  11070. }
  11071. if(select == 1)
  11072. {
  11073. Format(query, 512, "SELECT * FROM inventory WHERE steamid = '%s' ORDER BY idx ASC;", SteamID);
  11074. SQL_TQuery(databasehandle, CounterMarket_Sell, query, Client);
  11075. }
  11076. if(select >= 2)
  11077. {
  11078. new calcultae = 1;
  11079. for(new i = 2; i < select; i++)
  11080. {
  11081. calcultae *= 10;
  11082. }
  11083. SellPoint[Client] += calcultae;
  11084. }
  11085. if(select > 1)
  11086. {
  11087. CheckSell(Client, StringNumber);
  11088. }
  11089. }
  11090. if(action == MenuAction_End)
  11091. {
  11092. CloseHandle(menu);
  11093. }
  11094. }
  11095.  
  11096. public CounterMarket_My_Sell_Item(Handle:owner, Handle:hndl, const String:error[], any:Client)
  11097. {
  11098. if(hndl == INVALID_HANDLE)
  11099. {
  11100. PrintChat(Client, "\x03아무런 아이템을 판매하고 있지 않습니다.");
  11101. CounterMarket(Client);
  11102. return;
  11103. }
  11104. new String:Formatting[256], String:Formatting2[256], bool:display;
  11105. new counted = SQL_GetRowCount(hndl);
  11106. new Handle:menuhandle = CreateMenu(CounterMarket_My_Sell_Item_CallBack);
  11107. SetMenuTitle(menuhandle, "--- 내가 팔고 있는 물건들 (클릭하면 회수됩니다.) ---");
  11108. if(counted > 0)
  11109. {
  11110. if(SQL_HasResultSet(hndl))
  11111. {
  11112. while(SQL_FetchRow(hndl))
  11113. {
  11114. decl String:SteamID[256];
  11115. SQL_FetchString(hndl, 1, SteamID, 256);
  11116. Format(Formatting, 256, "%i^%i^%s^%i^0", SQL_FetchInt(hndl, 3), SQL_FetchInt(hndl, 4), SteamID, SQL_FetchInt(hndl, 0));
  11117. Format(Formatting2, 256, "%s - %i포인트", ItemName[SQL_FetchInt(hndl, 3)], SQL_FetchInt(hndl, 4));
  11118. AddMenuItem(menuhandle, Formatting, Formatting2);
  11119. if(!display)
  11120. {
  11121. display = true;
  11122. }
  11123. }
  11124. }
  11125. }
  11126. if(display)
  11127. {
  11128. SetMenuExitButton(menuhandle, true);
  11129. SetMenuExitBackButton(menuhandle, true);
  11130. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  11131. }
  11132. else
  11133. {
  11134. PrintChat(Client, "\x03아무런 아이템을 판매하고 있지 않습니다.");
  11135. CounterMarket(Client);
  11136. }
  11137. }
  11138.  
  11139. public CounterMarket_Admin_Sell_Item(Handle:owner, Handle:hndl, const String:error[], any:Client)
  11140. {
  11141. if(hndl == INVALID_HANDLE)
  11142. {
  11143. PrintChat(Client, "\x03아무런 아이템을 판매하고 있지 않습니다.");
  11144. CounterMarket(Client);
  11145. return;
  11146. }
  11147. new String:Formatting[256], String:Formatting2[256], bool:display;
  11148. new counted = SQL_GetRowCount(hndl);
  11149. new Handle:menuhandle = CreateMenu(CounterMarket_My_Sell_Item_CallBack);
  11150. SetMenuTitle(menuhandle, "--- 팔고 있는 물건들 (클릭하면 회수됩니다.) ---");
  11151. if(counted > 0)
  11152. {
  11153. if(SQL_HasResultSet(hndl))
  11154. {
  11155. while(SQL_FetchRow(hndl))
  11156. {
  11157. decl String:SteamID[256];
  11158. SQL_FetchString(hndl, 1, SteamID, 256);
  11159. Format(Formatting, 256, "%i^%i^%s^%i^1", SQL_FetchInt(hndl, 3), SQL_FetchInt(hndl, 4), SteamID, SQL_FetchInt(hndl, 0));
  11160. Format(Formatting2, 256, "%s - %i포인트", ItemName[SQL_FetchInt(hndl, 3)], SQL_FetchInt(hndl, 4));
  11161. AddMenuItem(menuhandle, Formatting, Formatting2);
  11162. if(!display)
  11163. {
  11164. display = true;
  11165. }
  11166. }
  11167. }
  11168. }
  11169. if(display)
  11170. {
  11171. SetMenuExitButton(menuhandle, true);
  11172. SetMenuExitBackButton(menuhandle, true);
  11173. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  11174. }
  11175. else
  11176. {
  11177. PrintChat(Client, "\x03아무런 아이템을 판매하고 있지 않습니다.");
  11178. CounterMarket(Client);
  11179. }
  11180. }
  11181.  
  11182. public CounterMarket_My_Sell_Item_CallBack(Handle:menu, MenuAction:action, Client, select)
  11183. {
  11184. if(action == MenuAction_Select)
  11185. {
  11186. new String:StringNumber[256], String:EString[5][128];
  11187. GetMenuItem(menu, select, StringNumber, 256);
  11188. ExplodeString(StringNumber, "^", EString, 5, 128);
  11189. CheckCancel(Client, EString[0], EString[1], EString[2], EString[3], EString[4]);
  11190. }
  11191. if(action == MenuAction_Cancel)
  11192. {
  11193. if(select == MenuCancel_ExitBack)
  11194. {
  11195. CounterMarket(Client);
  11196. }
  11197. }
  11198. if(action == MenuAction_End)
  11199. {
  11200. CloseHandle(menu);
  11201. }
  11202. }
  11203.  
  11204. public CheckCancel(Client, String:Number[128], String:Price[128], String:SteamID[128], String:ID[128], String:Check[128])
  11205. {
  11206. new String:Formatting[256];
  11207. Format(Formatting, 256, "%s^%s^%s^%s", Number, SteamID, ID, Check);
  11208. new Handle:menuhandle = CreateMenu(CheckCancel_CallBack);
  11209. SetMenuTitle(menuhandle, "-- 확인 작업 --\n%s %s포인트\n회수하시겠습니까?", ItemName[StringToInt(Number)], Price);
  11210. AddMenuItem(menuhandle, Formatting, "네");
  11211. AddMenuItem(menuhandle, Formatting, "아니오");
  11212. SetMenuExitButton(menuhandle, false);
  11213. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  11214. }
  11215.  
  11216. public CheckCancel_CallBack(Handle:menu, MenuAction:action, Client, select)
  11217. {
  11218. if(action == MenuAction_Select)
  11219. {
  11220. new String:StringNumber[256], String:EString[4][128];
  11221. GetMenuItem(menu, select, StringNumber, 256);
  11222. ExplodeString(StringNumber, "^", EString, 4, 128);
  11223. new String:query[512], String:SteamID[256];
  11224. GetClientAuthString(Client, SteamID, 256);
  11225. if(select == 0)
  11226. {
  11227. new Handle:pack = CreateDataPack();
  11228. WritePackCell(pack, Client);
  11229. WritePackString(pack, EString[0]);
  11230. WritePackString(pack, EString[1]);
  11231. WritePackString(pack, EString[2]);
  11232. WritePackString(pack, EString[3]);
  11233. Format(query, 512, "SELECT * FROM countermarket WHERE steamid = '%s' AND id = '%i' ORDER BY idx ASC;", EString[1], StringToInt(EString[2]));
  11234. SQL_TQuery(databasehandle, CheckCancel_LastCheck, query, pack);
  11235. }
  11236. if(select == 1)
  11237. {
  11238. if(!StringToInt(EString[3]))
  11239. {
  11240. Format(query, 512, "SELECT * FROM countermarket WHERE steamid = '%s' ORDER BY idx ASC;", SteamID);
  11241. SQL_TQuery(databasehandle, CounterMarket_My_Sell_Item, query, Client);
  11242. }
  11243. else SQL_TQuery(databasehandle, CounterMarket_Admin_Sell_Item, "SELECT * FROM countermarket ORDER BY idx ASC;", Client);
  11244. }
  11245. }
  11246. if(action == MenuAction_End)
  11247. {
  11248. CloseHandle(menu);
  11249. }
  11250. }
  11251.  
  11252. public CheckCancel_LastCheck(Handle:owner, Handle:hndl, const String:error[], any:pack)
  11253. {
  11254. ResetPack(pack);
  11255. new Client = ReadPackCell(pack);
  11256. new String:EString[4][128];
  11257. ReadPackString(pack, EString[0], 128);
  11258. ReadPackString(pack, EString[1], 128);
  11259. ReadPackString(pack, EString[2], 128);
  11260. ReadPackString(pack, EString[3], 128);
  11261. new bool:CheckExist;
  11262. if(hndl == INVALID_HANDLE)
  11263. {
  11264. PrintChat(Client, "\x03아무런 아이템을 판매하지 않습니다.");
  11265. CounterMarket(Client);
  11266. return;
  11267. }
  11268. new counted = SQL_GetRowCount(hndl);
  11269. if(counted > 0)
  11270. {
  11271. if(SQL_HasResultSet(hndl))
  11272. {
  11273. while(SQL_FetchRow(hndl))
  11274. {
  11275. if(SQL_FetchInt(hndl, 0) == StringToInt(EString[2]))
  11276. {
  11277. new String:query[512], String:SteamID[256];
  11278. GetClientAuthString(Client, SteamID, 256);
  11279. Format(query, 512, "INSERT INTO inventory(steamid, idx, type) values ('%s', '%d', '%d');", EString[1], StringToInt(EString[0]), ItemType[StringToInt(EString[0])]);
  11280. SQL_TQuery(databasehandle, save_info, query, Client);
  11281. new Handle:pack2 = CreateDataPack();
  11282. WritePackCell(pack2, Client);
  11283. WritePackString(pack2, EString[3]);
  11284. Format(query, 512, "DELETE FROM countermarket WHERE steamid = '%s' AND id = '%i' limit 1;", EString[1], StringToInt(EString[2]));
  11285. SQL_TQuery(databasehandle, delete_countermarket_item, query, pack2);
  11286. CheckExist = true;
  11287. new String:Log[256], String:Time[30], String:ClientName[256];
  11288. GetClientName(Client, ClientName, 256);
  11289. while(StrContains(ClientName, "'") != -1) ReplaceStringEx(ClientName, 256, "'", "`");
  11290. FormatTime(Time, 30, "%Y/%m/%d - %H:%M:%S", GetTime());
  11291. Format(Log, 256, "%s receive by admin %s(%i) at countermarket", ClientName, ItemName[StringToInt(EString[0])], StringToInt(EString[0]));
  11292. Format(query, 512, "INSERT INTO shoplog(steamid, log, type, date) values ('%s', '%s', '%i', '%s');", EString[1], Log, 6, Time);
  11293. SQL_TQuery(databasehandle, save_info, query);
  11294. }
  11295. }
  11296. }
  11297. }
  11298. if(!CheckExist)
  11299. {
  11300. PrintChat(Client, "\x05다른 누군가가 이미 사셨습니다.");
  11301. }
  11302. }
  11303.  
  11304. public top9(Handle:owner, Handle:hndl, const String:error[], any:Client)
  11305. {
  11306. if(hndl == INVALID_HANDLE)
  11307. {
  11308. return;
  11309. }
  11310. new counted = SQL_GetRowCount(hndl), Handle:menuhandle = CreateMenu(NULL_CallBack), String:Formatting[256];
  11311. SetMenuTitle(menuhandle, "-- Top 9 --");
  11312. if(counted > 0)
  11313. {
  11314. if(SQL_HasResultSet(hndl))
  11315. {
  11316. while(SQL_FetchRow(hndl))
  11317. {
  11318. SQL_FetchString(hndl, 2, Formatting, 256);
  11319. if(!StrEqual(Formatting, "")) Format(Formatting, 256, "%s - %i", Formatting, SQL_FetchInt(hndl, 3));
  11320. else Format(Formatting, 256, "닉네임이 등록되지 않았습니다 - %i", SQL_FetchInt(hndl, 3));
  11321. AddMenuItem(menuhandle, "", Formatting, ITEMDRAW_DISABLED);
  11322. }
  11323. }
  11324. }
  11325. SetMenuPagination(menuhandle, MENU_NO_PAGINATION);
  11326. SetMenuExitButton(menuhandle, true);
  11327. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  11328. }
  11329.  
  11330. public ShopLog_Year(Client, bool:Target)
  11331. {
  11332. new Handle:menuhandle;
  11333. if(Target)
  11334. menuhandle = CreateMenu(ShopLog_Year_CallBack2);
  11335. else
  11336. menuhandle = CreateMenu(ShopLog_Year_CallBack);
  11337. SetMenuTitle(menuhandle, "Set year.(Log)");
  11338. AddMenuItem(menuhandle, "2012", "2012");
  11339. AddMenuItem(menuhandle, "2013", "2013");
  11340. SetMenuExitButton(menuhandle, true);
  11341. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  11342. }
  11343.  
  11344. public ShopLog_Year_CallBack(Handle:menu, MenuAction:action, Client, select)
  11345. {
  11346. if(action == MenuAction_Select)
  11347. {
  11348. new String:info[256];
  11349. GetMenuItem(menu, select, info, 256);
  11350. ShopLog_Month(Client, info, false);
  11351. }
  11352. if(action == MenuAction_End)
  11353. {
  11354. CloseHandle(menu);
  11355. }
  11356. }
  11357.  
  11358. public ShopLog_Year_CallBack2(Handle:menu, MenuAction:action, Client, select)
  11359. {
  11360. if(action == MenuAction_Select)
  11361. {
  11362. new String:info[256];
  11363. GetMenuItem(menu, select, info, 256);
  11364. ShopLog_Month(Client, info, true);
  11365. }
  11366. if(action == MenuAction_End)
  11367. {
  11368. CloseHandle(menu);
  11369. }
  11370. }
  11371.  
  11372. public ShopLog_Month(Client, String:info[256], bool:Target)
  11373. {
  11374. new Handle:menuhandle;
  11375. if(Target)
  11376. menuhandle = CreateMenu(ShopLog_Month_CallBack2);
  11377. else
  11378. menuhandle = CreateMenu(ShopLog_Month_CallBack);
  11379. SetMenuTitle(menuhandle, "Set month.(Log):%s", info);
  11380. new String:Formatting[256], String:Formatting2[256];
  11381. for(new i=1; i<=12; i++)
  11382. {
  11383. if(i < 10) Format(Formatting, 256, "%s/0%i", info, i);
  11384. else Format(Formatting, 256, "%s/%i", info, i);
  11385. Format(Formatting2, 256, "%i Month", i);
  11386. AddMenuItem(menuhandle, Formatting, Formatting2);
  11387. }
  11388. SetMenuExitButton(menuhandle, true);
  11389. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  11390. }
  11391.  
  11392. public ShopLog_Month_CallBack(Handle:menu, MenuAction:action, Client, select)
  11393. {
  11394. if(action == MenuAction_Select)
  11395. {
  11396. new String:info[256];
  11397. GetMenuItem(menu, select, info, 256);
  11398. ShopLog_Day(Client, info);
  11399. }
  11400. if(action == MenuAction_End)
  11401. {
  11402. CloseHandle(menu);
  11403. }
  11404. }
  11405.  
  11406. public ShopLog_Month_CallBack2(Handle:menu, MenuAction:action, Client, select)
  11407. {
  11408. if(action == MenuAction_Select)
  11409. {
  11410. new String:info[256];
  11411. GetMenuItem(menu, select, info, 256);
  11412. ShopLog_Type(Client, info, true);
  11413. }
  11414. if(action == MenuAction_End)
  11415. {
  11416. CloseHandle(menu);
  11417. }
  11418. }
  11419.  
  11420. public ShopLog_Day(Client, String:info[256])
  11421. {
  11422. new Handle:menuhandle = CreateMenu(ShopLog_Day_CallBack);
  11423. SetMenuTitle(menuhandle, "Set day.(Log):%s", info);
  11424. new String:Formatting[256], String:Formatting2[256];
  11425. AddMenuItem(menuhandle, info, "See day logs");
  11426. for(new i=1; i<=31; i++)
  11427. {
  11428. if(i < 10) Format(Formatting, 256, "%s/0%i", info, i);
  11429. else Format(Formatting, 256, "%s/%i", info, i);
  11430. Format(Formatting2, 256, "%i Days", i);
  11431. AddMenuItem(menuhandle, Formatting, Formatting2);
  11432. }
  11433. SetMenuExitButton(menuhandle, true);
  11434. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  11435. }
  11436.  
  11437. public ShopLog_Day_CallBack(Handle:menu, MenuAction:action, Client, select)
  11438. {
  11439. if(action == MenuAction_Select)
  11440. {
  11441. new String:info[256];
  11442. GetMenuItem(menu, select, info, 256);
  11443. if(select == 0)
  11444. {
  11445. ShopLog_Type(Client, info);
  11446. }
  11447. else
  11448. {
  11449. ShopLog_Hour(Client, info);
  11450. }
  11451. }
  11452. if(action == MenuAction_End)
  11453. {
  11454. CloseHandle(menu);
  11455. }
  11456. }
  11457.  
  11458. public ShopLog_Hour(Client, String:info[256])
  11459. {
  11460. new Handle:menuhandle = CreateMenu(ShopLog_Hour_CallBack);
  11461. SetMenuTitle(menuhandle, "Set hours.(Log):%s", info);
  11462. new String:Formatting[256], String:Formatting2[256];
  11463. AddMenuItem(menuhandle, info, "See hour log");
  11464. for(new i=1; i<=24; i++)
  11465. {
  11466. if(i < 10) Format(Formatting, 256, "%s - 0%i", info, i);
  11467. else Format(Formatting, 256, "%s - %i", info, i);
  11468. Format(Formatting2, 256, "%i Hour", i);
  11469. AddMenuItem(menuhandle, Formatting, Formatting2);
  11470. }
  11471. SetMenuExitButton(menuhandle, true);
  11472. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  11473. }
  11474.  
  11475. public ShopLog_Hour_CallBack(Handle:menu, MenuAction:action, Client, select)
  11476. {
  11477. if(action == MenuAction_Select)
  11478. {
  11479. new String:info[256];
  11480. GetMenuItem(menu, select, info, 256);
  11481. if(select == 0)
  11482. {
  11483. ShopLog_Type(Client, info);
  11484. }
  11485. else
  11486. {
  11487. ShopLog_Minute(Client, info);
  11488. }
  11489. }
  11490. if(action == MenuAction_End)
  11491. {
  11492. CloseHandle(menu);
  11493. }
  11494. }
  11495.  
  11496. public ShopLog_Minute(Client, String:info[256])
  11497. {
  11498. new Handle:menuhandle = CreateMenu(ShopLog_Minute_CallBack);
  11499. SetMenuTitle(menuhandle, "Set minutes.(Log):%s", info);
  11500. new String:Formatting[256], String:Formatting2[256];
  11501. AddMenuItem(menuhandle, info, "See minute log");
  11502. for(new i; i<=59; i++)
  11503. {
  11504. if(i < 10) Format(Formatting, 256, "%s:0%i", info, i);
  11505. else Format(Formatting, 256, "%s:%i", info, i);
  11506. Format(Formatting2, 256, "%i Min", i);
  11507. AddMenuItem(menuhandle, Formatting, Formatting2);
  11508. }
  11509. SetMenuExitButton(menuhandle, true);
  11510. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  11511. }
  11512.  
  11513. public ShopLog_Minute_CallBack(Handle:menu, MenuAction:action, Client, select)
  11514. {
  11515. if(action == MenuAction_Select)
  11516. {
  11517. new String:info[256];
  11518. GetMenuItem(menu, select, info, 256);
  11519. ShopLog_Type(Client, info);
  11520. }
  11521. if(action == MenuAction_End)
  11522. {
  11523. CloseHandle(menu);
  11524. }
  11525. }
  11526.  
  11527. stock ShopLog_Type(Client, String:info[256], bool:Target=false)
  11528. {
  11529. new Handle:menuhandle;
  11530. if(Target)
  11531. menuhandle = CreateMenu(ShopLog_Type_CallBack2);
  11532. else
  11533. menuhandle = CreateMenu(ShopLog_Type_CallBack);
  11534. SetMenuTitle(menuhandle, "로그 타입을 정하세요.(로그):%s", info);
  11535. AddMenuItem(menuhandle, info, "전체 로그 보기");
  11536. AddMenuItem(menuhandle, info, "사기 로그 보기");
  11537. AddMenuItem(menuhandle, info, "사용하기 로그 보기");
  11538. AddMenuItem(menuhandle, info, "팔기 로그 보기");
  11539. AddMenuItem(menuhandle, info, "버리기 로그 보기");
  11540. AddMenuItem(menuhandle, info, "착용해제하기 로그 보기");
  11541. AddMenuItem(menuhandle, info, "선물하기 로그 보기");
  11542. AddMenuItem(menuhandle, info, "선물받기 로그 보기");
  11543. AddMenuItem(menuhandle, info, "유저거래시장 업로드 로그 보기");
  11544. AddMenuItem(menuhandle, info, "유저거래시장 사기 로그 보기");
  11545. AddMenuItem(menuhandle, info, "유저거래시장 팔기 로그 보기");
  11546. SetMenuExitButton(menuhandle, true);
  11547. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  11548. }
  11549.  
  11550. public ShopLog_Type_CallBack(Handle:menu, MenuAction:action, Client, select)
  11551. {
  11552. if(action == MenuAction_Select)
  11553. {
  11554. new String:info[256], String:SteamID[256], String:query[512];
  11555. GetMenuItem(menu, select, info, 256);
  11556. GetClientAuthString(Client, SteamID, 256);
  11557. if(!select)
  11558. {
  11559. new Handle:pack = CreateDataPack();
  11560. WritePackCell(pack, Client);
  11561. WritePackString(pack, info);
  11562. Format(query, 512, "SELECT * FROM shoplog WHERE steamid = '%s';", SteamID);
  11563. SQL_TQuery(databasehandle, ShowShopLog, query, pack);
  11564. }
  11565. else
  11566. {
  11567. new String:Formatting[256];
  11568. Format(Formatting, 256, "SELECT * FROM shoplog WHERE type = '%i' AND steamid = '%s';", select-1, SteamID);
  11569. new Handle:pack = CreateDataPack();
  11570. WritePackCell(pack, Client);
  11571. WritePackString(pack, info);
  11572. SQL_TQuery(databasehandle, ShowShopLog, Formatting, pack);
  11573. }
  11574. }
  11575. if(action == MenuAction_End)
  11576. {
  11577. CloseHandle(menu);
  11578. }
  11579. }
  11580.  
  11581. public ShopLog_Type_CallBack2(Handle:menu, MenuAction:action, Client, select)
  11582. {
  11583. if(action == MenuAction_Select)
  11584. {
  11585. new String:info[256], String:query[512];
  11586. GetMenuItem(menu, select, info, 256);
  11587. if(!select)
  11588. {
  11589. new Handle:pack = CreateDataPack();
  11590. WritePackCell(pack, Client);
  11591. WritePackString(pack, info);
  11592. Format(query, 512, "SELECT * FROM shoplog WHERE steamid = '%s';", LastSteamID[Client]);
  11593. SQL_TQuery(databasehandle, ShowShopLog, query, pack);
  11594. }
  11595. else
  11596. {
  11597. new String:Formatting[256];
  11598. Format(Formatting, 256, "SELECT * FROM shoplog WHERE type = '%i' AND steamid = '%s';", select-1, LastSteamID[Client]);
  11599. new Handle:pack = CreateDataPack();
  11600. WritePackCell(pack, Client);
  11601. WritePackString(pack, info);
  11602. SQL_TQuery(databasehandle, ShowShopLog, Formatting, pack);
  11603. }
  11604. }
  11605. if(action == MenuAction_End)
  11606. {
  11607. CloseHandle(menu);
  11608. }
  11609. }
  11610.  
  11611. public ShowShopLog(Handle:owner, Handle:handle, const String:error[], any:pack)
  11612. {
  11613. ResetPack(pack);
  11614. new Client = ReadPackCell(pack);
  11615. new String:Time[128], String:Date[128], String:Log[256], bool:check, count;
  11616. ReadPackString(pack, Time, 128);
  11617. if(handle == INVALID_HANDLE)
  11618. {
  11619. LogError("Show ShopLog Error: %s", error);
  11620. PrintChat(Client, "Show ShopLog Error");
  11621. }
  11622. else if(SQL_GetRowCount(handle))
  11623. {
  11624. new Handle:menuhandle = CreateMenu(NULL_CallBack);
  11625. SetMenuTitle(menuhandle, "ShopLog : %s", Time);
  11626. new counted = SQL_GetRowCount(handle);
  11627. if(counted > 0)
  11628. {
  11629. if(SQL_HasResultSet(handle))
  11630. {
  11631. while(SQL_FetchRow(handle))
  11632. {
  11633. SQL_FetchString(handle, 4, Date, 128);
  11634. if(StrContains(Date, Time, false) == 0)
  11635. {
  11636. SQL_FetchString(handle, 2, Log, 256);
  11637. if(count % 3 != 0)
  11638. {
  11639. AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  11640. AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
  11641. }
  11642. Format(Log, 256, "%s{%s}", Log, Date);
  11643. AddMenuItem(menuhandle, Log, Log, ITEMDRAW_DISABLED);
  11644. check = true;
  11645. count++;
  11646. }
  11647. }
  11648. }
  11649. }
  11650. if(check)
  11651. {
  11652. SetMenuExitButton(menuhandle, true);
  11653. DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
  11654. }
  11655. else PrintChat(Client, "해당 로그가 존재하지 않습니다.");
  11656. }
  11657. }
  11658.  
  11659. stock ChangeNickname(Client, type=0)
  11660. {
  11661. if(JoinCheck(Client))
  11662. {
  11663. new String:ClientName[256], String:query[512], String:SteamID[256];
  11664. GetClientName(Client, ClientName, 256);
  11665. GetClientAuthString(Client, SteamID, 256);
  11666. if(type % 2 == 1) ClientName[strlen(ClientName)-1] = '\x0';
  11667. if(type >= 2) ClientName[strlen(ClientName)-2] = '\x0';
  11668. Format(query, 512, "UPDATE info SET nick = '%s' WHERE steamid = '%s';", ClientName, SteamID);
  11669. if(!type) SQL_TQuery(databasehandle, check_error_nick, query, Client);
  11670. if(type == 1) SQL_TQuery(databasehandle, check_error_nick2, query, Client);
  11671. if(type == 2) SQL_TQuery(databasehandle, check_error_nick3, query, Client);
  11672. if(type == 3) SQL_TQuery(databasehandle, save_info, query, Client);
  11673. Format(query, 512, "UPDATE countermarket SET nick = '%s' WHERE steamid = '%s';", ClientName, SteamID);
  11674. if(!type) SQL_TQuery(databasehandle, save_info_nolog, query, Client);
  11675. if(type == 1) SQL_TQuery(databasehandle, save_info_nolog, query, Client);
  11676. if(type == 2) SQL_TQuery(databasehandle, save_info_nolog, query, Client);
  11677. if(type == 3) SQL_TQuery(databasehandle, save_info_nolog, query, Client);
  11678. }
  11679. }
  11680.  
  11681. public check_error_nick(Handle:owner, Handle:hndl, const String:error[], any:Client)
  11682. {
  11683. if(hndl == INVALID_HANDLE) ChangeNickname(Client, 1);
  11684. }
  11685.  
  11686. public check_error_nick2(Handle:owner, Handle:hndl, const String:error[], any:Client)
  11687. {
  11688. if(hndl == INVALID_HANDLE) ChangeNickname(Client, 2);
  11689. }
  11690.  
  11691. public check_error_nick3(Handle:owner, Handle:hndl, const String:error[], any:Client)
  11692. {
  11693. if(hndl == INVALID_HANDLE) ChangeNickname(Client, 3);
  11694. }
  11695.  
  11696. stock SavePoint(Client)
  11697. {
  11698. if(DataLoaded[Client][0] && DataLoaded[Client][1] && DataLoaded[Client][2])
  11699. {
  11700. new String:query[512], String:SteamID[256];
  11701. GetClientAuthString(Client, SteamID, 256);
  11702. Format(query, 512, "UPDATE info SET point = '%i' WHERE steamid = '%s';", Point[Client], SteamID);
  11703. SQL_TQuery(databasehandle, save_info, query, Client);
  11704. }
  11705. }
  11706.  
  11707. stock SaveKarma(Client)
  11708. {
  11709. if(DataLoaded[Client][0] && DataLoaded[Client][1] && DataLoaded[Client][2])
  11710. {
  11711. new String:query[512], String:SteamID[256];
  11712. GetClientAuthString(Client, SteamID, 256);
  11713. Format(query, 512, "UPDATE info SET karma = '%i' WHERE steamid = '%s';", Karma[Client], SteamID);
  11714. SQL_TQuery(databasehandle, save_info, query, Client);
  11715. }
  11716. }
  11717.  
  11718. public GetPlayerMaxSpeed(client, &Float:MaxSpeed)
  11719. {
  11720. static OldButtons[MAXPLAYERS+1], Float:LastDashTime[MAXPLAYERS+1], bool:IsDash[MAXPLAYERS+1];
  11721. if(JoinCheck(client))
  11722. {
  11723. if(IsPlayerAlive(client))
  11724. {
  11725. new weapons = GetEntPropEnt(client, Prop_Data, "m_hActiveWeapon"), buttons = GetClientButtons(client);
  11726. if(IsValidEdict(weapons) && RPG[weapons]) MaxSpeed -= MaxSpeed/30.0;
  11727. else MaxSpeed -= MaxSpeed/20.0;
  11728. if(!(OldButtons[client] & IN_FORWARD) && buttons & IN_FORWARD && SpeedBoots[client])
  11729. {
  11730. if(!IsDash[client])
  11731. {
  11732. if((LastDashTime[client] == 0.0 || FloatSub(GetEngineTime(), LastDashTime[client]) > 0.2)) LastDashTime[client] = GetEngineTime();
  11733. else if(FloatSub(GetEngineTime(), LastDashTime[client]) <= 2.0) IsDash[client] = true;
  11734. }
  11735. }
  11736. if((IsDash[client] && !(buttons & IN_FORWARD)) || !SpeedBoots[client]) IsDash[client] = false;
  11737. if(IsDash[client] && !IsJihad[client]) MaxSpeed *= 1.6;
  11738. OldButtons[client] = buttons;
  11739. }
  11740. else
  11741. {
  11742. OldButtons[client] = 0;
  11743. LastDashTime[client] = 0.0;
  11744. IsDash[client] = false;
  11745. }
  11746. }
  11747. }
  11748.  
  11749. stock HudMsg(client, channel, Float:x, Float:y, const firstcolor[4], const secondcolor[4], effect, Float:fadein, Float:fadeout, Float:holdtime, Float:fxtime, const String:msg[], any:...)
  11750. {
  11751. new Handle:hudhandle = INVALID_HANDLE;
  11752.  
  11753. if(client == 0) hudhandle = StartMessageAll("HudMsg");
  11754. else hudhandle = StartMessageOne("HudMsg", client);
  11755.  
  11756. new String:txt[255];
  11757. VFormat(txt, sizeof(txt), msg, 13);
  11758.  
  11759. if(hudhandle != INVALID_HANDLE)
  11760. {
  11761. BfWriteByte(hudhandle, channel);
  11762. BfWriteFloat(hudhandle, x);
  11763. BfWriteFloat(hudhandle, y);
  11764.  
  11765. // 두번째 색깔
  11766. BfWriteByte(hudhandle, firstcolor[0]);
  11767. BfWriteByte(hudhandle, firstcolor[1]);
  11768. BfWriteByte(hudhandle, firstcolor[2]);
  11769. BfWriteByte(hudhandle, firstcolor[3]);
  11770.  
  11771. // 초기 색깔
  11772. BfWriteByte(hudhandle, secondcolor[0]);
  11773. BfWriteByte(hudhandle, secondcolor[1]);
  11774. BfWriteByte(hudhandle, secondcolor[2]);
  11775. BfWriteByte(hudhandle, secondcolor[3]);
  11776. BfWriteByte(hudhandle, effect);
  11777. BfWriteFloat(hudhandle, fadein);
  11778. BfWriteFloat(hudhandle, fadeout);
  11779. BfWriteFloat(hudhandle, holdtime);
  11780. BfWriteFloat(hudhandle, fxtime);
  11781. BfWriteString(hudhandle, txt);
  11782. EndMessage();
  11783. }
  11784. }
  11785.  
  11786. stock CreateWire(corpse, Float:position[3])
  11787. {
  11788. new socket = CreateEntityByName("prop_physics"), String:TargetName[256], String:RagdollTargetName[256];
  11789. GetEntPropString(corpse, Prop_Data, "m_iName", RagdollTargetName, 256);
  11790. Format(TargetName, 256, "%s%i", RagdollTargetName, socket);
  11791. DispatchKeyValueVector(socket, "origin", position);
  11792. DispatchKeyValue(socket, "targetname", TargetName);
  11793. DispatchKeyValue(socket, "model", "models/props/cs_italy/orange.mdl");
  11794. DispatchSpawn(socket);
  11795. SetEntityModel(socket, "models/props/cs_italy/orange.mdl");
  11796. TeleportEntity(socket, position, NULL_VECTOR, NULL_VECTOR);
  11797. SetEntityMoveType(socket, MOVETYPE_NONE);
  11798. SetEntProp(socket, Prop_Data, "m_takedamage", 0);
  11799. Phys_EnableMotion(socket, false);
  11800. SetEntityRenderMode(socket, RENDER_TRANSCOLOR);
  11801. SetEntityRenderColor(socket, 255, 255, 255, 0);
  11802. SetEntData(socket, CollOff, 2, 4, true);
  11803.  
  11804. new move = CreateEntityByName("move_rope"), String:Rope1TargetName[256], String:Rope2TargetName[256], Float:RagdollPosition[3];
  11805. new move2 = CreateEntityByName("keyframe_rope");
  11806.  
  11807. Format(Rope1TargetName, 256, "%s%i", RagdollTargetName, move);
  11808. GetEntPropVector(corpse, Prop_Send, "m_vecOrigin", RagdollPosition);
  11809. Format(Rope2TargetName, 256, "%s%i", RagdollTargetName, move2);
  11810.  
  11811. DispatchKeyValue(move, "targetname", Rope1TargetName);
  11812. DispatchKeyValue(move, "NextKey", Rope2TargetName);
  11813. DispatchKeyValue(move, "MoveSpeed", "64");
  11814. DispatchKeyValue(move, "Slack", "1");
  11815. DispatchKeyValue(move, "Type", "0");
  11816. DispatchKeyValue(move, "Subdiv", "2");
  11817. DispatchKeyValue(move, "Barbed", "0");
  11818. DispatchKeyValue(move, "Width", "1");
  11819. DispatchKeyValue(move, "TextureScale", "1");
  11820. DispatchKeyValue(move, "Collide", "1");
  11821. DispatchKeyValue(move, "Breakable", "1");
  11822. DispatchKeyValue(move, "RopeMaterial", "cable/rope.vmt");
  11823. DispatchKeyValue(move, "NoWind", "0");
  11824. DispatchKeyValue(move, "PositionInterpolator", "2");
  11825. DispatchKeyValueVector(move, "origin", RagdollPosition);
  11826. DispatchSpawn(move);
  11827. SetEntProp(move, Prop_Send, "m_iRopeMaterialModelIndex", PrecacheModel("cable/rope.vmt", true));
  11828. TeleportEntity(move, RagdollPosition, NULL_VECTOR, NULL_VECTOR);
  11829. IsRope[move] = true;
  11830.  
  11831. DispatchKeyValue(move2, "targetname", Rope2TargetName);
  11832. DispatchKeyValue(move2, "MoveSpeed", "64");
  11833. DispatchKeyValue(move2, "Slack", "1");
  11834. DispatchKeyValue(move2, "Type", "0");
  11835. DispatchKeyValue(move2, "Subdiv", "4");
  11836. DispatchKeyValue(move2, "Barbed", "0");
  11837. DispatchKeyValue(move2, "Width", "1");
  11838. DispatchKeyValue(move2, "TextureScale", "1");
  11839. DispatchKeyValue(move2, "Collide", "1");
  11840. DispatchKeyValue(move2, "Breakable", "1");
  11841. DispatchKeyValue(move2, "RopeMaterial", "cable/rope.vmt");
  11842. DispatchKeyValue(move2, "NoWind", "0");
  11843. DispatchKeyValue(move2, "PositionInterpolator", "2");
  11844. DispatchKeyValueVector(move2, "origin", position);
  11845. DispatchSpawn(move2);
  11846. SetEntProp(move2, Prop_Send, "m_iRopeMaterialModelIndex", PrecacheModel("cable/rope.vmt", true));
  11847. TeleportEntity(move2, position, NULL_VECTOR, NULL_VECTOR);
  11848. IsRope[move2] = true;
  11849. SetEntPropEnt(move, Prop_Send, "m_hStartPoint", corpse);
  11850. SetEntPropEnt(move, Prop_Send, "m_hEndPoint", move2);
  11851. SetEntPropVector(move, Prop_Send, "m_vecOrigin", RagdollPosition);
  11852. SetEntPropVector(move2, Prop_Send, "m_vecOrigin", position);
  11853. for(new i; i<4; i++)
  11854. {
  11855. if(!Wire[corpse][i][0] && !Wire[corpse][i][1] && !Wire[corpse][i][2])
  11856. {
  11857. Wire[corpse][i][0] = EntRefToEntIndex(socket);
  11858. Wire[corpse][i][1] = move;
  11859. Wire[corpse][i][2] = move2;
  11860. new Handle:pack = CreateDataPack();
  11861. WritePackCell(pack, corpse);
  11862. WritePackCell(pack, i);
  11863. WritePackFloat(pack, position[0]);
  11864. WritePackFloat(pack, position[1]);
  11865. WritePackFloat(pack, position[2]);
  11866. CreateTimer(0.1, RopeThink, pack, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE|TIMER_DATA_HNDL_CLOSE);
  11867. break;
  11868. }
  11869. }
  11870. Phys_CreateLengthConstraint(socket, corpse, INVALID_HANDLE, NULL_VECTOR, NULL_VECTOR, 30.0);
  11871. }
  11872.  
  11873. public Action:RopeThink(Handle:timer, Handle:pack)
  11874. {
  11875. ResetPack(pack);
  11876. new corpse = ReadPackCell(pack);
  11877. new number = ReadPackCell(pack);
  11878. new Float:position[4][3];
  11879. position[number][0] = ReadPackFloat(pack);
  11880. position[number][1] = ReadPackFloat(pack);
  11881. position[number][2] = ReadPackFloat(pack);
  11882. if(chosen && IsValidEdict(corpse))
  11883. {
  11884. new Float:entityposition[3], Float:entityposition2[3];
  11885. GetEntPropVector(EntIndexToEntRef(corpse), Prop_Send, "m_vecOrigin", entityposition);
  11886. GetEntPropVector(corpse, Prop_Send, "m_vecOrigin", entityposition2);
  11887. if(Wire[corpse][number][0] && Wire[corpse][number][1] && Wire[corpse][number][2] && IsValidEdict(Wire[corpse][number][1]) && IsValidEdict(Wire[corpse][number][2]))
  11888. {
  11889. if(GetVectorDistance(position[number], entityposition, false) > 300.0)
  11890. {
  11891. AcceptEntityInput(Wire[corpse][number][0], "Kill");
  11892. AcceptEntityInput(Wire[corpse][number][1], "Break");
  11893. AcceptEntityInput(Wire[corpse][number][2], "Break");
  11894. CreateTimer(1.0, DeleteEntity, Wire[corpse][number][1]);
  11895. CreateTimer(1.0, DeleteEntity, Wire[corpse][number][2]);
  11896. IsRope[Wire[corpse][number][1]] = false;
  11897. IsRope[Wire[corpse][number][2]] = false;
  11898. Wire[corpse][number][0] = 0;
  11899. Wire[corpse][number][1] = 0;
  11900. Wire[corpse][number][2] = 0;
  11901. return Plugin_Stop;
  11902. }
  11903. }
  11904. }
  11905. else
  11906. {
  11907. for(new i; i<4; i++)
  11908. {
  11909. if(Wire[corpse][i][0] && Wire[corpse][i][1] && Wire[corpse][i][2] && IsValidEdict(Wire[corpse][i][1]) && IsValidEdict(Wire[corpse][i][2]))
  11910. {
  11911. AcceptEntityInput(Wire[corpse][i][0], "Kill");
  11912. AcceptEntityInput(Wire[corpse][i][1], "Break");
  11913. AcceptEntityInput(Wire[corpse][i][2], "Break");
  11914. CreateTimer(1.0, DeleteEntity, Wire[corpse][i][1]);
  11915. CreateTimer(1.0, DeleteEntity, Wire[corpse][i][2]);
  11916. IsRope[Wire[corpse][number][1]] = false;
  11917. IsRope[Wire[corpse][number][2]] = false;
  11918. Wire[corpse][i][0] = 0;
  11919. Wire[corpse][i][1] = 0;
  11920. Wire[corpse][i][2] = 0;
  11921. }
  11922. }
  11923. return Plugin_Stop;
  11924. }
  11925. return Plugin_Continue;
  11926. }
  11927.  
  11928. public Action:SetClientiClip2_Pre(Handle:timer, Handle:pack)
  11929. {
  11930. ResetPack(pack);
  11931. new Client = ReadPackCell(pack);
  11932. new ammo = ReadPackCell(pack);
  11933. new weapons = ReadPackCell(pack);
  11934. if(JoinCheck(Client) && IsPlayerAlive(Client) && IsValidEdict(weapons) && IsValidEntity(weapons))
  11935. {
  11936. SetClientiClip2(weapons, Client, ammo);
  11937. }
  11938. }
  11939.  
  11940. stock SetClientiClip2(weapon, Client, ammo)
  11941. {
  11942. new type = GetEntData(weapon, AmmoType);
  11943. if(type > 0 && type < 11)
  11944. {
  11945. SetEntData(Client, Ammo+(type<<2), ammo, 4, true);
  11946. }
  11947. }
  11948.  
  11949. stock GetClientiClip2(weapon, Client)
  11950. {
  11951. new type = GetEntData(weapon, AmmoType);
  11952. if(type > 0 && type < 11)
  11953. {
  11954. return GetEntData(Client, Ammo+(type<<2), 4);
  11955. }
  11956. return -1;
  11957. }
  11958.  
  11959. #define FFADE_IN 0x0001 // Just here so we don't pass 0 into the function
  11960. #define FFADE_OUT 0x0002 // Fade out (not in)
  11961. #define FFADE_MODULATE 0x0004 // Modulate (don't blend)
  11962. #define FFADE_STAYOUT 0x0008 // ignores the duration, stays faded out until new ScreenFade message received
  11963. #define FFADE_PURGE 0x0010 // Purges all other fades, replacing them with this one
  11964. stock PerformFade(client, duration, const color[4])
  11965. {
  11966. new Handle:hFadeClient=StartMessageOne("Fade",client);
  11967. BfWriteShort(hFadeClient,duration); // FIXED 16 bit, with SCREENFADE_FRACBITS fractional, seconds duration
  11968. BfWriteShort(hFadeClient,0); // FIXED 16 bit, with SCREENFADE_FRACBITS fractional, seconds duration until reset (fade & hold)
  11969. BfWriteShort(hFadeClient,(FFADE_PURGE)); // fade type (in / out)
  11970. BfWriteByte(hFadeClient,color[0]); // fade red
  11971. BfWriteByte(hFadeClient,color[1]); // fade green
  11972. BfWriteByte(hFadeClient,color[2]); // fade blue
  11973. BfWriteByte(hFadeClient,color[3]); // fade alpha
  11974. EndMessage();
  11975. }
  11976.  
  11977. stock makeZombie(Client)
  11978. {
  11979. new Float:position[3];
  11980. GetClientAbsOrigin(Client, position);
  11981. position[2] -= 50.0;
  11982. new monster = Zombie_Spawn(position, "models/zombie/Poison.mdl", ZombieSeekThink, "npc_zombie", "Idle01");
  11983. Ragdoll[Client] = monster;
  11984. SDKHook(monster, SDKHook_OnTakeDamage, ZombieDamageHook);
  11985. }
  11986.  
  11987. stock Zombie_Spawn(Float:vEntPosition[3], String:model[128], SDKHookCB:ThinkFunction, String:classname[32], String:idleAnimation[])
  11988. {
  11989. decl String:entIndex[6];
  11990.  
  11991. new monster = CreateEntityByName("hostage_entity");
  11992. new monster_tmp = CreateEntityByName("prop_dynamic_ornament");
  11993.  
  11994. IntToString(monster_tmp, entIndex, sizeof(entIndex)-1);
  11995.  
  11996. DispatchKeyValue(monster, "classname", classname);
  11997. DispatchKeyValue(monster, "targetname", entIndex);
  11998. DispatchKeyValue(monster, "disableshadows", "1");
  11999. DispatchKeyValueFloat(monster, "friction", 1.2);
  12000.  
  12001. DispatchSpawn(monster);
  12002.  
  12003. SetEntProp(monster, Prop_Data, "m_iHealth", 3000);
  12004.  
  12005. SetEntityModel(monster, "models/blackout.mdl");
  12006.  
  12007. // Create the animated monster
  12008. DispatchKeyValue(monster_tmp, "model", model);
  12009. DispatchKeyValue(monster_tmp, "DefaultAnim", idleAnimation);
  12010. DispatchSpawn(monster_tmp);
  12011.  
  12012. // Set Position of the Hostage
  12013. TeleportEntity(monster, vEntPosition, NULL_VECTOR, NULL_VECTOR);
  12014.  
  12015. // Parent
  12016. SetVariantString(entIndex);
  12017. AcceptEntityInput(monster_tmp, "SetParent");
  12018. SetVariantString(entIndex);
  12019. AcceptEntityInput(monster_tmp, "SetAttached");
  12020.  
  12021. TeleportEntity(monster, vEntPosition, NULL_VECTOR, NULL_VECTOR);
  12022.  
  12023. SDKHook(monster, SDKHook_Think, ThinkFunction);
  12024.  
  12025. return monster;
  12026. }
  12027.  
  12028. public ZombieSeekThink(monster)
  12029. {
  12030. new Float:curtime = GetEngineTime();
  12031. if(FloatSub(NextThink[monster], curtime) <= 0.0) IsAttack[monster] = false;
  12032. decl target;
  12033. decl Float:vClientPosition[3], Float:vEntPosition[3];
  12034.  
  12035. BaseNPC_Think(monster, target);
  12036.  
  12037. GetEntPropVector(monster, Prop_Send, "m_vecOrigin", vEntPosition);
  12038.  
  12039. if(target > 0 && JoinCheck(target))
  12040. {
  12041. GetClientEyePosition(target, vClientPosition);
  12042. new Float:distance = GetVectorDistance(vClientPosition, vEntPosition, false);
  12043. if(distance < 125.0 && BaseNPC_CanSeeEachOther(monster, target) && !IsAttack[monster])
  12044. {
  12045. BaseNPC_SetAnimation(monster, "melee_01", 2.0);
  12046. EmitSoundToAll("npc/zombie/claw_strike1.wav", monster);
  12047. IsAttack[monster] = true;
  12048. if(monster && target) makeDamage(target, target, 12, DMG_ACID, 1.0, vClientPosition);
  12049. }
  12050. else if(FloatSub(NextThink[monster], curtime) <= 0.0)
  12051. {
  12052. switch (GetRandomInt(0, 2))
  12053. {
  12054. case 0:
  12055. {
  12056. BaseNPC_SetAnimation(monster, "Walk", 2.5);
  12057. EmitSoundToAll("npc/zombie/foot1.wav", monster);
  12058. }
  12059. case 1:
  12060. {
  12061. BaseNPC_SetAnimation(monster, "Walk", 2.5);
  12062. EmitSoundToAll("npc/zombie/foot2.wav", monster);
  12063. }
  12064. case 2:
  12065. {
  12066. BaseNPC_SetAnimation(monster, "Walk", 2.5);
  12067. EmitSoundToAll("npc/zombie/foot3.wav", monster);
  12068. }
  12069. }
  12070. }
  12071. }
  12072. else
  12073. {
  12074. BaseNPC_SetAnimation(monster, "Idle01", 3.0);
  12075. }
  12076. }
  12077.  
  12078. stock bool:BaseNPC_Think(monster, &target, Float:height=60.0)
  12079. {
  12080. new Float:entityposition[3], Float:ClientPosition[3], Float:dist;
  12081. GetEntPropVector(monster, Prop_Send, "m_vecOrigin", entityposition);
  12082. for(new i = 1; i <= MaxClients; i++)
  12083. {
  12084. if(IsClientConnected(i) && IsClientInGame(i) && IsPlayerAlive(i))
  12085. {
  12086. GetClientEyePosition(i, ClientPosition);
  12087. new Float:distance = GetVectorDistance(entityposition, ClientPosition, false);
  12088. if(BaseNPC_CanSeeEachOther(monster, i, height))
  12089. {
  12090. if(dist == 0.0 || dist > distance)
  12091. {
  12092. SetEntDataEnt2(monster, gLeaderOffset, i);
  12093. target = i;
  12094. dist = distance;
  12095. }
  12096. }
  12097. }
  12098. }
  12099. }
  12100.  
  12101. stock BaseNPC_CanSeeEachOther(monster, target, Float:monsterheight = 60.0)
  12102. {
  12103. new Float:vMonsterPosition[3], Float:vTargetPosition[3];
  12104.  
  12105. GetEntPropVector(monster, Prop_Send, "m_vecOrigin", vMonsterPosition);
  12106. vMonsterPosition[2] += monsterheight;
  12107.  
  12108. if(JoinCheck(target))
  12109. {
  12110. GetClientEyePosition(target, vTargetPosition);
  12111.  
  12112. new Handle:trace = TR_TraceRayFilterEx(vMonsterPosition, vTargetPosition, MASK_SOLID_BRUSHONLY, RayType_EndPoint, tracerayfilternotdefault);
  12113.  
  12114. if(TR_DidHit(trace))
  12115. {
  12116. CloseHandle(trace);
  12117. return false;
  12118. }
  12119.  
  12120. CloseHandle(trace);
  12121. return true;
  12122. }
  12123. return false;
  12124. }
  12125.  
  12126. stock Action:BaseNPC_SetAnimation(monster, String:animation[32], Float:animtime = 0.0)
  12127. {
  12128. new String:edictname[32];
  12129. GetEdictClassname(monster, edictname, 32);
  12130. if(!IsValidEdict(monster) || !IsValidEntity(monster) || StrContains(edictname, "npc_") == -1)
  12131. {
  12132. return;
  12133. }
  12134. decl String:tmp[32];
  12135. GetEntPropString(monster, Prop_Data, "m_iName", tmp, sizeof(tmp));
  12136. new monster_tmp = StringToInt(tmp);
  12137.  
  12138. SetVariantString(animation);
  12139. AcceptEntityInput(monster_tmp, "SetAnimation");
  12140.  
  12141. NextThink[monster] = GetEngineTime() + animtime;
  12142. }
  12143.  
  12144. stock bool:BaseNPC_Hurt(monster, attacker, damage = 0, String:sound[32])
  12145. {
  12146. new String:edictname[32];
  12147. GetEdictClassname(attacker, edictname, 32);
  12148. if(!StrEqual(edictname, "player")) return false;
  12149.  
  12150. new health = GetEntProp(monster, Prop_Data, "m_iHealth") - damage;
  12151. SetEntProp(monster, Prop_Data, "m_iHealth", health);
  12152.  
  12153. new Float:vEntPosition[3];
  12154. GetEntPropVector(monster, Prop_Send, "m_vecOrigin", vEntPosition);
  12155. EmitSoundToAll(sound, 0, SNDCHAN_AUTO, SNDLEVEL_NORMAL, SND_NOFLAGS, SNDVOL_NORMAL, SNDPITCH_NORMAL, -1, vEntPosition);
  12156.  
  12157. if(!GetEntDataEnt2(monster, gLeaderOffset)) SetEntDataEnt2(monster, gLeaderOffset, attacker);
  12158.  
  12159. if(health <= 0) return true;
  12160. else return false;
  12161. }
  12162.  
  12163. stock BaseNPC_Death(monster)
  12164. {
  12165. if(IsValidEntity(monster) && IsValidEdict(monster))
  12166. {
  12167. decl String:tmp[32], Float:Pos[3], Float:Angle[3];
  12168. GetEntPropString(monster, Prop_Data, "m_iName", tmp, sizeof(tmp));
  12169. GetEntPropVector(monster, Prop_Send, "m_vecOrigin", Pos);
  12170. GetEntPropVector(monster, Prop_Send, "m_angRotation", Angle);
  12171. new monster_tmp = StringToInt(tmp);
  12172. SetEntityMoveType(monster, MOVETYPE_VPHYSICS);
  12173. AcceptEntityInput(monster, "Kill");
  12174. AcceptEntityInput(monster_tmp, "Kill");
  12175.  
  12176. //래그돌은 프롭이 무난함
  12177. new ragdoll = CreateEntityByName("prop_ragdoll"), String:TargetName[256];
  12178. Format(TargetName, 256, "%i", ragdoll);
  12179. DispatchKeyValue(ragdoll, "targetname", TargetName);
  12180. DispatchKeyValue(ragdoll, "model", "models/zombie/Poison.mdl");
  12181. DispatchSpawn(ragdoll);
  12182. SetEntProp(ragdoll, Prop_Send, "m_CollisionGroup", 2);
  12183. SetEntityModel(ragdoll, "models/zombie/Poison.mdl");
  12184. Pos[2] += 30.0;
  12185. SetEntPropVector(ragdoll, Prop_Send, "m_vecOrigin", Pos);
  12186. TeleportEntity(ragdoll, Pos, Angle, NULL_VECTOR);
  12187. }
  12188. }
  12189.  
  12190. public Action:SoundCallBackHook(clients[64], &numClients, String:sample[PLATFORM_MAX_PATH], &entity, &channel, &Float:volume, &level, &pitch, &flags)
  12191. {
  12192. if(StrEqual(sample, "items/itempickup.wav")) return Plugin_Handled;//아이템 살때 사운드를 안들리게 막아준다.
  12193. if(StrEqual(sample, "weapons/ClipEmpty_Rifle.wav")) return Plugin_Handled;//F1, F2키 눌렀을때 나오는 사운드를 막아준다.
  12194. new Owner = GetEntPropEnt(entity, Prop_Send, "m_hOwnerEntity");
  12195. if(Owner > 0 && Owner <= MaxClients)
  12196. {
  12197. if(!StrContains(sample, "weapons/knife/knife_slash"))
  12198. {
  12199. EmitSoundToAll("weapons/iceaxe/iceaxe_swing1.wav", Owner, channel, level, flags, volume);
  12200. return Plugin_Handled;
  12201. }
  12202. if(StrEqual(sample, "weapons/knife/knife_stab.wav"))
  12203. {
  12204. EmitSoundToAll("tttmusic/body_medium_impact_hard6.wav", Owner, channel, level, flags, volume);
  12205. return Plugin_Handled;
  12206. }
  12207. if(StrEqual(sample, "weapons/knife/knife_hitwall1.wav"))
  12208. {
  12209. EmitSoundToAll("weapons/knife/knife_hitwall1.wav", Owner, channel, level, flags, volume);
  12210. return Plugin_Handled;
  12211. }
  12212. else if(!StrContains(sample, "weapons/knife/knife_hit"))
  12213. {
  12214. new String:StringSound[32];
  12215. Format(StringSound, 32, "weapons/knife/knife_hit%i.wav", GetRandomInt(1, 4));
  12216. EmitSoundToAll(StringSound, Owner, channel, level, flags, volume);
  12217. return Plugin_Handled;
  12218. }
  12219. }
  12220. if(StrContains(sample, "player/death") == 0) return Plugin_Handled;
  12221. return Plugin_Continue;
  12222. }
  12223.  
  12224. public Action:TE_Hook_ShotgunShot(const String:te_name[], const Players[], numClients, Float:delay)
  12225. {
  12226. new Client = TE_ReadNum("m_iPlayer")+1;
  12227. new weapons = GetEntPropEnt(Client, Prop_Data, "m_hActiveWeapon"), String:classname[32];
  12228. if(weapons > 0 && IsValidEdict(weapons)) GetEdictClassname(weapons, classname, 32);
  12229. if(TE_ReadNum("m_iMode") < 2)
  12230. {
  12231. if(StrEqual(classname, "weapon_awp", false) && Silenced_Sniper_Rifle[weapons])
  12232. {
  12233. new Float:Vector[3], Float:angle[3], seedvalue;
  12234. GetClientEyePosition(Client, Vector);
  12235. GetClientEyeAngles(Client, angle);
  12236. seedvalue = TE_ReadNum("m_iSeed");
  12237. TE_Start("Shotgun Shot");
  12238. TE_WriteVector("m_vecOrigin", Vector);
  12239. TE_WriteFloat("m_vecAngles[0]", angle[0]);
  12240. TE_WriteFloat("m_vecAngles[1]", angle[1]);
  12241. TE_WriteFloat("m_fInaccuracy", 0.0);
  12242. TE_WriteFloat("m_fSpread", 0.0);
  12243. TE_WriteNum("m_iPlayer", Client-1);
  12244. TE_WriteNum("m_iMode", 3);
  12245. TE_WriteNum("m_iSeed", seedvalue);
  12246. TE_WriteNum("m_iWeaponID", 21);
  12247. TE_SendToAll();
  12248. return Plugin_Stop;
  12249. }
  12250. if(StrEqual(classname, "weapon_p228", false))
  12251. {
  12252. new Float:Vector[3], Float:angle[3], seedvalue;
  12253. GetClientEyePosition(Client, Vector);
  12254. GetClientEyeAngles(Client, angle);
  12255. seedvalue = TE_ReadNum("m_iSeed");
  12256. TE_Start("Shotgun Shot");
  12257. TE_WriteVector("m_vecOrigin", Vector);
  12258. TE_WriteFloat("m_vecAngles[0]", angle[0]);
  12259. TE_WriteFloat("m_vecAngles[1]", angle[1]);
  12260. TE_WriteFloat("m_fInaccuracy", 0.0);
  12261. TE_WriteFloat("m_fSpread", 0.0);
  12262. TE_WriteNum("m_iPlayer", Client-1);
  12263. TE_WriteNum("m_iMode", 2);
  12264. TE_WriteNum("m_iSeed", seedvalue);
  12265. TE_WriteNum("m_iWeaponID", 4);
  12266. TE_SendToAll();
  12267. return Plugin_Stop;
  12268. }
  12269. }
  12270. return Plugin_Continue;
  12271. }
  12272.  
  12273. stock CalculateHour(year, month, day, hour, plushour, &returnyear, &returnmonth, &returnday, &returnhour)
  12274. {
  12275. new bool:loop;
  12276. returnyear = year;
  12277. returnmonth = month;
  12278. returnday = day;
  12279. returnhour = hour + plushour;
  12280. while(!loop)
  12281. {
  12282. loop = true;
  12283. if(returnhour >= 24)
  12284. {
  12285. returnday += 1;
  12286. returnhour -= 24;
  12287. loop = false;
  12288. }
  12289. if(month == 2)
  12290. {
  12291. if((returnyear % 400 == 0 && returnyear % 100 == 0) || (returnyear % 100 != 0 && returnyear % 4 == 0))//윤년일때
  12292. {
  12293. if(returnday > 29)
  12294. {
  12295. returnmonth += 1;
  12296. returnday -= 29;
  12297. loop = false;
  12298. }
  12299. }
  12300. else//윤년이 아닐때
  12301. {
  12302. if(returnday > 28)
  12303. {
  12304. returnmonth += 1;
  12305. returnday -= 28;
  12306. loop = false;
  12307. }
  12308. }
  12309. }
  12310. else if((returnmonth <= 7 && returnmonth % 2 == 1) || (returnmonth > 7 && returnmonth % 2 == 0))//31일이면
  12311. {
  12312. if(returnday > 31)
  12313. {
  12314. returnmonth += 1;
  12315. returnday -= 31;
  12316. loop = false;
  12317. }
  12318. }
  12319. else//30일이면
  12320. {
  12321. if(returnday > 30)
  12322. {
  12323. returnmonth += 1;
  12324. returnday -= 30;
  12325. loop = false;
  12326. }
  12327. }
  12328. if(returnmonth > 12)
  12329. {
  12330. returnyear += 1;
  12331. returnmonth -= 12;
  12332. loop = false;
  12333. }
  12334. }
  12335. }
  12336.  
  12337. stock Due_VIP_Check(Client, year, month, day, hour, minute)
  12338. {
  12339. if(IsClientInGame(Client))
  12340. {
  12341. new String:query[512], String:Time_Year[4], String:Time_Month[4], String:Time_Day[4], String:Time_Hour[4], String:Time_Minute[4], bool:Remove;
  12342. new String:SteamID[256];
  12343. GetClientAuthString(Client, SteamID, 256);
  12344. FormatTime(Time_Year, 30, "%Y", GetTime());
  12345. FormatTime(Time_Month, 30, "%m", GetTime());
  12346. FormatTime(Time_Day, 30, "%d", GetTime());
  12347. FormatTime(Time_Hour, 30, "%H", GetTime());
  12348. FormatTime(Time_Minute, 30, "%M", GetTime());
  12349. if(StringToInt(Time_Year) > year)
  12350. {
  12351. Remove = true;
  12352. }
  12353. else if(StringToInt(Time_Year) == year)
  12354. {
  12355. if(StringToInt(Time_Month) > month)
  12356. {
  12357. Remove = true;
  12358. }
  12359. else if(StringToInt(Time_Month) == month)
  12360. {
  12361. if(StringToInt(Time_Day) > day)
  12362. {
  12363. Remove = true;
  12364. }
  12365. else if(StringToInt(Time_Day) == day)
  12366. {
  12367. if(StringToInt(Time_Hour) > hour)
  12368. {
  12369. Remove = true;
  12370. }
  12371. else if(StringToInt(Time_Hour) == hour)
  12372. {
  12373. if(StringToInt(Time_Minute) >= minute)
  12374. {
  12375. Remove = true;
  12376. }
  12377. }
  12378. }
  12379. }
  12380. }
  12381. if(Remove)
  12382. {
  12383. Format(query, 512, "DELETE FROM vip WHERE steamid = '%s';", SteamID);
  12384. SQL_TQuery(databasehandle, save_info, query, Client);
  12385. PrintChat(Client, "\x07FFFFFFVIP Time is done.");
  12386. if(VIP[Client]) VIP[Client] = 0;
  12387. }
  12388. }
  12389. }
  12390.  
  12391. stock GetPlayerStuckEnt(client)
  12392. {
  12393. decl Float:vecMin[3], Float:vecMax[3], Float:vecOrigin[3];
  12394.  
  12395. GetClientMins(client, vecMin);
  12396. GetClientMaxs(client, vecMax);
  12397.  
  12398. GetClientAbsOrigin(client, vecOrigin);
  12399.  
  12400. TR_TraceHullFilter(vecOrigin, vecOrigin, vecMin, vecMax, MASK_PLAYERSOLID, tracerayfilteronlyplayer2, client);
  12401. return TR_GetEntityIndex();
  12402. }
  12403.  
  12404. MountLadder(client)
  12405. {
  12406. //LogMessage("Client %i: MountLadder", client);
  12407.  
  12408. //SetEntityMoveType(client, MOVETYPE_NONE);
  12409. //SetEntityMoveType(client, MOVETYPE_FLY);
  12410. //SetEntPropFloat(client, Prop_Data, "m_flFriction", 0.001);
  12411. //SetEntityGravity(client, 0.0);
  12412.  
  12413. SDKHook(client, SDKHook_PreThink, MoveOnLadder);
  12414. }
  12415.  
  12416. DismountLadder(client)
  12417. {
  12418. //LogMessage("Client %i: DismountLadder", client);
  12419.  
  12420. SetEntityMoveType(client, MOVETYPE_WALK);
  12421. //SetEntPropFloat(client, Prop_Data, "m_flFriction", 1.0);
  12422.  
  12423. SDKUnhook(client, SDKHook_PreThink, MoveOnLadder);
  12424. }
  12425.  
  12426. public MoveOnLadder(client)
  12427. {
  12428. new Float:speed = GetEntPropFloat(client, Prop_Send, "m_flMaxspeed");
  12429.  
  12430. decl buttons;
  12431. buttons = GetClientButtons(client);
  12432.  
  12433. decl Float:origin[3];
  12434. GetClientAbsOrigin(client, origin);
  12435.  
  12436. new bool:movingUp = (origin[2] > lastZ[client]);
  12437. lastZ[client] = origin[2];
  12438.  
  12439. decl Float:angles[3];
  12440. GetClientEyeAngles(client, angles);
  12441.  
  12442. decl Float:velocity[3];
  12443.  
  12444. SetEntityMoveType(client, MOVETYPE_WALK);
  12445.  
  12446. if(buttons & IN_FORWARD || buttons & IN_JUMP) {
  12447. velocity[0] = speed * Cosine(DegToRad(angles[1]));
  12448. velocity[1] = speed * Sine(DegToRad(angles[1]));
  12449. velocity[2] = -1 * speed * Sine(DegToRad(angles[0]));
  12450.  
  12451. // Soldier and heavy do not achieve the required velocity to get off the
  12452. // ground. The calculation below provides a boost when necessary.
  12453. if (!movingUp && angles[0] < -25.0 && velocity[2] > 0 && velocity[2] < 200.0) {
  12454. //LogMessage("Client %i: BOOST", client);
  12455. // is friction on different surfaces an issue?
  12456. velocity[2] = 200.1;
  12457. }
  12458.  
  12459. //LogMessage("Client %i: Forward %f %f", client, angles[0], velocity[2]);
  12460. } else if(buttons & IN_MOVELEFT) {
  12461. velocity[0] = speed * Cosine(DegToRad(angles[1] + 45));
  12462. velocity[1] = speed * Sine(DegToRad(angles[1] + 45));
  12463. velocity[2] = -1 * speed * Sine(DegToRad(angles[0]));
  12464.  
  12465. //LogMessage("Client %i: Left", client);
  12466. } else if(buttons & IN_MOVERIGHT) {
  12467. velocity[0] = speed * Cosine(DegToRad(angles[1] - 45));
  12468. velocity[1] = speed * Sine(DegToRad(angles[1] - 45));
  12469. velocity[2] = -1 * speed * Sine(DegToRad(angles[0]));
  12470.  
  12471. //LogMessage("Client %i: Right", client);
  12472. } else if(buttons & IN_BACK) {
  12473. velocity[0] = -1 * speed * Cosine(DegToRad(angles[1]));
  12474. velocity[1] = -1 * speed * Sine(DegToRad(angles[1]));
  12475. velocity[2] = speed * Sine(DegToRad(angles[0]));
  12476.  
  12477. //LogMessage("Client %i: Backwards", client);
  12478. } else {
  12479. velocity[0] = 0.0;
  12480. velocity[1] = 0.0;
  12481. velocity[2] = 0.0;
  12482.  
  12483. //LogMessage("Client %i: Hold", client);
  12484. SetEntityMoveType(client, MOVETYPE_FLY);
  12485. }
  12486.  
  12487. TeleportEntity(client, origin, NULL_VECTOR, velocity);
  12488. }
  12489.  
  12490. public Action:ShowMOTD(Handle:timer, any:Client)
  12491. {
  12492. ShowLongMOTD(Client,"Title","motd2", false);
  12493. }
  12494.  
  12495. ShowLongMOTD(client,const String:title[],const String:panel[], bool:see)
  12496. {
  12497. new Handle:kv = CreateKeyValues("data");
  12498.  
  12499. KvSetString(kv,"title",title);
  12500. KvSetString(kv,"type","1");
  12501. KvSetString(kv,"msg",panel);
  12502. ShowVGUIPanel(client,"info",kv,see);
  12503. CloseHandle(kv);
  12504. }
  12505.  
  12506. bool:SetLongMOTD(const String:panel[],const String:text[])
  12507. {
  12508. new table = FindStringTable("InfoPanel");
  12509.  
  12510. if(table != INVALID_STRING_TABLE)
  12511. {
  12512. new len = strlen(text);
  12513. new str = FindStringIndex(table,panel);
  12514. new bool:locked = LockStringTables(false);
  12515.  
  12516. if(str == INVALID_STRING_INDEX || str == 65535)//for some reason it keeps returning 65535
  12517. {
  12518. AddToStringTable(table,panel,text,len);
  12519. }
  12520. else
  12521. {
  12522. SetStringTableData(table,str,text,len);
  12523. }
  12524. LockStringTables(locked);
  12525. return true;
  12526. }
  12527. return false;
  12528. }
  12529.  
  12530. public Action:DrawZone(Handle:timer, any:Client)
  12531. {
  12532. new Float:EndPos[3];
  12533. GetClientAbsOrigin(Client, EndPos);
  12534. new Float:CalculatePos1[3], Float:CalculatePos2[3], Float:CalculatePos3[3], Float:CalculatePos4[3], Float:CalculatePos5[3], Float:CalculatePos6[3], lasercolor[4];
  12535. lasercolor[0] = GetRandomInt(0, 255);
  12536. lasercolor[1] = GetRandomInt(0, 255);
  12537. lasercolor[2] = GetRandomInt(0, 255);
  12538. lasercolor[3] = 255;
  12539. CalculatePos1[0] = EndPos[0];
  12540. CalculatePos1[1] = StartPos[1];
  12541. CalculatePos1[2] = StartPos[2];
  12542.  
  12543. CalculatePos2[0] = StartPos[0];
  12544. CalculatePos2[1] = EndPos[1];
  12545. CalculatePos2[2] = StartPos[2];
  12546.  
  12547. CalculatePos3[0] = EndPos[0];
  12548. CalculatePos3[1] = EndPos[1];
  12549. CalculatePos3[2] = StartPos[2];
  12550.  
  12551. CalculatePos4[0] = EndPos[0];
  12552. CalculatePos4[1] = StartPos[1];
  12553. CalculatePos4[2] = EndPos[2];
  12554.  
  12555. CalculatePos5[0] = StartPos[0];
  12556. CalculatePos5[1] = StartPos[1];
  12557. CalculatePos5[2] = EndPos[2];
  12558.  
  12559. CalculatePos6[0] = StartPos[0];
  12560. CalculatePos6[1] = EndPos[1];
  12561. CalculatePos6[2] = EndPos[2];
  12562. TE_SetupBeamPoints(StartPos, CalculatePos1, PrecacheModel("materials/sprites/laser.vmt"), 0, 0, 0, 0.1, 2.0, 2.0, 0, 0.0, lasercolor, 0);
  12563. TE_SendToAll();
  12564. TE_SetupBeamPoints(StartPos, CalculatePos2, PrecacheModel("materials/sprites/laser.vmt"), 0, 0, 0, 0.1, 2.0, 2.0, 0, 0.0, lasercolor, 0);
  12565. TE_SendToAll();
  12566. TE_SetupBeamPoints(StartPos, CalculatePos5, PrecacheModel("materials/sprites/laser.vmt"), 0, 0, 0, 0.1, 2.0, 2.0, 0, 0.0, lasercolor, 0);
  12567. TE_SendToAll();
  12568. TE_SetupBeamPoints(CalculatePos1, CalculatePos3, PrecacheModel("materials/sprites/laser.vmt"), 0, 0, 0, 0.1, 2.0, 2.0, 0, 0.0, lasercolor, 0);
  12569. TE_SendToAll();
  12570. TE_SetupBeamPoints(CalculatePos1, CalculatePos4, PrecacheModel("materials/sprites/laser.vmt"), 0, 0, 0, 0.1, 2.0, 2.0, 0, 0.0, lasercolor, 0);
  12571. TE_SendToAll();
  12572. TE_SetupBeamPoints(CalculatePos2, CalculatePos3, PrecacheModel("materials/sprites/laser.vmt"), 0, 0, 0, 0.1, 2.0, 2.0, 0, 0.0, lasercolor, 0);
  12573. TE_SendToAll();
  12574. TE_SetupBeamPoints(CalculatePos2, CalculatePos6, PrecacheModel("materials/sprites/laser.vmt"), 0, 0, 0, 0.1, 2.0, 2.0, 0, 0.0, lasercolor, 0);
  12575. TE_SendToAll();
  12576. TE_SetupBeamPoints(CalculatePos3, EndPos, PrecacheModel("materials/sprites/laser.vmt"), 0, 0, 0, 0.1, 2.0, 2.0, 0, 0.0, lasercolor, 0);
  12577. TE_SendToAll();
  12578. TE_SetupBeamPoints(CalculatePos4, CalculatePos5, PrecacheModel("materials/sprites/laser.vmt"), 0, 0, 0, 0.1, 2.0, 2.0, 0, 0.0, lasercolor, 0);
  12579. TE_SendToAll();
  12580. TE_SetupBeamPoints(CalculatePos4, EndPos, PrecacheModel("materials/sprites/laser.vmt"), 0, 0, 0, 0.1, 2.0, 2.0, 0, 0.0, lasercolor, 0);
  12581. TE_SendToAll();
  12582. TE_SetupBeamPoints(CalculatePos5, CalculatePos6, PrecacheModel("materials/sprites/laser.vmt"), 0, 0, 0, 0.1, 2.0, 2.0, 0, 0.0, lasercolor, 0);
  12583. TE_SendToAll();
  12584. TE_SetupBeamPoints(CalculatePos6, EndPos, PrecacheModel("materials/sprites/laser.vmt"), 0, 0, 0, 0.1, 2.0, 2.0, 0, 0.0, lasercolor, 0);
  12585. TE_SendToAll();
  12586. }
  12587.  
  12588. stock CreateRotatingTrail(Client)
  12589. {
  12590. new Float:resultposition[3];
  12591. GetClientAbsOrigin(Client, resultposition);
  12592. resultposition[2] += 5.0;
  12593.  
  12594. new String:steamid2[64];
  12595. GetClientAuthString(Client, steamid2, 64);
  12596.  
  12597. new String:steamid3[64];
  12598.  
  12599. new func_rotating = CreateEntityByName("func_rotating");
  12600. DispatchKeyValueVector(func_rotating, "origin", resultposition);
  12601. Format(steamid3, 64, "%s%i", steamid2, GetRandomInt(0, 99999));
  12602. DispatchKeyValue(func_rotating, "targetname", steamid3);
  12603. DispatchKeyValue(func_rotating, "renderfx", "0");
  12604. DispatchKeyValue(func_rotating, "rendermode", "0");
  12605. DispatchKeyValue(func_rotating, "renderamt", "255");
  12606. DispatchKeyValue(func_rotating, "rendercolor", "255 255 255");
  12607. DispatchKeyValue(func_rotating, "maxspeed", "400");
  12608. DispatchKeyValue(func_rotating, "friction", "20");
  12609. DispatchKeyValue(func_rotating, "dmg", "0");
  12610. DispatchKeyValue(func_rotating, "solid", "0");
  12611. DispatchKeyValue(func_rotating, "spawnflags", "64");
  12612. DispatchSpawn(func_rotating);
  12613.  
  12614. if(GetPlayerWeaponSlot(Client, 4) == -1)
  12615. GivePlayerItem(Client, "weapon_c4");
  12616.  
  12617. resultposition[0] += 40.0;
  12618. new trail = CreateEntityByName("env_spritetrail");
  12619. DispatchKeyValueVector(trail,"Origin", resultposition);
  12620. DispatchKeyValue(trail, "lifetime", "0.4");
  12621. DispatchKeyValue(trail, "startwidth", "15.0");
  12622. DispatchKeyValue(trail, "endwidth", "5.0");
  12623. DispatchKeyValue(trail, "spritename", "materials/sprites/laser.vmt");
  12624. DispatchKeyValue(trail, "renderamt", "255");
  12625. DispatchKeyValue(trail, "rendercolor", "255 255 255");
  12626. DispatchKeyValue(trail, "rendermode", "5");
  12627. DispatchSpawn(trail);
  12628. SetVariantString(steamid3);
  12629. AcceptEntityInput(trail, "SetParent");
  12630. AcceptEntityInput(trail, "ShowSprite");
  12631. AcceptEntityInput(func_rotating, "Start");
  12632. DispatchKeyValue(GetPlayerWeaponSlot(Client, 4), "targetname", steamid2);
  12633. SetVariantString(steamid2);
  12634. AcceptEntityInput(func_rotating, "SetParent");
  12635.  
  12636. resultposition[0] -= 80.0;
  12637. trail = CreateEntityByName("env_spritetrail");
  12638. DispatchKeyValueVector(trail,"Origin", resultposition);
  12639. DispatchKeyValue(trail, "lifetime", "0.4");
  12640. DispatchKeyValue(trail, "startwidth", "15.0");
  12641. DispatchKeyValue(trail, "endwidth", "5.0");
  12642. DispatchKeyValue(trail, "spritename", "materials/sprites/laser.vmt");
  12643. DispatchKeyValue(trail, "renderamt", "255");
  12644. DispatchKeyValue(trail, "rendercolor", "255 255 255");
  12645. DispatchKeyValue(trail, "rendermode", "5");
  12646. DispatchSpawn(trail);
  12647. SetVariantString(steamid3);
  12648. AcceptEntityInput(trail, "SetParent");
  12649. AcceptEntityInput(trail, "ShowSprite");
  12650. AcceptEntityInput(func_rotating, "Start");
  12651. DispatchKeyValue(GetPlayerWeaponSlot(Client, 4), "targetname", steamid2);
  12652. SetVariantString(steamid2);
  12653. AcceptEntityInput(func_rotating, "SetParent");
  12654.  
  12655. resultposition[0] += 40.0;
  12656. resultposition[1] -= 40.0;
  12657. trail = CreateEntityByName("env_spritetrail");
  12658. DispatchKeyValueVector(trail,"Origin", resultposition);
  12659. DispatchKeyValue(trail, "lifetime", "0.4");
  12660. DispatchKeyValue(trail, "startwidth", "15.0");
  12661. DispatchKeyValue(trail, "endwidth", "5.0");
  12662. DispatchKeyValue(trail, "spritename", "materials/sprites/laser.vmt");
  12663. DispatchKeyValue(trail, "renderamt", "255");
  12664. DispatchKeyValue(trail, "rendercolor", "255 255 255");
  12665. DispatchKeyValue(trail, "rendermode", "5");
  12666. DispatchSpawn(trail);
  12667. SetVariantString(steamid3);
  12668. AcceptEntityInput(trail, "SetParent");
  12669. AcceptEntityInput(trail, "ShowSprite");
  12670. AcceptEntityInput(func_rotating, "Start");
  12671. DispatchKeyValue(GetPlayerWeaponSlot(Client, 4), "targetname", steamid2);
  12672. SetVariantString(steamid2);
  12673. AcceptEntityInput(func_rotating, "SetParent");
  12674.  
  12675. resultposition[1] += 80.0;
  12676. trail = CreateEntityByName("env_spritetrail");
  12677. DispatchKeyValueVector(trail,"Origin", resultposition);
  12678. DispatchKeyValue(trail, "lifetime", "0.4");
  12679. DispatchKeyValue(trail, "startwidth", "15.0");
  12680. DispatchKeyValue(trail, "endwidth", "5.0");
  12681. DispatchKeyValue(trail, "spritename", "materials/sprites/laser.vmt");
  12682. DispatchKeyValue(trail, "renderamt", "255");
  12683. DispatchKeyValue(trail, "rendercolor", "255 255 255");
  12684. DispatchKeyValue(trail, "rendermode", "5");
  12685. DispatchSpawn(trail);
  12686. SetVariantString(steamid3);
  12687. AcceptEntityInput(trail, "SetParent");
  12688. AcceptEntityInput(trail, "ShowSprite");
  12689. AcceptEntityInput(func_rotating, "Start");
  12690. DispatchKeyValue(GetPlayerWeaponSlot(Client, 4), "targetname", steamid2);
  12691. SetVariantString(steamid2);
  12692. AcceptEntityInput(func_rotating, "SetParent");
  12693. }
  12694.  
  12695. stock CreateRotatingTrail2(Client)
  12696. {
  12697. new Float:resultposition[3];
  12698. GetClientAbsOrigin(Client, resultposition);
  12699. resultposition[2] += 35.0;
  12700.  
  12701. new String:steamid2[64];
  12702. GetClientAuthString(Client, steamid2, 64);
  12703.  
  12704. new String:steamid3[64];
  12705. VIP_Trails_RotatingEntity[Client] = CreateEntityByName("func_rotating");
  12706. DispatchKeyValueVector(VIP_Trails_RotatingEntity[Client], "origin", resultposition);
  12707. Format(steamid3, 64, "%s%i", steamid2, GetRandomInt(0, 99999));
  12708. DispatchKeyValue(VIP_Trails_RotatingEntity[Client], "targetname", steamid3);
  12709. DispatchKeyValue(VIP_Trails_RotatingEntity[Client], "renderfx", "0");
  12710. DispatchKeyValue(VIP_Trails_RotatingEntity[Client], "rendermode", "0");
  12711. DispatchKeyValue(VIP_Trails_RotatingEntity[Client], "renderamt", "255");
  12712. DispatchKeyValue(VIP_Trails_RotatingEntity[Client], "rendercolor", "255 255 255");
  12713. DispatchKeyValue(VIP_Trails_RotatingEntity[Client], "maxspeed", "400");
  12714. DispatchKeyValue(VIP_Trails_RotatingEntity[Client], "friction", "20");
  12715. DispatchKeyValue(VIP_Trails_RotatingEntity[Client], "dmg", "0");
  12716. DispatchKeyValue(VIP_Trails_RotatingEntity[Client], "solid", "0");
  12717. DispatchKeyValue(VIP_Trails_RotatingEntity[Client], "spawnflags", "64");
  12718. DispatchSpawn(VIP_Trails_RotatingEntity[Client]);
  12719.  
  12720. if(GetPlayerWeaponSlot(Client, 4) == -1)
  12721. GivePlayerItem(Client, "weapon_c4");
  12722.  
  12723. resultposition[0] += 40.0;
  12724. new trail = CreateEntityByName("env_spritetrail");
  12725. DispatchKeyValueVector(trail,"Origin", resultposition);
  12726. DispatchKeyValue(trail, "lifetime", "0.4");
  12727. DispatchKeyValue(trail, "startwidth", "20.0");
  12728. DispatchKeyValue(trail, "endwidth", "10.0");
  12729. DispatchKeyValue(trail, "spritename", "materials/sprites/laser.vmt");
  12730. DispatchKeyValue(trail, "renderamt", "255");
  12731. DispatchKeyValue(trail, "rendercolor", "255 0 0");
  12732. DispatchKeyValue(trail, "rendermode", "5");
  12733. DispatchSpawn(trail);
  12734. SetVariantString(steamid3);
  12735. AcceptEntityInput(trail, "SetParent");
  12736. AcceptEntityInput(trail, "ShowSprite");
  12737. AcceptEntityInput(VIP_Trails_RotatingEntity[Client], "Start");
  12738. DispatchKeyValue(GetPlayerWeaponSlot(Client, 4), "targetname", steamid2);
  12739. SetVariantString(steamid2);
  12740. AcceptEntityInput(VIP_Trails_RotatingEntity[Client], "SetParent");
  12741.  
  12742. resultposition[2] -= 15.0;
  12743. resultposition[0] -= 80.0;
  12744. trail = CreateEntityByName("env_spritetrail");
  12745. DispatchKeyValueVector(trail,"Origin", resultposition);
  12746. DispatchKeyValue(trail, "lifetime", "0.4");
  12747. DispatchKeyValue(trail, "startwidth", "20.0");
  12748. DispatchKeyValue(trail, "endwidth", "10.0");
  12749. DispatchKeyValue(trail, "spritename", "materials/sprites/laser.vmt");
  12750. DispatchKeyValue(trail, "renderamt", "255");
  12751. DispatchKeyValue(trail, "rendercolor", "255 255 0");
  12752. DispatchKeyValue(trail, "rendermode", "5");
  12753. DispatchSpawn(trail);
  12754. SetVariantString(steamid3);
  12755. AcceptEntityInput(trail, "SetParent");
  12756. AcceptEntityInput(trail, "ShowSprite");
  12757. AcceptEntityInput(VIP_Trails_RotatingEntity[Client], "Start");
  12758. DispatchKeyValue(GetPlayerWeaponSlot(Client, 4), "targetname", steamid2);
  12759. SetVariantString(steamid2);
  12760. AcceptEntityInput(VIP_Trails_RotatingEntity[Client], "SetParent");
  12761.  
  12762. resultposition[2] -= 15.0;
  12763. resultposition[0] += 40.0;
  12764. resultposition[1] -= 40.0;
  12765. trail = CreateEntityByName("env_spritetrail");
  12766. DispatchKeyValueVector(trail,"Origin", resultposition);
  12767. DispatchKeyValue(trail, "lifetime", "0.4");
  12768. DispatchKeyValue(trail, "startwidth", "20.0");
  12769. DispatchKeyValue(trail, "endwidth", "10.0");
  12770. DispatchKeyValue(trail, "spritename", "materials/sprites/laser.vmt");
  12771. DispatchKeyValue(trail, "renderamt", "255");
  12772. DispatchKeyValue(trail, "rendercolor", "0 255 0");
  12773. DispatchKeyValue(trail, "rendermode", "5");
  12774. DispatchSpawn(trail);
  12775. SetVariantString(steamid3);
  12776. AcceptEntityInput(trail, "SetParent");
  12777. AcceptEntityInput(trail, "ShowSprite");
  12778. AcceptEntityInput(VIP_Trails_RotatingEntity[Client], "Start");
  12779. DispatchKeyValue(GetPlayerWeaponSlot(Client, 4), "targetname", steamid2);
  12780. SetVariantString(steamid2);
  12781. AcceptEntityInput(VIP_Trails_RotatingEntity[Client], "SetParent");
  12782.  
  12783. resultposition[2] -= 15.0;
  12784. resultposition[1] += 80.0;
  12785. trail = CreateEntityByName("env_spritetrail");
  12786. DispatchKeyValueVector(trail,"Origin", resultposition);
  12787. DispatchKeyValue(trail, "lifetime", "0.4");
  12788. DispatchKeyValue(trail, "startwidth", "15.0");
  12789. DispatchKeyValue(trail, "endwidth", "6.0");
  12790. DispatchKeyValue(trail, "spritename", "materials/sprites/laser.vmt");
  12791. DispatchKeyValue(trail, "renderamt", "255");
  12792. DispatchKeyValue(trail, "rendercolor", "0 0 255");
  12793. DispatchKeyValue(trail, "rendermode", "5");
  12794. DispatchSpawn(trail);
  12795. SetVariantString(steamid3);
  12796. AcceptEntityInput(trail, "SetParent");
  12797. AcceptEntityInput(trail, "ShowSprite");
  12798. AcceptEntityInput(VIP_Trails_RotatingEntity[Client], "Start");
  12799. DispatchKeyValue(GetPlayerWeaponSlot(Client, 4), "targetname", steamid2);
  12800. SetVariantString(steamid2);
  12801. AcceptEntityInput(VIP_Trails_RotatingEntity[Client], "SetParent");
  12802. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement