Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<sourcemod>
- #include<sdktools>
- #include<sdkhooks>
- #include<basecomm>
- #include<cstrike>
- #include<sendproxy_us>
- #include<cssspeedmod_us>
- new String:Path[256];
- new String:Path2[256];
- new String:Path3[256];
- //키ì¸ì‹ì„ 위한 변수
- new keybuffer[MAXPLAYERS+1];
- //헤드샷으로 ì£½ì—ˆëŠ”ì§€ì˜ ì—¬ë¶€
- new bool:IsHeadShot[MAXPLAYERS+1];
- //죽ì€ë¬´ê¸°
- new String:Weapon[MAXPLAYERS+1][256];
- //로드�
- new bool:DataLoaded[MAXPLAYERS+1][3];
- //재밌는거!
- new bool:Fun[MAXPLAYERS+1];
- new bool:Fun2[MAXPLAYERS+1];
- //넉백 ì–´íƒì»¤
- new KnockBackAttacker[MAXPLAYERS+1];
- new KnockBackAttackerDelay[MAXPLAYERS+1];
- //태우기 ì–´íƒì»¤
- new BurnOwner[MAXPLAYERS+1];
- //ì§ì—…
- new Job[MAXPLAYERS+1];
- //스프ë¼ì´íЏ
- new Sprites[MAXPLAYERS+1];
- //DNA스프ë¼ì´íЏ
- new DNASprites[2048];
- //DNA스프ë¼ì´íŠ¸ì˜ íŒ¨ëŸ°íŠ¸ info_target
- new info_target[2048];
- //í¬ë ˆë”§
- new Credit[MAXPLAYERS+1];
- //브금옵션
- //new bool:BGM[MAXPLAYERS+1];
- //í”Œë ˆì´íƒ€ìž„
- new Float:PlayingTime[MAXPLAYERS+1];
- //마지막 ì €ìž¥ëœ ì—”ì§„ì‹œê°„
- new Float:LastEngineTime[MAXPLAYERS+1];
- //ì±—ë”œë ˆì´
- new bool:ChatDelay[MAXPLAYERS+1];
- //ìžë™ìŠ¤ì™‘ë°©ì§€
- new bool:BlockWeaponUse[MAXPLAYERS+1];
- //살때 허용
- new bool:BuyAcceptWeapon[MAXPLAYERS+1];
- //죽ì¸ì‚¬ëžŒëª…단
- new String:TraitorKillList[MAXPLAYERS+1][256];
- //ë§žì€ ë¡œê·¸
- new String:HitLog[MAXPLAYERS+1][4096];
- //ì „íŒ ë§žì€ ë¡œê·¸
- new String:LastHitLog[MAXPLAYERS+1][4096];
- //때린 로그
- new String:AttackLog[MAXPLAYERS+1][4096];
- //ì „íŒ ë•Œë¦° 로그
- new String:LastAttackLog[MAXPLAYERS+1][4096];
- //í•´ë‹¹ì‚¬ëžŒì˜ ëž˜ê·¸ëŒ
- new Ragdoll[MAXPLAYERS+1];
- //ì´ì—”티티는 래그ëŒì¸ê°€
- new bool:IsRagdoll[2048];
- //ì´ì—”티티는 밧줄ì¸ê°€
- new bool:IsRope[2048];
- //ì´ ì‹œì²´ì˜ ì„¤ëª…
- new String:TargetDescription[2048][6][256];
- //ì„¤ëª…í• ìˆ˜ìžˆìœ¼ë©´ boolì€ true
- new bool:TargetDescription_bool[2048][6]
- //ë¼ìš´ë“œê°€ì‹œìž‘ë¬ëŠ”ê°€.
- new bool:roundstart;
- //ì§ì—…ì´ì„ íƒë¬ëŠ”ê°€.
- new bool:chosen;
- //ì§ì—…ì„ íƒë˜ê¸°ê¹Œì§€ì˜ì‹œê°„
- new GameCount;
- //ì¡°ì‚¬ëœ ì‹œì²´ì¸ê°€
- new bool:CheckedBody[2048];
- //DNA스캔 타ì´ë¨¸
- new Handle:DNAScanTimer[MAXPLAYERS+1] = INVALID_HANDLE;
- //T-Virusê°ì—¼ì—¬ë¶€í•¸ë“¤
- new Handle:TVirusTimer[MAXPLAYERS+1] = INVALID_HANDLE;
- //í¬ë ˆë”§ì˜ ì–‘
- new RemainCredit[2048];
- //DNAì •ë³´
- new String:DNAInformation[2048][256];
- //DNA샘플
- new String:DNASample[MAXPLAYERS+1][2][256];
- //DNA샘플창
- new String:Sample[MAXPLAYERS+1][5][2][256];
- //DNA스캔중
- new bool:DNAScanning[MAXPLAYERS+1];
- //스캔카운트
- new ScanCount[MAXPLAYERS+1];
- //DNA스캔카운트
- new DNAScanCount[MAXPLAYERS+1];
- //메뉴를 보여주는 횟수(0.1초당1번)
- new ShowMenuCount[MAXPLAYERS+1];
- //메뉴를 보여주는중ì¸ê°€
- new bool:IsShowMenu[MAXPLAYERS+1];
- //ë©”ë‰´ì˜ ë§ˆì§€ë§‰ì‚¬ëžŒ
- new MenuLastMan[MAXPLAYERS+1];
- //ì¹˜ë£Œí•˜ëŠ”ê²ƒì€ ë”œë ˆì´ê°€ 필요하다.
- new bool:HealDelay[MAXPLAYERS+1];
- new bool:HealSoundDelay[MAXPLAYERS+1];
- //모ë‘ì—게 ë³´ì´ëŠ” 기본시간.
- new Time1;
- //íŠ¸ë ˆì—게 ë³´ì´ëŠ” 추가시간.
- new Time2;
- //ê·¸ì‚¬ëžŒì´ ë³´ì´ëŠ”ê°€. 그사람 보는사람
- new bool:Visible[MAXPLAYERS+1][MAXPLAYERS+1];
- //재밌는 ëª…ë ¹ì–´
- new FunCommand[MAXPLAYERS+1];
- //T-Virus 좀비ë 때 채팅,ë³´ì´ìŠ¤ë§‰ê¸°
- new Float:LastFadeTime[MAXPLAYERS+1];
- new bool:IsInfect[MAXPLAYERS+1];
- //BGM Volume
- //new Volume[MAXPLAYERS+1];
- //Teleport Handle
- new Handle:Teleport[MAXPLAYERS+1] = INVALID_HANDLE;
- //Will Timer Handle
- new Handle:WillTimer[MAXPLAYERS+1] = INVALID_HANDLE;
- //func_useableladder fix
- new Float:lastZ[MAXPLAYERS+1];
- //Dia count
- new DiaCount;
- new MaxDiaCount;
- //Zombie AI
- new bool:IsAttack[2048];
- new Float:NextThink[2048];
- //Last Attacker
- new LastAttacker;
- //í¬ë ˆë”§ìƒµ~~~!@~!@~!@~@~!@1
- new bool:SpeedBoots[MAXPLAYERS+1];
- new bool:IronShoes[MAXPLAYERS+1];
- new bool:GoldenGun[2048];
- new bool:BuyGoldenGun[MAXPLAYERS+1];
- new bool:HealthStation[2048];
- new bool:IsHealthBox[2048];
- new HealthBox[2048];
- new bool:IsVIPHealthBox[2048];
- new bool:IsDetectorHealthBox[2048];
- new bool:IsFakeHealthBox[2048];
- new FakeHealthBoxOwner[2048];
- new bool:Jihad[2048];
- new bool:IsJihad[MAXPLAYERS+1];
- new JihadSpark[MAXPLAYERS+1];
- new bool:RPG[2048];
- new bool:BuyRPG[MAXPLAYERS+1];
- new RPGFOV[MAXPLAYERS+1];
- new bool:BuySG552[MAXPLAYERS+1];
- new bool:BuyDagger[MAXPLAYERS+1];
- new bool:Dagger[MAXPLAYERS+1];
- new bool:SuperCrowbar[MAXPLAYERS+1];
- new bool:Disguise[MAXPLAYERS+1];
- new bool:IsDisguise[MAXPLAYERS+1];
- new bool:DNASignalJammer[2048];
- new JammerEntity[MAXPLAYERS+1];
- new bool:Radar[MAXPLAYERS+1];
- new RadarCount[MAXPLAYERS+1];
- new bool:BuyTVirus[MAXPLAYERS+1];
- new bool:TVirus[2048];
- new bool:BuyTeleporter[MAXPLAYERS+1];
- new bool:Teleporter[2048];
- new bool:TeleporterDelay[MAXPLAYERS+1];
- new bool:TeleporterSavedPosition[MAXPLAYERS+1];
- new bool:TeleportSuccess[MAXPLAYERS+1];
- new TeleportCount[2048];
- new Float:TeleporterPosition[MAXPLAYERS+1][3];
- new Float:TeleporterAngle[MAXPLAYERS+1][3];
- new bool:Crossbow[2048];
- new bool:BuyCrossbow[MAXPLAYERS+1];
- new AttackDelay[MAXPLAYERS+1]; //0=Attacking, 1=able shoot, 2=reload
- new ReloadCount[MAXPLAYERS+1];
- new bool:BuyUMP[MAXPLAYERS+1];
- new bool:UMP[2048];
- new bool:Silenced_Sniper_Rifle[2048];
- new Handle:databasehandle = INVALID_HANDLE;
- #define SkinType 1
- #define VMSkinType 2
- #define MaxType 2
- new String:TypeName[MaxType+1][2][256] = {
- {"ì•„ì´í…œì¢…류", "ë°ì´í„°ë² ì´ìФì´ë¦„"},
- {"player skin", "skin"},
- {"crowbar skin", "vmskin"}
- };
- //Karma
- new Karma[MAXPLAYERS+1];
- #define Karma_Max 2000
- #define Karma_Effect 1800
- #define Karma_KillTraitor 200
- #define Karma_TeamKill 100
- //í¬ì¸íŠ¸ìƒµ~~~!@~!@~!@~@~!@1
- #define GetPoint_Duration 600
- #define GetPoint_Value 5
- new Float:PointDelay[MAXPLAYERS+1];
- new VIP[MAXPLAYERS+1];
- new VIP_Trails_RotatingEntity[MAXPLAYERS+1];
- new TagColor[MAXPLAYERS+1];
- new Point[MAXPLAYERS+1];
- new SellPoint[MAXPLAYERS+1];
- #define MAX_ITEMS 3+1
- new String:ItemName[MAX_ITEMS][256];
- new ItemType[MAX_ITEMS];
- new String:ItemPath[MAX_ITEMS][256];
- new ItemPrice[MAX_ITEMS];
- new ItemID[MAXPLAYERS+1][MaxType+1];
- new bool:ItemExist[MAXPLAYERS+1][MaxType+1];
- new bool:ItemOn[MAXPLAYERS+1][MaxType+1];
- new bool:IsVIPItem[MAX_ITEMS];
- new bool:IsRestrictItem[MAX_ITEMS];
- new bool:RestrictItem[MAXPLAYERS+1][MAX_ITEMS];
- new String:LastSteamID[MAXPLAYERS+1][256];
- //맵스타트 여부
- new bool:FirstRound;
- //í¬ë ˆë”§ ë°›ì•˜ëŠ”ì§€ì˜ ì—¬ë¶€
- new bool:ReceiveCredit;
- //ì§ì—…ì´ ê³¨ë¼ì§„후 ë“¤ì–´ì™”ëŠ”ì§€ì˜ ì—¬ë¶€
- new bool:ChosenJoin[MAXPLAYERS+1];
- //펀치뷰
- new offsPunchAngle;
- //ë ˆì´ë”
- new g_flFlashDuration;
- new g_flFlashMaxAlpha;
- //ì´ì†ë„
- new g_NextPrimaryAttack;
- new Process[MAXPLAYERS+1];
- //ammo
- new Ammo;
- new AmmoType;
- //노블ëŸ
- new CollOff;
- //ì¸ì§ˆì˜ 리ë”
- new gLeaderOffset;
- new CrowbarModel;
- new CrowbarModelW;
- new DaggerModel;
- new DaggerModelW;
- new GoldenGunModel;
- new GoldenGunModelW;
- new StunStickModel;
- new StunStickModelW;
- new IgnitionGunModel;
- new IgnitionGunModelW;
- new RPGModel;
- new RPGModelW;
- new TVirusModel;
- new TVirusModelW;
- new TeleporterModel;
- new TeleporterModelW;
- new CrossbowModel;
- new CrossbowModelW;
- new JihadModel;
- new JihadModelW;
- new HealthStationModel;
- new SilencedSniperRifleModel;
- new SilencedSniperRifleModelW;
- new bool:SpawnCheck[MAXPLAYERS+1];
- new ClientVM[MAXPLAYERS+1][2];
- new bool:IsCustom[MAXPLAYERS+1];
- #define EF_NODRAW 32
- new Wire[4096][4][3];
- new Bot;
- #define BotName "Welcome To TTT Server"
- new AliveJobCount[4];
- #define innocent 1
- #define detector 2
- #define traitor 3
- new String:JobName[4][256] = {
- "select",
- "Innocent",
- "detective",
- "traitor"
- };
- #define MAX_WEAPON 13
- new String:WeaponDelay[MAX_WEAPON][2][256] = {
- {"weapon_ak47", "0.15"},
- {"weapon_m4a1", "0.15"},
- {"weapon_m3", "1.0"},
- {"weapon_xm1014", "0.8"},
- {"weapon_mac10", "0.15"},
- {"weapon_tmp", "0.15"},
- {"weapon_m249", "0.1"},
- {"weapon_sg552", "0.16"},
- {"weapon_deagle", "0.6"},
- {"weapon_fiveseven", "0.22"},
- {"weapon_elite", "0.2"},
- {"weapon_usp", "0.25"},
- {"weapon_c4", "1.0"}
- };
- /*
- new SoundNumber;
- new SoundCount
- #define MAX_MUSIC 11
- new String:SoundData[MAX_MUSIC][2][256] = {
- {"Fuan.mp3", "114"},
- {"kuroi_light.mp3", "110"},
- {"puzzle_snd_fix.mp3", "152"},
- {"suspicion.mp3", "118"},
- {"Camp.mp3", "168"},
- {"07_The_Plot_Thickens2.mp3", "121"},
- {"fa2.mp3", "62"},
- {"HORROR2.mp3", "190"},
- {"L2.mp3", "180"},
- {"tension.mp3", "70"},
- {"supposition2.mp3", "105"}
- {"carol/tree.mp3", "185"},
- {"carol/csonline.mp3", "99"},
- {"carol/Feliz_Navidad.mp3", "131"},
- {"carol/Carol_of_the_Bells.mp3", "186"},
- {"carol/Fall_Out_Boy_Yule_Shoot_Your_Eye_Out.mp3", "224"},
- {"carol/talesweaver_carol_theme.mp3", "76"},
- {"carol/Train_01_Shake_Up_Christmas_192k.mp3", "234"}
- }
- */
- #define DEFAULT_VIP_POINT_HOUR 100
- #define Server_Master_SteamID "STEAM_0:1:37724744"
- #define Server_SubMaster_SteamID "STEAM_0:0:34728756"
- #define BJ_SteamID "STEAM_0:1:47746273"
- /*****Dev*****/
- new Float:StartPos[3];
- new Handle:Zone_Timer[MAXPLAYERS+1] = INVALID_HANDLE;
- /**************/
- /****************************ìžì„막대 ì¸í´ë£¨ë“œ****************************/
- #include"ttt_us/GravityGun"
- /****************************************************************************/
- #define PointEvent 1
- public OnPluginStart()
- {
- HookEvent("player_death", EventDeath, EventHookMode_Pre);
- HookEvent("player_spawn", EventSpawn);
- HookEvent("weapon_fire", EventFire);
- HookEvent("round_start", RoundStart);
- HookEvent("round_end", RoundEnd);
- HookEvent("player_changename", OnChangeName);
- HookEvent("player_hurt", EventHurt);
- HookEvent("bullet_impact", EventBullet);
- HookEvent("round_freeze_end", roundfreezeend_event);
- HookEvent("hostage_hurt", OnHostageBlocking, EventHookMode_Pre);
- HookEvent("hostage_follows", OnHostageBlocking, EventHookMode_Pre);
- HookEvent("hostage_stops_following", OnHostageBlocking, EventHookMode_Pre);
- HookEvent("hostage_killed", OnHostageBlocking, EventHookMode_Pre);
- RegConsoleCmd("say_team", SayHook);
- RegConsoleCmd("say", SayHook_RecognizeCommand);
- RegConsoleCmd("nightvision", NightVision);
- RegConsoleCmd("jointeam", JoinTeam);
- RegConsoleCmd("joinclass", JoinClass);
- RegConsoleCmd("sm_shop", Command_Shop);
- RegConsoleCmd("last_damage_report", LastDamageReport);
- RegConsoleCmd("last_attack_report", LastAttackReport);
- RegConsoleCmd("sm_ldr", LastDamageReport);
- RegConsoleCmd("sm_lar", LastAttackReport);
- RegConsoleCmd("kill", BlockSuicide);
- RegAdminCmd("sm_weaponmenu", Command_WeaponMenu, ADMFLAG_ROOT, "ë§µì— ë¬´ê¸°ë¥¼ ìƒì„±ì‹œí‚¤ëŠ” 메뉴");
- RegAdminCmd("sm_weaponlist", Command_WeaponList, ADMFLAG_ROOT, "ë§µì˜ ë¬´ê¸°ë¥¼ 구해주는 커맨드");
- RegAdminCmd("sm_weapondelete", Command_WeaponDelete, ADMFLAG_ROOT, "ë§µì˜ ë¬´ê¸°ë¥¼ ì—†ì• ì£¼ëŠ” 커맨드");
- RegAdminCmd("sm_createspawn", Command_CreateSpawn, ADMFLAG_ROOT, "ë§µì— ìŠ¤í°ì§€ì ì„ ìƒì„±ì‹œí‚¤ëŠ” 메뉴");
- RegAdminCmd("sm_spawnlist", Command_SpawnList, ADMFLAG_ROOT, "ë§µì˜ ìŠ¤í°ì§€ì ì„ êµ¬í•´ì£¼ëŠ” 커맨드");
- RegAdminCmd("sm_spawndelete", Command_SpawnDelete, ADMFLAG_ROOT, "ë§µì˜ ìŠ¤í°ì§€ì ì„ ì—†ì• ì£¼ëŠ” 커맨드");
- RegAdminCmd("sm_createladder", Command_CreateLadder, ADMFLAG_ROOT, "ë§µì— ì‚¬ë‹¤ë¦¬ë¥¼ ìƒì„±ì‹œí‚¤ëŠ” 메뉴");
- RegAdminCmd("sm_ladderlist", Command_LadderList, ADMFLAG_ROOT, "ë§µì˜ ì‚¬ë‹¤ë¦¬ë¥¼ 구해주는 커맨드");
- RegAdminCmd("sm_ladderdelete", Command_LadderDelete, ADMFLAG_ROOT, "ë§µì˜ ì‚¬ë‹¤ë¦¬ë¥¼ ì—†ì• ì£¼ëŠ” 커맨드");
- RegAdminCmd("sm_job", Command_Job, ADMFLAG_ROOT, "ì§ì—… ê°•ì œ ì„¤ì • 커맨드");
- RegAdminCmd("sm_spec", Command_Spectator, ADMFLAG_ROOT, "ê´€ì „ìœ¼ë¡œ 보내는 ëª…ë ¹ì–´");
- RegAdminCmd("sm_point", Command_Point, ADMFLAG_ROOT, "í¬ì¸íЏ 추가 커맨드");
- RegAdminCmd("sm_item", Command_Item, ADMFLAG_ROOT, "ì•„ì´í…œ 추가 커맨드");
- RegAdminCmd("sm_setplayingtime", Command_PlayingTime, ADMFLAG_ROOT, "í”Œë ˆì´ íƒ€ìž„ ì„¤ì • 커맨드");
- RegAdminCmd("sm_query", Command_Query, ADMFLAG_ROOT, "쿼리 커맨드");
- RegAdminCmd("sm_searchvip", Command_SearchVIP, ADMFLAG_ROOT, "쿼리 커맨드");
- RegAdminCmd("sm_findinventorytosteamid", Command_FindInventoryToSteamID, ADMFLAG_ROOT, "쿼리 커맨드");
- RegAdminCmd("sm_shoplog", Command_ShopLog, ADMFLAG_ROOT, "쿼리 커맨드");
- RegAdminCmd("sm_addvip", Command_VIP, ADMFLAG_ROOT, "VIP 추가 커맨드");
- RegAdminCmd("sm_credit", Command_Credit, ADMFLAG_ROOT, "í¬ë ˆë”§ 추가 커맨드");
- RegAdminCmd("sm_fun", Command_Fun, ADMFLAG_ROOT, "재밌는 커맨드");
- RegAdminCmd("sm_fun2", Command_Fun2, ADMFLAG_ROOT, "재밌는 커맨드");
- RegAdminCmd("sm_fun3", Command_Fun3, ADMFLAG_ROOT, "재밌는 커맨드");
- RegAdminCmd("sm_fun4", Command_Fun4, ADMFLAG_ROOT, "재밌는 커맨드");
- RegAdminCmd("sm_disguise", Command_Disguise, ADMFLAG_ROOT, "재밌는 커맨드");
- RegAdminCmd("sm_armor", Command_Armor, ADMFLAG_ROOT, "재밌는 커맨드");
- RegAdminCmd("sm_tvirus", Command_TVirus, ADMFLAG_ROOT, "재밌는 커맨드");
- RegAdminCmd("sm_receive_cheat", Command_Receive_Cheat, ADMFLAG_ROOT, "재밌는 커맨드");
- RegAdminCmd("sm_dia", Command_Diamond, ADMFLAG_ROOT, "특별한 커맨드");
- HookUserMessage(GetUserMessageId("TextMsg"), TextMsg, true);
- HookUserMessage(GetUserMessageId("SayText2"), SayText2, true);
- HookUserMessage(GetUserMessageId("RadioText"), hookRadioText, true);
- offsPunchAngle = FindSendPropInfo("CBasePlayer", "m_vecPunchAngle");
- g_flFlashDuration = FindSendPropOffs("CCSPlayer", "m_flFlashDuration");
- g_flFlashMaxAlpha = FindSendPropOffs("CCSPlayer", "m_flFlashMaxAlpha");
- g_NextPrimaryAttack = FindSendPropOffs("CBaseCombatWeapon","m_flNextPrimaryAttack");
- CollOff = FindSendPropOffs("CBaseEntity", "m_CollisionGroup");
- Ammo = FindSendPropOffs("CCSPlayer", "m_iAmmo");
- AmmoType = FindSendPropOffs("CBaseCombatWeapon", "m_iPrimaryAmmoType");
- gLeaderOffset = FindSendPropOffs("CHostage", "m_leader");
- ServerCommand("mp_friendlyfire 1");
- ServerCommand("mp_ignore_round_win_conditions 1");
- ServerCommand("sv_hudhint_sound 0");
- ServerCommand("ammo_338mag_max 1");
- AddTempEntHook("Shotgun Shot", TE_Hook_ShotgunShot);
- AddNormalSoundHook(SoundCallBackHook);
- AddCommandListener(autobuy, "autobuy");
- AddCommandListener(rebuy, "rebuy");
- AddCommandListener(cheer, "cheer");
- AddCommandListener(commandmenu, "commandmenu");
- LoadTranslations("ttt.phrases");
- BuildPath(Path_SM, Path, 256, "data/map_weapon_list.txt");
- BuildPath(Path_SM, Path2, 256, "data/map_spawn_list.txt");
- BuildPath(Path_SM, Path3, 256, "data/map_ladder_list.txt");
- for(new client = 1; client <= MaxClients; client++)
- {
- if(IsClientInGame(client))
- {
- SDKHook(client, SDKHook_PostThinkPost, OnPostThinkPost);
- //find both of the clients viewmodels
- ClientVM[client][0] = GetEntPropEnt(client, Prop_Send, "m_hViewModel");
- new PVM = -1;
- while ((PVM = FindEntityByClassname(PVM, "predicted_viewmodel")) != -1)
- {
- if (GetEntPropEnt(PVM, Prop_Send, "m_hOwner") == client)
- {
- if (GetEntProp(PVM, Prop_Send, "m_nViewModelIndex") == 1)
- {
- ClientVM[client][1] = PVM;
- break;
- }
- }
- }
- }
- }
- CreateItem(1, "Predator", 1, "models/player/techknow/predator_v2/predator.mdl", 2000, false);
- CreateItem(2, "ichigo", 1, "models/player/hhp227/mitch/ichigo_bankai_fixed.mdl", 2000, false);
- CreateItem(3, "sepiroth", 1, "models/mapeadores/kaem/sephiroth3/sephiroth.mdl", 2000, true);
- GravityGunPluginStart();
- }
- stock CreateItem(ItemNumber, String:Item_Name[256], Item_Type, String:Paths[256], price, bool:onlyVIP, bool:Restrict=false)
- {
- ItemName[ItemNumber] = Item_Name;
- ItemType[ItemNumber] = Item_Type;
- ItemPath[ItemNumber] = Paths;
- ItemPrice[ItemNumber] = price;
- IsVIPItem[ItemNumber] = onlyVIP;
- IsRestrictItem[ItemNumber] = Restrict;
- }
- public Action:LastDamageReport(Client, args)
- {
- if(!IsPlayerAlive(Client))
- {
- new String:Formatting[4096], count, bool:check;
- Formatting = HitLog[Client];
- while(StrContains(Formatting, "�") != -1)
- {
- ReplaceStringEx(Formatting, 4096, "�", "");
- count++;
- check = true;
- }
- if(check)
- {
- Formatting = HitLog[Client];
- new String:Formatting2[count+1][64];
- ExplodeString(Formatting, "�", Formatting2, count+1, 64);
- new Handle:menuhandle = CreateMenu(NULL_CallBack);
- SetMenuTitle(menuhandle, "-----ë°ë¯¸ì§€ë¡œê·¸-----");
- for(new i=1; i<=count; i++)
- {
- AddMenuItem(menuhandle, "", Formatting2[i], ITEMDRAW_DISABLED);
- }
- SetMenuExitButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, 10);
- }
- }
- else
- {
- new String:Formatting3[4096], count2, bool:check2;
- Formatting3 = LastHitLog[Client];
- while(StrContains(Formatting3, "�") != -1)
- {
- ReplaceStringEx(Formatting3, 4096, "�", "");
- count2++;
- check2 = true;
- }
- if(check2)
- {
- Formatting3 = LastHitLog[Client];
- new String:Formatting4[count2+1][64];
- ExplodeString(Formatting3, "�", Formatting4, count2+1, 64);
- new Handle:menuhandle = CreateMenu(NULL_CallBack);
- SetMenuTitle(menuhandle, "-----ë°ë¯¸ì§€ë¡œê·¸-----");
- for(new i=1; i<=count2; i++)
- {
- AddMenuItem(menuhandle, "", Formatting4[i], ITEMDRAW_DISABLED);
- }
- SetMenuExitButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, 10);
- }
- }
- return Plugin_Handled;
- }
- public Action:LastAttackReport(Client, args)
- {
- if(!IsPlayerAlive(Client))
- {
- new String:Formatting[4096], count, bool:check;
- Formatting = AttackLog[Client];
- while(StrContains(Formatting, "�") != -1)
- {
- ReplaceStringEx(Formatting, 4096, "�", "");
- count++;
- check = true;
- }
- if(check)
- {
- Formatting = AttackLog[Client];
- new String:Formatting2[count+1][64];
- ExplodeString(Formatting, "�", Formatting2, count+1, 64);
- new Handle:menuhandle = CreateMenu(NULL_CallBack);
- SetMenuTitle(menuhandle, "-----ë°ë¯¸ì§€ë¡œê·¸-----");
- for(new i=1; i<=count; i++)
- {
- AddMenuItem(menuhandle, "", Formatting2[i], ITEMDRAW_DISABLED);
- }
- SetMenuExitButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, 10);
- }
- }
- else
- {
- new String:Formatting3[4096], count2, bool:check2;
- Formatting3 = LastAttackLog[Client];
- while(StrContains(Formatting3, "�") != -1)
- {
- ReplaceStringEx(Formatting3, 4096, "�", "");
- count2++;
- check2 = true;
- }
- if(check2)
- {
- Formatting3 = LastAttackLog[Client];
- new String:Formatting4[count2+1][64];
- ExplodeString(Formatting3, "�", Formatting4, count2+1, 64);
- new Handle:menuhandle = CreateMenu(NULL_CallBack);
- SetMenuTitle(menuhandle, "-----ë°ë¯¸ì§€ë¡œê·¸-----");
- for(new i=1; i<=count2; i++)
- {
- AddMenuItem(menuhandle, "", Formatting4[i], ITEMDRAW_DISABLED);
- }
- SetMenuExitButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, 10);
- }
- }
- return Plugin_Handled;
- }
- public Action:BlockSuicide(Client, args)
- {
- if(TVirusTimer[Client] != INVALID_HANDLE)
- {
- return Plugin_Handled;
- }
- return Plugin_Continue;
- }
- public Action:Command_Shop(Client, args)
- {
- MainShop(Client);
- return Plugin_Handled;
- }
- public Action:Command_Point(Client, Args)
- {
- new String:AuthString[256];
- GetClientAuthString(Client, AuthString, 256);
- if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
- {
- PrintChat(Client, "Block");
- return Plugin_Handled;
- }
- new String:Player_Name[32], Target = -1, String:SMoney[256], count;
- GetCmdArg(1, Player_Name, sizeof(Player_Name));
- GetCmdArg(2, SMoney, 256);
- for(new i=1; i <= MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- new String:Other[32];
- GetClientName(i, Other, sizeof(Other));
- if(StrContains(Other, Player_Name, false) != -1)
- {
- Target = i;
- count++;
- }
- }
- }
- if(Target == -1)
- {
- PrintChat(Client, "%së‹˜ì„ ì°¾ì„수 없습니다.", Player_Name);
- return Plugin_Handled;
- }
- if(count > 1)
- {
- PrintChat(Client, "%së¼ëŠ” ì´ë¦„ì„ ì†Œìœ í•œ ì‚¬ëžŒì´ %i명입니다.", Player_Name, count);
- return Plugin_Handled;
- }
- Point[Target] += StringToInt(SMoney);
- SavePoint(Target);
- PrintChat(Client, "\x05%N님ì—게 %ií¬ì¸íŠ¸ë¥¼ 주었습니다.", Target, StringToInt(SMoney));
- PrintChat(Target, "\x05ë‹¹ì‹ ì€ ì–´ë“œë¯¼ì—게 %ií¬ì¸íŠ¸ë¥¼ 받았습니다.", StringToInt(SMoney));
- return Plugin_Handled;
- }
- public Action:Command_Item(Client, Args)
- {
- new String:AuthString[256];
- GetClientAuthString(Client, AuthString, 256);
- if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
- {
- PrintChat(Client, "Block");
- return Plugin_Handled;
- }
- new String:Player_Name[32], Target = -1, String:SNumber[256], count;
- GetCmdArg(1, Player_Name, sizeof(Player_Name));
- GetCmdArg(2, SNumber, 256);
- for(new i=1; i <= MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- new String:Other[32];
- GetClientName(i, Other, sizeof(Other));
- if(StrContains(Other, Player_Name, false) != -1)
- {
- Target = i;
- count++;
- }
- }
- }
- if(Target == -1)
- {
- PrintChat(Client, "%së‹˜ì„ ì°¾ì„수 없습니다.", Player_Name);
- return Plugin_Handled;
- }
- if(count > 1)
- {
- PrintChat(Client, "%së¼ëŠ” ì´ë¦„ì„ ì†Œìœ í•œ ì‚¬ëžŒì´ %i명입니다.", Player_Name, count);
- return Plugin_Handled;
- }
- new String:TargetSteamID[256], String:query[512];
- GetClientAuthString(Target, TargetSteamID, 256);
- Format(query, 512, "INSERT INTO inventory(steamid, idx, type) values ('%s', '%d', '%d');", TargetSteamID, StringToInt(SNumber), ItemType[StringToInt(SNumber)]);
- SQL_TQuery(databasehandle, save_info, query);
- PrintChat(Client, "\x05%N님ì—게 %s를 주었습니다.", Target, ItemName[StringToInt(SNumber)]);
- PrintChat(Target, "\x05ë‹¹ì‹ ì€ ì–´ë“œë¯¼ì—게 %s를 받았습니다.", ItemName[StringToInt(SNumber)]);
- return Plugin_Handled;
- }
- public Action:Command_PlayingTime(Client, Args)
- {
- new String:AuthString[256];
- GetClientAuthString(Client, AuthString, 256);
- if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
- {
- PrintChat(Client, "Block");
- return Plugin_Handled;
- }
- new String:Player_Name[32], Target = -1, String:SMoney[256], count;
- GetCmdArg(1, Player_Name, sizeof(Player_Name));
- GetCmdArg(2, SMoney, 256);
- for(new i=1; i <= MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- new String:Other[32];
- GetClientName(i, Other, sizeof(Other));
- if(StrContains(Other, Player_Name, false) != -1)
- {
- Target = i;
- count++;
- }
- }
- }
- if(Target == -1)
- {
- PrintChat(Client, "%së‹˜ì„ ì°¾ì„수 없습니다.", Player_Name);
- return Plugin_Handled;
- }
- if(count > 1)
- {
- PrintChat(Client, "%së¼ëŠ” ì´ë¦„ì„ ì†Œìœ í•œ ì‚¬ëžŒì´ %i명입니다.", Player_Name, count);
- return Plugin_Handled;
- }
- PlayingTime[Target] = StringToFloat(SMoney);
- return Plugin_Handled;
- }
- public Action:Command_Query(Client, Args)
- {
- new String:AuthString[256];
- GetClientAuthString(Client, AuthString, 256);
- if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
- {
- PrintChat(Client, "Block");
- return Plugin_Handled;
- }
- new String:query[256];
- GetCmdArg(1, query, 256);
- SQL_TQuery(databasehandle, check_query, query, Client);
- return Plugin_Handled;
- }
- public Action:Command_SearchVIP(Client, Args)
- {
- new String:AuthString[256];
- GetClientAuthString(Client, AuthString, 256);
- if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
- {
- PrintChat(Client, "Block");
- return Plugin_Handled;
- }
- SQL_TQuery(databasehandle, searchvip, "SELECT * FROM info WHERE vip = '1';", Client);
- return Plugin_Handled;
- }
- public searchvip(Handle:owner, Handle:handle, const String:error[], any:Client)
- {
- new String:SteamID[256], String:Nick[256];
- if(handle == INVALID_HANDLE)
- {
- LogError("infocheck ERROR: %s", error);
- }
- else if(SQL_GetRowCount(handle))
- {
- new counted = SQL_GetRowCount(handle);
- if(counted > 0)
- {
- if(SQL_HasResultSet(handle))
- {
- while(SQL_FetchRow(handle))
- {
- SQL_FetchString(handle, 1, SteamID, 256);
- SQL_FetchString(handle, 2, Nick, 256);
- PrintChat(Client, "%s %s", SteamID, Nick);
- }
- }
- }
- }
- }
- public Action:Command_FindInventoryToSteamID(Client, Args)
- {
- new String:AuthString[256];
- GetClientAuthString(Client, AuthString, 256);
- if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
- {
- PrintChat(Client, "Block");
- return Plugin_Handled;
- }
- new String:query[512], String:SteamID[256];
- GetCmdArg(1, SteamID, 256);
- Format(query, 512, "SELECT * FROM inventory WHERE steamid = '%s';", SteamID);
- SQL_TQuery(databasehandle, findinventory, query, Client);
- return Plugin_Handled;
- }
- public Action:Command_ShopLog(Client, Args)
- {
- new String:AuthString[256];
- GetClientAuthString(Client, AuthString, 256);
- if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
- {
- PrintChat(Client, "Block");
- return Plugin_Handled;
- }
- GetCmdArg(1, LastSteamID[Client], 256);
- ShopLog_Year(Client, true);
- return Plugin_Handled;
- }
- public findinventory(Handle:owner, Handle:hndl, const String:error[], any:Client)
- {
- if(hndl == INVALID_HANDLE)
- {
- PrintChat(Client, "\x03아무런 ì•„ì´í…œì„ ê°€ì§€ê³ ìžˆì§€ 않으ì‹ë‹ˆë‹¤.");
- return;
- }
- new count[MAX_ITEMS];
- new counted = SQL_GetRowCount(hndl);
- if(counted > 0)
- {
- if(SQL_HasResultSet(hndl))
- {
- while(SQL_FetchRow(hndl))
- {
- count[SQL_FetchInt(hndl, 2)] += 1;
- }
- }
- }
- for(new i; i < MAX_ITEMS; i++)
- {
- if(count[i] > 0)
- {
- PrintChat(Client, "%s(%i) - %i", ItemName[i], i, count[i]);
- }
- }
- }
- public Action:Command_VIP(Client, Args)
- {
- if(Client)
- {
- new String:AuthString[256];
- GetClientAuthString(Client, AuthString, 256);
- if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
- {
- PrintChat(Client, "Block");
- return Plugin_Handled;
- }
- }
- new String:Player_Name[32], Target = -1, count, String:BuyHour[16];
- GetCmdArg(1, Player_Name, sizeof(Player_Name));
- GetCmdArg(2, BuyHour, sizeof(BuyHour));
- for(new i=1; i <= MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- new String:Other[32];
- GetClientName(i, Other, sizeof(Other));
- if(StrContains(Other, Player_Name, false) != -1)
- {
- Target = i;
- count++;
- }
- }
- }
- if(Target == -1)
- {
- PrintChat(Client, "%së‹˜ì„ ì°¾ì„수 없습니다.", Player_Name);
- return Plugin_Handled;
- }
- if(count > 1)
- {
- PrintChat(Client, "%së¼ëŠ” ì´ë¦„ì„ ì†Œìœ í•œ ì‚¬ëžŒì´ %i명입니다.", Player_Name, count);
- return Plugin_Handled;
- }
- new String:sName[32], String:SteamID[256], String:query[512];
- GetClientName(Target, sName, 32);
- GetClientAuthString(Target, SteamID, 256);
- if(!VIP[Target])
- {
- Format(query, 512, "UPDATE info SET vip = '1' WHERE steamid = '%s';", SteamID);
- SQL_TQuery(databasehandle, save_info, query, Target);
- VIP[Target] = 1;
- 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;
- FormatTime(Time_Year, 30, "%Y", GetTime());
- FormatTime(Time_Month, 30, "%m", GetTime());
- FormatTime(Time_Day, 30, "%d", GetTime());
- FormatTime(Time_Hour, 30, "%H", GetTime());
- FormatTime(Time_Minute, 30, "%M", GetTime());
- CalculateHour(StringToInt(Time_Year), StringToInt(Time_Month), StringToInt(Time_Day), StringToInt(Time_Hour), StringToInt(BuyHour), year, month, day, hour);
- VIP[Target] = 1;
- 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));
- SQL_TQuery(databasehandle, save_info, query, Target);
- Format(query, 512, "SELECT * FROM viptag WHERE steamid = '%s';", SteamID);
- SQL_TQuery(databasehandle, viptag_check, query, Target);
- 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));
- ReplyToCommand(Client, "%s님ì—게 VIP를 줬습니다.", sName);
- new String:steamid[256];
- GetClientAuthString(Target, steamid, 256);
- Format(query, 512, "SELECT * FROM viptag WHERE steamid = '%s';", steamid);
- SQL_TQuery(databasehandle, viptag_check, query, Target);
- }
- else
- {
- Format(query, 512, "UPDATE info SET vip = '0' WHERE steamid = '%s';", SteamID);
- SQL_TQuery(databasehandle, save_info, query, Target);
- Format(query, 512, "DELETE FROM vip WHERE steamid = '%s';", SteamID);
- SQL_TQuery(databasehandle, save_info, query, Target);
- if(VIP[Target]) VIP[Target] = 0;
- ReplyToCommand(Client, "%së‹˜ì˜ VIP를 ëºì—ˆìŠµë‹ˆë‹¤.", sName);
- PrintChat(Target, "Your VIP took away.");
- Format(query, 512, "SELECT * FROM vip WHERE steamid = '%s';", SteamID);
- SQL_TQuery(databasehandle, vip_check, query, Target);
- }
- return Plugin_Handled;
- }
- public Action:Command_Credit(Client, Args)
- {
- new String:AuthString[256];
- GetClientAuthString(Client, AuthString, 256);
- if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
- {
- PrintChat(Client, "Block");
- return Plugin_Handled;
- }
- new String:Player_Name[32], Target = -1, count, String:Amount[256];
- GetCmdArg(1, Player_Name, 32);
- GetCmdArg(2, Amount, 256);
- for(new i=1; i <= MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- new String:Other[32];
- GetClientName(i, Other, sizeof(Other));
- if(StrContains(Other, Player_Name, false) != -1)
- {
- Target = i;
- count++;
- }
- }
- }
- if(Target == -1)
- {
- PrintChat(Client, "%së‹˜ì„ ì°¾ì„수 없습니다.", Player_Name);
- return Plugin_Handled;
- }
- if(count > 1)
- {
- PrintChat(Client, "%së¼ëŠ” ì´ë¦„ì„ ì†Œìœ í•œ ì‚¬ëžŒì´ %i명입니다.", Player_Name, count);
- return Plugin_Handled;
- }
- Credit[Target] += StringToInt(Amount);
- PrintChat(Client, "\x03%N님ì—게 %së§Œí¼ì˜ í¬ë ˆë”§ì„ 주었습니다.", Target, Amount);
- return Plugin_Handled;
- }
- public Action:Command_Fun(Client, Args)
- {
- new String:AuthString[256];
- GetClientAuthString(Client, AuthString, 256);
- if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
- {
- PrintChat(Client, "Block");
- return Plugin_Handled;
- }
- new String:Player_Name[32], Target = -1, count, String:Amount[256];
- GetCmdArg(1, Player_Name, 32);
- GetCmdArg(2, Amount, 256);
- for(new i=1; i <= MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- new String:Other[32];
- GetClientName(i, Other, sizeof(Other));
- if(StrContains(Other, Player_Name, false) != -1)
- {
- Target = i;
- count++;
- }
- }
- }
- if(Target == -1)
- {
- PrintChat(Client, "%së‹˜ì„ ì°¾ì„수 없습니다.", Player_Name);
- return Plugin_Handled;
- }
- if(count > 1)
- {
- PrintChat(Client, "%së¼ëŠ” ì´ë¦„ì„ ì†Œìœ í•œ ì‚¬ëžŒì´ %i명입니다.", Player_Name, count);
- return Plugin_Handled;
- }
- Fun[Target] = !Fun[Target];
- return Plugin_Handled;
- }
- public Action:Command_Fun2(Client, Args)
- {
- new String:AuthString[256];
- GetClientAuthString(Client, AuthString, 256);
- if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
- {
- PrintChat(Client, "Block");
- return Plugin_Handled;
- }
- new String:Player_Name[32], Target = -1, count, String:Amount[256];
- GetCmdArg(1, Player_Name, 32);
- GetCmdArg(2, Amount, 256);
- for(new i=1; i <= MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- new String:Other[32];
- GetClientName(i, Other, sizeof(Other));
- if(StrContains(Other, Player_Name, false) != -1)
- {
- Target = i;
- count++;
- }
- }
- }
- if(Target == -1)
- {
- PrintChat(Client, "%së‹˜ì„ ì°¾ì„수 없습니다.", Player_Name);
- return Plugin_Handled;
- }
- if(count > 1)
- {
- PrintChat(Client, "%së¼ëŠ” ì´ë¦„ì„ ì†Œìœ í•œ ì‚¬ëžŒì´ %i명입니다.", Player_Name, count);
- return Plugin_Handled;
- }
- Fun2[Target] = !Fun2[Target];
- 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");
- else if(!Fun2[Target]) ClientCommand(Target, "r_screenoverlay \"\"");
- return Plugin_Handled;
- }
- public Action:Command_Fun3(Client, Args)
- {
- new String:AuthString[256];
- GetClientAuthString(Client, AuthString, 256);
- if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
- {
- PrintChat(Client, "Block");
- return Plugin_Handled;
- }
- new String:Player_Name[32], Target = -1, count, String:Amount[256];
- GetCmdArg(1, Player_Name, 32);
- GetCmdArg(2, Amount, 256);
- for(new i=1; i <= MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- new String:Other[32];
- GetClientName(i, Other, sizeof(Other));
- if(StrContains(Other, Player_Name, false) != -1)
- {
- Target = i;
- count++;
- }
- }
- }
- if(Target == -1)
- {
- PrintChat(Client, "%së‹˜ì„ ì°¾ì„수 없습니다.", Player_Name);
- return Plugin_Handled;
- }
- if(count > 1)
- {
- PrintChat(Client, "%së¼ëŠ” ì´ë¦„ì„ ì†Œìœ í•œ ì‚¬ëžŒì´ %i명입니다.", Player_Name, count);
- return Plugin_Handled;
- }
- EmitSoundToClient(Target, "tttmusic/fun3_fix.mp3");
- return Plugin_Handled;
- }
- public Action:Command_Fun4(Client, Args)
- {
- new String:AuthString[256];
- GetClientAuthString(Client, AuthString, 256);
- if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
- {
- PrintChat(Client, "Block");
- return Plugin_Handled;
- }
- new String:Player_Name[32], Target = -1, count, String:Amount[256];
- GetCmdArg(1, Player_Name, 32);
- GetCmdArg(2, Amount, 256);
- for(new i=1; i <= MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- new String:Other[32];
- GetClientName(i, Other, sizeof(Other));
- if(StrContains(Other, Player_Name, false) != -1)
- {
- Target = i;
- count++;
- }
- }
- }
- if(Target == -1)
- {
- PrintChat(Client, "%së‹˜ì„ ì°¾ì„수 없습니다.", Player_Name);
- return Plugin_Handled;
- }
- if(count > 1)
- {
- PrintChat(Client, "%së¼ëŠ” ì´ë¦„ì„ ì†Œìœ í•œ ì‚¬ëžŒì´ %i명입니다.", Player_Name, count);
- return Plugin_Handled;
- }
- Fun2[Target] = !Fun2[Target];
- 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");
- else if(!Fun2[Target]) ClientCommand(Target, "r_screenoverlay \"\"");
- if(Fun2[Target]) EmitSoundToClient(Target, "tttmusic/fun3_fix.mp3");
- else StopSound(Target, SNDCHAN_AUTO, "tttmusic/fun3_fix.mp3");
- return Plugin_Handled;
- }
- public Action:Command_Disguise(Client, Args)
- {
- new String:AuthString[256];
- GetClientAuthString(Client, AuthString, 256);
- if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
- {
- PrintChat(Client, "Block");
- return Plugin_Handled;
- }
- new String:Player_Name[32], Target = -1, count, String:Amount[256];
- GetCmdArg(1, Player_Name, 32);
- GetCmdArg(2, Amount, 256);
- for(new i=1; i <= MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- new String:Other[32];
- GetClientName(i, Other, sizeof(Other));
- if(StrContains(Other, Player_Name, false) != -1)
- {
- Target = i;
- count++;
- }
- }
- }
- if(Target == -1)
- {
- PrintChat(Client, "%së‹˜ì„ ì°¾ì„수 없습니다.", Player_Name);
- return Plugin_Handled;
- }
- if(count > 1)
- {
- PrintChat(Client, "%së¼ëŠ” ì´ë¦„ì„ ì†Œìœ í•œ ì‚¬ëžŒì´ %i명입니다.", Player_Name, count);
- return Plugin_Handled;
- }
- IsDisguise[Target] = !IsDisguise[Target];
- return Plugin_Handled;
- }
- public Action:Command_Armor(Client, Args)
- {
- new String:AuthString[256];
- GetClientAuthString(Client, AuthString, 256);
- if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
- {
- PrintChat(Client, "Block");
- return Plugin_Handled;
- }
- new String:Player_Name[32], Target = -1, count, String:Amount[256];
- GetCmdArg(1, Player_Name, 32);
- GetCmdArg(2, Amount, 256);
- for(new i=1; i <= MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- new String:Other[32];
- GetClientName(i, Other, sizeof(Other));
- if(StrContains(Other, Player_Name, false) != -1)
- {
- Target = i;
- count++;
- }
- }
- }
- if(Target == -1)
- {
- PrintChat(Client, "%së‹˜ì„ ì°¾ì„수 없습니다.", Player_Name);
- return Plugin_Handled;
- }
- if(count > 1)
- {
- PrintChat(Client, "%së¼ëŠ” ì´ë¦„ì„ ì†Œìœ í•œ ì‚¬ëžŒì´ %i명입니다.", Player_Name, count);
- return Plugin_Handled;
- }
- SetEntProp(Target, Prop_Data, "m_ArmorValue", 9999);
- return Plugin_Handled;
- }
- public Action:Command_TVirus(Client, Args)
- {
- new String:AuthString[256];
- GetClientAuthString(Client, AuthString, 256);
- if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
- {
- PrintChat(Client, "Block");
- return Plugin_Handled;
- }
- new String:Player_Name[32], Target = -1, count, String:Amount[256];
- GetCmdArg(1, Player_Name, 32);
- GetCmdArg(2, Amount, 256);
- for(new i=1; i <= MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- new String:Other[32];
- GetClientName(i, Other, sizeof(Other));
- if(StrContains(Other, Player_Name, false) != -1)
- {
- Target = i;
- count++;
- }
- }
- }
- if(Target == -1)
- {
- PrintChat(Client, "%së‹˜ì„ ì°¾ì„수 없습니다.", Player_Name);
- return Plugin_Handled;
- }
- if(count > 1)
- {
- PrintChat(Client, "%së¼ëŠ” ì´ë¦„ì„ ì†Œìœ í•œ ì‚¬ëžŒì´ %i명입니다.", Player_Name, count);
- return Plugin_Handled;
- }
- if(TVirusTimer[Target] == INVALID_HANDLE)
- {
- CreateTimer(20.0, GreenFade, Target);
- new Handle:pack = CreateDataPack();
- WritePackCell(pack, Target);
- WritePackCell(pack, Client);
- TVirusTimer[Target] = CreateTimer(25.0, YouAreZombie, pack, TIMER_DATA_HNDL_CLOSE);
- }
- return Plugin_Handled;
- }
- public Action:Command_Receive_Cheat(Client, Args)
- {
- new String:AuthString[256];
- GetClientAuthString(Client, AuthString, 256);
- if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
- {
- PrintChat(Client, "Block");
- return Plugin_Handled;
- }
- SendConVarValue(Client, FindConVar("sv_cheats"), "1");
- return Plugin_Handled;
- }
- public Action:Command_Diamond(Client, args)
- {
- new String:AuthString[256], String:CurrentMap[128];
- GetClientAuthString(Client, AuthString, 256);
- GetCurrentMap(CurrentMap, 128);
- if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
- {
- PrintChat(Client, "Block");
- return Plugin_Handled;
- }
- decl Float:pos[3], Float:angle[3];
- GetClientEyePosition(Client, pos);
- GetClientEyeAngles(Client, angle);
- new Handle:traceresulthandle = INVALID_HANDLE;
- 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"));
- else traceresulthandle = TR_TraceRayFilterEx(pos, angle, MASK_SOLID, RayType_Infinite, tracerayfilterdefault, Client);
- new Float:resultposition[3], count;
- if(TR_DidHit(traceresulthandle) == true)
- {
- TR_GetEndPosition(resultposition, traceresulthandle);
- for(new i; i < GetMaxEntities(); i++)
- {
- if(IsValidEdict(i))
- {
- if(IsValidEntity(i))
- {
- new String:iName[256], String:ClassName[32];
- GetEntPropString(i, Prop_Data, "m_iName", iName, 256);
- GetEdictClassname(i, ClassName, 32);
- if(StrEqual(CurrentMap, "ttt_mine_craft_b4"))
- {
- if(!StrContains(iName, "DiaOre_"))
- {
- count++;
- PrintChatAll("%i.%s", count, iName);
- TeleportEntity(i, resultposition, NULL_VECTOR, NULL_VECTOR);
- }
- }
- /*
- else
- {
- if(!StrContains(ClassName, "prop") && count < 30)
- {
- count++;
- TeleportEntity(i, resultposition, NULL_VECTOR, NULL_VECTOR);
- }
- }
- */
- }
- }
- }
- }
- CloseHandle(traceresulthandle);
- return Plugin_Handled;
- }
- public Action:Command_WeaponMenu(Client, args)
- {
- WeaponMenu(Client);
- return Plugin_Handled;
- }
- public Action:Command_WeaponList(Client, args)
- {
- new String:CurrentMap[256], String:weaponname[256], String:buffer[256], Float:spawnposition[3];
- GetCurrentMap(CurrentMap, 256);
- new Handle:kv = CreateKeyValues("TTTWeapons");
- FileToKeyValues(kv, Path);
- KvGotoFirstSubKey(kv);
- do
- {
- KvGetSectionName(kv, buffer, sizeof(buffer));
- if(StrEqual(buffer, CurrentMap, false))
- {
- KvJumpToKey(kv, CurrentMap, false);
- KvGotoFirstSubKey(kv);
- do
- {
- KvGetSectionName(kv, buffer, sizeof(buffer));
- KvGetString(kv, "weapon2", weaponname, 256, "NULL");
- KvGetVector(kv, "weapon", spawnposition);
- if(!StrEqual(weaponname, "NULL", false))
- {
- ReplaceStringEx(buffer, 256, CurrentMap, "");
- PrintChat(Client, "\x05%s. %s : %.1f %.1f %.1f", buffer, weaponname, spawnposition[0], spawnposition[1], spawnposition[2]);
- }
- }while(KvGotoNextKey(kv));
- break;
- }
- }while(KvGotoNextKey(kv));
- KvRewind(kv);
- CloseHandle(kv);
- }
- public Action:Command_WeaponDelete(Client, args)
- {
- new String:CurrentMap[256], String:buffer[256], String:WeaponNumber[256], String:Formatting[256];
- GetCurrentMap(CurrentMap, 256);
- GetCmdArg(1, WeaponNumber, sizeof(WeaponNumber));
- new Handle:kv = CreateKeyValues("TTTWeapons");
- FileToKeyValues(kv, Path);
- KvGotoFirstSubKey(kv);
- do
- {
- KvGetSectionName(kv, buffer, sizeof(buffer));
- if(StrEqual(buffer, CurrentMap, false))
- {
- KvJumpToKey(kv, CurrentMap, false);
- KvGotoFirstSubKey(kv);
- do
- {
- KvGetSectionName(kv, buffer, sizeof(buffer));
- if(StrEqual(buffer, WeaponNumber, false))
- {
- KvJumpToKey(kv, buffer, false);
- KvDeleteKey(kv, "weapon");
- KvDeleteKey(kv, "weapon2");
- KvRewind(kv);
- KvDeleteKey(kv, Formatting);
- break;
- }
- }while(KvGotoNextKey(kv));
- break;
- }
- }while(KvGotoNextKey(kv));
- KvRewind(kv);
- KeyValuesToFile(kv, Path);
- CloseHandle(kv);
- }
- public Action:Command_Job(Client, Arguments)
- {
- new String:Player_Name[32], String:JobNumber[32], Target = -1;
- GetCmdArg(1, Player_Name, sizeof(Player_Name));
- GetCmdArg(2, JobNumber, sizeof(JobNumber));
- for(new i=1; i <= MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- new String:Other[32];
- GetClientName(i, Other, sizeof(Other));
- if(StrContains(Other, Player_Name, false) != -1)
- {
- Target = i;
- }
- }
- }
- if(Target == -1)
- {
- return Plugin_Handled;
- }
- Job[Target] = StringToInt(JobNumber);
- return Plugin_Handled;
- }
- public Action:Command_Spectator(Client, Arguments)
- {
- new String:Player_Name[32], String:JobNumber[32], Target = -1, count;
- GetCmdArg(1, Player_Name, sizeof(Player_Name));
- GetCmdArg(2, JobNumber, sizeof(JobNumber));
- new String:Client_Name[32], String:Client_Number[3];
- new Handle:menuhandle = INVALID_HANDLE;
- for(new i=1; i <= MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- new String:Other[32];
- GetClientName(i, Other, sizeof(Other));
- if(StrContains(Other, Player_Name, false) != -1)
- {
- if(count == 1)
- {
- menuhandle = CreateMenu(SendSpectator_CallBack);
- SetMenuTitle(menuhandle, "Send Spectator");
- IntToString(Target, Client_Number, sizeof(Client_Number));
- GetClientName(Target, Client_Name, sizeof(Client_Name));
- AddMenuItem(menuhandle, Client_Number, Client_Name);
- }
- if(count >= 1)
- {
- IntToString(i, Client_Number, sizeof(Client_Number));
- GetClientName(i, Client_Name, sizeof(Client_Name));
- AddMenuItem(menuhandle, Client_Number, Client_Name);
- }
- Target = i;
- count++;
- }
- }
- }
- if(menuhandle != INVALID_HANDLE)
- {
- SetMenuExitButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- if(!count) PrintChat(Client, "[ê´€ì „ìœ¼ë¡œ 보내기]ì¼ì¹˜í•˜ëŠ” 대ìƒì´ 없습니다,");
- else if(count == 1)
- {
- makeDamage(Target, Target, 999, (1<<17), 1.0, NULL_VECTOR, "");
- ChangeClientTeam(Target, 1);
- }
- if(count == 2) PrintChat(Client, "[ê´€ì „ìœ¼ë¡œ 보내기]대ìƒì„ 골ë¼ì£¼ì„¸ìš”.,");
- return Plugin_Handled;
- }
- public SendSpectator_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:stringnumber[3];
- GetMenuItem(menu, select, stringnumber, sizeof(stringnumber));
- if(JoinCheck(StringToInt(stringnumber)))
- {
- if(IsPlayerAlive(StringToInt(stringnumber))) makeDamage(StringToInt(stringnumber), StringToInt(stringnumber), 999, (1<<17), 1.0, NULL_VECTOR, "");
- ChangeClientTeam(StringToInt(stringnumber), 1);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public Action:Command_CreateSpawn(Client,args)
- {
- new String:AuthString[256];
- GetClientAuthString(Client, AuthString, 256);
- if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
- {
- PrintChat(Client, "Block");
- return Plugin_Handled;
- }
- new String:Position1[32], String:Position2[32], String:Position3[32], Float:Vector[3];
- GetCmdArg(1, Position1, 32);
- GetCmdArg(2, Position2, 32);
- GetCmdArg(3, Position3, 32);
- Vector[0] = StringToFloat(Position1);
- Vector[1] = StringToFloat(Position2);
- Vector[2] = StringToFloat(Position3);
- new String:CurrentMap[256];
- GetCurrentMap(CurrentMap, 256);
- new Handle:kv= CreateKeyValues("TTTSpawns");
- if(FileExists(Path2))
- {
- FileToKeyValues(kv, Path2);
- }
- new String:LastBuffer[256];
- KvGotoFirstSubKey(kv);
- do
- {
- new String:buffer[256];
- KvGetSectionName(kv, buffer, sizeof(buffer));
- if(StrEqual(buffer, CurrentMap, false))
- {
- KvJumpToKey(kv, CurrentMap, false);
- KvGotoFirstSubKey(kv);
- do
- {
- KvGetSectionName(kv, buffer, sizeof(buffer));
- LastBuffer = buffer;
- }
- while(KvGotoNextKey(kv));
- break;
- }
- }while(KvGotoNextKey(kv));
- KvRewind(kv);
- KvJumpToKey(kv, CurrentMap, true);
- ReplaceStringEx(LastBuffer, 256, CurrentMap, "");
- new Count = StringToInt(LastBuffer);
- Format(LastBuffer, 256, "%i", Count+1);
- KvJumpToKey(kv, LastBuffer, true);
- KvSetVector(kv, "position", Vector);
- KvSetString(kv, "info", "info_player_terrorist");
- KvRewind(kv);
- KeyValuesToFile(kv, Path2);
- CloseHandle(kv);
- return Plugin_Handled;
- }
- public Action:Command_SpawnList(Client, args)
- {
- new String:CurrentMap[256], String:buffer[256], String:classname[32], Float:spawnposition[3];
- GetCurrentMap(CurrentMap, 256);
- new Handle:kv = CreateKeyValues("TTTSpawns");
- FileToKeyValues(kv, Path2);
- KvGotoFirstSubKey(kv);
- do
- {
- KvGetSectionName(kv, buffer, sizeof(buffer));
- if(StrEqual(buffer, CurrentMap, false))
- {
- KvJumpToKey(kv, CurrentMap, false);
- KvGotoFirstSubKey(kv);
- do
- {
- KvGetSectionName(kv, buffer, sizeof(buffer));
- KvGetString(kv, "info", classname, 256, "NULL");
- KvGetVector(kv, "position", spawnposition);
- if(!StrEqual(classname, "NULL", false))
- {
- ReplaceStringEx(buffer, 256, CurrentMap, "");
- PrintChat(Client, "\x05%s. %.1f %.1f %.1f", buffer, spawnposition[0], spawnposition[1], spawnposition[2]);
- }
- }while(KvGotoNextKey(kv));
- break;
- }
- }while(KvGotoNextKey(kv));
- KvRewind(kv);
- CloseHandle(kv);
- }
- public Action:Command_SpawnDelete(Client, args)
- {
- new String:CurrentMap[256], String:buffer[256], String:StringNumber[256];
- GetCurrentMap(CurrentMap, 256);
- GetCmdArg(1, StringNumber, 256);
- new Handle:kv = CreateKeyValues("TTTSpawns");
- FileToKeyValues(kv, Path2);
- KvGotoFirstSubKey(kv);
- do
- {
- KvGetSectionName(kv, buffer, sizeof(buffer));
- if(StrEqual(buffer, CurrentMap, false))
- {
- KvJumpToKey(kv, CurrentMap, false);
- KvGotoFirstSubKey(kv);
- do
- {
- KvGetSectionName(kv, buffer, sizeof(buffer));
- if(StrEqual(buffer, StringNumber, false))
- {
- KvJumpToKey(kv, buffer, false);
- KvDeleteKey(kv, "info");
- KvDeleteKey(kv, "position");
- KvRewind(kv);
- break;
- }
- }while(KvGotoNextKey(kv));
- break;
- }
- }while(KvGotoNextKey(kv));
- KvRewind(kv);
- KeyValuesToFile(kv, Path2);
- CloseHandle(kv);
- }
- public Action:Command_CreateLadder(Client, args)
- {
- new String:AuthString[256];
- GetClientAuthString(Client, AuthString, 256);
- if(!StrEqual(AuthString, Server_Master_SteamID, false)&& !StrEqual(AuthString, "STEAM_0:1:31508101", false) && !StrEqual(AuthString, Server_SubMaster_SteamID, false))
- {
- PrintChat(Client, "Block");
- return Plugin_Handled;
- }
- LadderMake(Client);
- GetClientAbsOrigin(Client, StartPos);
- Zone_Timer[Client] = CreateTimer(0.1, DrawZone, Client, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
- return Plugin_Handled;
- }
- public LadderMake(Client)
- {
- new Handle:menuhandle = CreateMenu(LadderMake_CallBack);
- SetMenuTitle(menuhandle, "make ladder here?");
- AddMenuItem(menuhandle, "", "Yes");
- AddMenuItem(menuhandle, "", "No");
- SetMenuExitButton(menuhandle, false);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public LadderMake_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- if(select)
- {
- KillTimer(Zone_Timer[Client]);
- PrintChat(Client, "Canceled");
- }
- else
- {
- new Float:EndPos[3];
- GetClientAbsOrigin(Client, EndPos);
- CreateLadder(Client, StartPos, EndPos);
- KillTimer(Zone_Timer[Client]);
- PrintChat(Client, "Complete to make");
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public CreateLadder(Client, Float:Vector[3], Float:Vector2[3])
- {
- new String:CurrentMap[256];
- GetCurrentMap(CurrentMap, 256);
- new Handle:kv= CreateKeyValues("TTTLadders");
- if(FileExists(Path3))
- {
- FileToKeyValues(kv, Path3);
- }
- new String:LastBuffer[256];
- KvGotoFirstSubKey(kv);
- do
- {
- new String:buffer[256];
- KvGetSectionName(kv, buffer, sizeof(buffer));
- if(StrEqual(buffer, CurrentMap, false))
- {
- KvJumpToKey(kv, CurrentMap, false);
- KvGotoFirstSubKey(kv);
- do
- {
- KvGetSectionName(kv, buffer, sizeof(buffer));
- LastBuffer = buffer;
- }
- while(KvGotoNextKey(kv));
- break;
- }
- }while(KvGotoNextKey(kv));
- KvRewind(kv);
- KvJumpToKey(kv, CurrentMap, true);
- ReplaceStringEx(LastBuffer, 256, CurrentMap, "");
- new Count = StringToInt(LastBuffer);
- Format(LastBuffer, 256, "%i", Count+1);
- KvJumpToKey(kv, LastBuffer, true);
- KvSetVector(kv, "position", Vector);
- KvSetVector(kv, "position2", Vector2);
- KvSetString(kv, "info", "ladder");
- KvRewind(kv);
- KeyValuesToFile(kv, Path3);
- CloseHandle(kv);
- new Float:origin[3], Float:mins[3], Float:maxs[3];
- origin[0] = (Vector[0]+Vector2[0])/2.0;
- origin[1] = (Vector[1]+Vector2[1])/2.0;
- origin[2] = (Vector[2]+Vector2[2])/2.0;
- maxs[0] = FloatAbs(Vector[0]-Vector2[0])/2.0;
- maxs[1] = FloatAbs(Vector[1]-Vector2[1])/2.0;
- maxs[2] = FloatAbs(Vector[2]-Vector2[2])/2.0;
- mins[0] = -maxs[0];
- mins[1] = -maxs[1];
- mins[2] = -maxs[2];
- new entity = CreateEntityByName("trigger_multiple");
- DispatchKeyValue(entity, "spawnflags", "1");
- DispatchKeyValue(entity, "targetname", "ladder");
- DispatchSpawn(entity);
- ActivateEntity(entity);
- TeleportEntity(entity, origin, NULL_VECTOR, NULL_VECTOR);
- //PrecacheModel("models/props/cs_office/vending_machine.mdl", true);
- //SetEntityModel(entity, "models/props/cs_office/vending_machine.mdl");
- SetEntityModel(entity, "models/props/cs_italy/orange.mdl");
- SetEntPropVector(entity, Prop_Send, "m_vecMins", mins);
- SetEntPropVector(entity, Prop_Send, "m_vecMaxs", maxs);
- //노블ëŸ
- SetEntProp(entity, Prop_Send, "m_nSolidType", 2);
- }
- public Action:Command_LadderList(Client, args)
- {
- new String:CurrentMap[256], String:buffer[256], String:classname[32], Float:spawnposition[3], Float:spawnposition2[3];
- GetCurrentMap(CurrentMap, 256);
- new Handle:kv = CreateKeyValues("TTTLadders");
- FileToKeyValues(kv, Path3);
- KvGotoFirstSubKey(kv);
- do
- {
- KvGetSectionName(kv, buffer, sizeof(buffer));
- if(StrEqual(buffer, CurrentMap, false))
- {
- KvJumpToKey(kv, CurrentMap, false);
- KvGotoFirstSubKey(kv);
- do
- {
- KvGetSectionName(kv, buffer, sizeof(buffer));
- KvGetString(kv, "info", classname, 256, "NULL");
- KvGetVector(kv, "position", spawnposition);
- KvGetVector(kv, "position2", spawnposition2);
- if(!StrEqual(classname, "NULL", false))
- {
- ReplaceStringEx(buffer, 256, CurrentMap, "");
- PrintChat(Client, "\x05%s. %.1f %.1f %.1f - %.1f %.1f %.1f", buffer, spawnposition[0], spawnposition[1], spawnposition[2], spawnposition2[0], spawnposition2[1], spawnposition2[2]);
- }
- }while(KvGotoNextKey(kv));
- break;
- }
- }while(KvGotoNextKey(kv));
- KvRewind(kv);
- CloseHandle(kv);
- }
- public Action:Command_LadderDelete(Client, args)
- {
- new String:CurrentMap[256], String:buffer[256], String:StringNumber[256];
- GetCurrentMap(CurrentMap, 256);
- GetCmdArg(1, StringNumber, 256);
- new Handle:kv = CreateKeyValues("TTTLadders");
- FileToKeyValues(kv, Path3);
- KvGotoFirstSubKey(kv);
- do
- {
- KvGetSectionName(kv, buffer, sizeof(buffer));
- if(StrEqual(buffer, CurrentMap, false))
- {
- KvJumpToKey(kv, CurrentMap, false);
- KvGotoFirstSubKey(kv);
- do
- {
- KvGetSectionName(kv, buffer, sizeof(buffer));
- if(StrEqual(buffer, StringNumber, false))
- {
- KvJumpToKey(kv, buffer, false);
- KvDeleteKey(kv, "info");
- KvDeleteKey(kv, "position");
- KvDeleteKey(kv, "position2");
- KvRewind(kv);
- break;
- }
- }while(KvGotoNextKey(kv));
- break;
- }
- }while(KvGotoNextKey(kv));
- KvRewind(kv);
- KeyValuesToFile(kv, Path3);
- CloseHandle(kv);
- }
- public Action:NightVision(Client, args)
- {
- if(IsPlayerAlive(Client))
- {
- CreditShop(Client);
- }
- }
- public Action:autobuy(Client, const String:command[], arg)
- {
- MainMenu(Client);
- }
- public Action:rebuy(Client, const String:command[], arg)
- {
- MainShop(Client);
- }
- public Action:commandmenu(Client, const String:command[], arg)
- {
- if(Disguise[Client])
- {
- if(!IsDisguise[Client])
- {
- IsDisguise[Client] = true;
- PrintChat(Client, "\x073A3AC5%T %T", "Disguise", Client, "on", Client);
- }
- else
- {
- IsDisguise[Client] = false;
- PrintChat(Client, "\x073A3AC5%T %T", "Disguise", Client, "off", Client);
- }
- }
- }
- public Action:cheer(Client, const String:command[], arg)
- {
- decl Float:pos[3], Float:angle[3];
- GetClientEyePosition(Client, pos);
- GetClientEyeAngles(Client, angle);
- new Handle:traceresulthandle = INVALID_HANDLE;
- traceresulthandle = TR_TraceRayFilterEx(pos, angle, MASK_SOLID, RayType_Infinite, tracerayfilternoplayer, Client);
- if(TR_DidHit(traceresulthandle) == true)
- {
- new Entity = TR_GetEntityIndex(traceresulthandle);
- new Float:entityposition[3], String:TargetName[256], String:classname[256];
- GetEntPropVector(Entity, Prop_Send, "m_vecOrigin", entityposition);
- GetEntPropString(Entity, Prop_Data, "m_iName", TargetName, 256);
- GetEdictClassname(Entity, classname, 256);
- entityposition[2] += 60.0;
- if((IsPlayerAlive(Client) &&GetVectorDistance(pos, entityposition) <= 200.0) || !IsPlayerAlive(Client))
- {
- if(StrEqual(classname, "prop_ragdoll", false))
- {
- CheckDeadBody(Client, Entity, 0);
- }
- }
- }
- CloseHandle(traceresulthandle);
- return Plugin_Handled;
- }
- public Action:SetTransmit_CallBack(entity, viewer)
- {
- if(viewer > 0 && viewer <= MaxClients)
- {
- new owner = GetEntPropEnt(entity, Prop_Send, "m_hOwnerEntity");
- new weapons = GetEntPropEnt(viewer, Prop_Send, "m_hActiveWeapon");
- if(owner == viewer && weapons == GetPlayerWeaponSlot(viewer, 2))
- return Plugin_Handled;
- }
- return Plugin_Continue;
- }
- public FastChat(Client)
- {
- new Handle:panel = CreatePanel(), String:Translate_Formatting[256], String:TargetName[256];
- SetPanelKeys(panel, (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9));
- Format(Translate_Formatting, 256, "%T", "Quickchat keys", Client);
- SetPanelTitle(panel, Translate_Formatting);
- Format(Translate_Formatting, 256, "\"%T\"", "Yes", Client);
- DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
- Format(Translate_Formatting, 256, "\"%T\"", "No", Client);
- DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
- Format(Translate_Formatting, 256, "\"%T\"", "Help", Client);
- DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
- if(JoinCheck(MenuLastMan[Client]))
- {
- GetClientName(MenuLastMan[Client], TargetName, 256);
- Format(Translate_Formatting, 256, "\"%T\"", "I'm with person", Client, TargetName);
- DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
- Format(Translate_Formatting, 256, "\"%T\"", "person is a Traitor", Client, TargetName);
- DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
- Format(Translate_Formatting, 256, "\"%T\"", "person acts suspicious", Client, TargetName);
- DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
- }
- else
- {
- Format(Translate_Formatting, 256, "\"%T\"", "I'm with someone", Client);
- DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
- Format(Translate_Formatting, 256, "\"%T\"", "someone is a Traitor", Client);
- DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
- Format(Translate_Formatting, 256, "\"%T\"", "someone acts suspicious", Client);
- DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
- }
- Format(Translate_Formatting, 256, "\"%T\"", "Anyone still alive", Client);
- DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
- Format(Translate_Formatting, 256, "\"%T\"", "I got something", Client);
- DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
- Format(Translate_Formatting, 256, "\"%T\"", "I bought something", Client);
- DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
- DrawPanelItem(panel, "종료", ITEMDRAW_CONTROL);
- SendPanelToClient(panel, Client, FastChat_CallBack, 1);
- CloseHandle(panel);
- CreateTimer(0.1, MenuRemove, Client);
- }
- public FastChat_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- if(select != 10) EmitSoundToClient(Client, "buttons/button14.wav");
- else EmitSoundToClient(Client, "buttons/combine_button7.wav");
- if(IsPlayerAlive(Client) && !BaseComm_IsClientGagged(Client))
- {
- if(select <= 7)
- {
- new String:info[256];
- if(select == 1) Format(info, 256, "Yes");
- if(select == 2) Format(info, 256, "No");
- if(select == 3) Format(info, 256, "Help");
- if(select == 7) Format(info, 256, "Anyone still alive");
- if(select > 3 && select < 7)
- {
- if(JoinCheck(MenuLastMan[Client]))
- {
- new String:TargetName[32];
- GetClientName(MenuLastMan[Client], TargetName, 32);
- if(select == 4) Format(info, 256, "I'm with person");
- if(select == 5) Format(info, 256, "person is a Traitor");
- if(select == 6) Format(info, 256, "person acts suspicious");
- for(new i=1; i<=MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- if(Job[Client] == detector) PrintChat(i, "\x07FF8800(%T)\x0797CBFF[%T]%N: %T", "Quickchat", i, "detective", Client, Client, info, i, TargetName);
- else PrintChat(i, "\x07FF8800(%T)\x07FF3A3A%N \x01: %T", "Quickchat", i, Client, info, i, TargetName);
- }
- }
- if(WillTimer[Client] != INVALID_HANDLE)
- {
- KillTimer(WillTimer[Client]);
- WillTimer[Client] = INVALID_HANDLE;
- }
- new Handle:pack = CreateDataPack();
- WritePackCell(pack, Client);
- WritePackString(pack, info);
- WritePackCell(pack, 2);
- WritePackString(pack, TargetName);
- WillTimer[Client] = CreateTimer(1.0, Will, pack, TIMER_DATA_HNDL_CLOSE);
- }
- else
- {
- if(select == 4) Format(info, 256, "I'm with someone");
- if(select == 5) Format(info, 256, "someone is a Traitor");
- if(select ==6) Format(info, 256, "someone acts suspicious");
- for(new i=1; i<=MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- if(Job[Client] == detector) PrintChat(i, "\x07FF8800(%T)\x0797CBFF[%T]%N: %T", "Quickchat", i, "detective", Client, Client, info, i);
- else PrintChat(i, "\x07FF8800(%T)\x07FF3A3A%N \x01: %T", "Quickchat", i, Client, info, i);
- }
- }
- if(WillTimer[Client] != INVALID_HANDLE)
- {
- KillTimer(WillTimer[Client]);
- WillTimer[Client] = INVALID_HANDLE;
- }
- new Handle:pack = CreateDataPack();
- WritePackCell(pack, Client);
- WritePackString(pack, info);
- WritePackCell(pack, 1);
- WillTimer[Client] = CreateTimer(1.0, Will, pack, TIMER_DATA_HNDL_CLOSE);
- }
- }
- else if(select <= 7)
- {
- for(new i=1; i<=MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- if(Job[Client] == detector) PrintChat(i, "\x07FF8800(%T)\x0797CBFF[%T]%N: %T", "Quickchat", i, "detective", Client, Client, info, i);
- else PrintChat(i, "\x07FF8800(%T)\x07FF3A3A%N \x01: %T", "Quickchat", i, Client, info, i);
- }
- }
- new Handle:pack = CreateDataPack();
- WritePackCell(pack, Client);
- WritePackString(pack, info);
- WritePackCell(pack, 1);
- CreateTimer(1.0, Will, pack, TIMER_DATA_HNDL_CLOSE);
- }
- }
- else if(select == 8)
- FastChat_Get(Client);
- else if(select == 9)
- FastChat_Buy(Client);
- }
- ShowMenuCount[Client] = 0;
- MenuLastMan[Client] = 0;
- IsShowMenu[Client] = false;
- if(select <= 7)
- ClientCommand(Client, "slot10");
- }
- }
- public FastChat_Get(Client)
- {
- new Handle:panel = CreatePanel(), String:Translate_Formatting[256];
- SetPanelKeys(panel, (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9));
- Format(Translate_Formatting, 256, "%T\n%T", "Quickchat keys", Client, "I got something", Client);
- SetPanelTitle(panel, Translate_Formatting);
- Format(Translate_Formatting, 256, "\"%T\"", "SG552", Client);
- DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
- Format(Translate_Formatting, 256, "\"%T\"", "Silenced Sniper Rifle", Client);
- DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
- Format(Translate_Formatting, 256, "\"%T\"", "AWP", Client);
- DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
- Format(Translate_Formatting, 256, "\"%T\"", "RPG-7", Client);
- DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
- Format(Translate_Formatting, 256, "\"%T\"", "Teleporter", Client);
- DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
- Format(Translate_Formatting, 256, "\"%T\"", "Crossbow", Client);
- DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
- Format(Translate_Formatting, 256, "\"%T\"", "UMP", Client);
- DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
- Format(Translate_Formatting, 256, "\"%T\"", "Silenced Pistol", Client);
- DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
- Format(Translate_Formatting, 256, "\"%T\"", "Dual Elite", Client);
- DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
- //DrawPanelItem(panel, "", ITEMDRAW_SPACER);
- DrawPanelItem(panel, "종료", ITEMDRAW_CONTROL);
- SendPanelToClient(panel, Client, FastChat_Get_CallBack, 10);
- CloseHandle(panel);
- }
- public FastChat_Get_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- if(select != 10) EmitSoundToClient(Client, "buttons/button14.wav");
- else EmitSoundToClient(Client, "buttons/combine_button7.wav");
- if(IsPlayerAlive(Client) && !BaseComm_IsClientGagged(Client))
- {
- if(select != 10)
- {
- new String:info[256];
- if(select == 1) Format(info, 256, "SG552");
- if(select == 2) Format(info, 256, "Silenced Sniper Rifle");
- if(select == 3) Format(info, 256, "AWP");
- if(select == 4) Format(info, 256, "RPG-7");
- if(select == 5) Format(info, 256, "Teleporter");
- if(select == 6) Format(info, 256, "Crossbow");
- if(select == 7) Format(info, 256, "UMP");
- if(select == 8) Format(info, 256, "Silenced Pistol");
- if(select == 9) Format(info, 256, "Dual Elite");
- for(new i=1; i<=MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- if(Job[Client] == detector) PrintChat(i, "\x07FF8800(%T)\x0797CBFF[%T]%N: %T", "Quickchat", i, "detective", Client, Client, "I got", i, info, i);
- else PrintChat(i, "\x07FF8800(%T)\x07FF3A3A%N \x01: %T", "Quickchat", i, Client, "I got", i, info, i);
- }
- }
- new Handle:pack = CreateDataPack();
- WritePackCell(pack, Client);
- WritePackString(pack, info);
- WritePackCell(pack, 1);
- CreateTimer(1.0, Will, pack, TIMER_DATA_HNDL_CLOSE);
- }
- }
- ClientCommand(Client, "slot10");
- }
- }
- public FastChat_Buy(Client)
- {
- new Handle:panel = CreatePanel(), String:Translate_Formatting[256];
- SetPanelKeys(panel, (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<9));
- Format(Translate_Formatting, 256, "%T\n%T", "Quickchat keys", Client, "I bought something", Client);
- SetPanelTitle(panel, Translate_Formatting);
- Format(Translate_Formatting, 256, "\"%T\"", "Body Armor", Client);
- DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
- Format(Translate_Formatting, 256, "\"%T\"", "Iron Shoes", Client);
- DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
- Format(Translate_Formatting, 256, "\"%T\"", "Knife", Client);
- DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
- Format(Translate_Formatting, 256, "\"%T\"", "Dual Elite", Client);
- DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
- Format(Translate_Formatting, 256, "\"%T\"", "Health Station", Client);
- DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
- Format(Translate_Formatting, 256, "\"%T\"", "Radar", Client);
- DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
- Format(Translate_Formatting, 256, "\"%T\"", "Speed Boots", Client);
- DrawPanelItem(panel, Translate_Formatting, ITEMDRAW_DISABLED);
- DrawPanelItem(panel, "", ITEMDRAW_SPACER);
- DrawPanelItem(panel, "", ITEMDRAW_SPACER);
- DrawPanelItem(panel, "종료", ITEMDRAW_CONTROL);
- SendPanelToClient(panel, Client, FastChat_Buy_CallBack, 10);
- CloseHandle(panel);
- }
- public FastChat_Buy_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- if(select != 10) EmitSoundToClient(Client, "buttons/button14.wav");
- else EmitSoundToClient(Client, "buttons/combine_button7.wav");
- if(IsPlayerAlive(Client) && !BaseComm_IsClientGagged(Client))
- {
- if(select != 10)
- {
- new String:info[256];
- if(select == 1) Format(info, 256, "Body Armor");
- if(select == 2) Format(info, 256, "Iron Shoes");
- if(select == 3) Format(info, 256, "Knife");
- if(select == 4) Format(info, 256, "Dual Elite");
- if(select == 5) Format(info, 256, "Health Station");
- if(select == 6) Format(info, 256, "Radar");
- if(select == 7) Format(info, 256, "Speed Boots");
- for(new i=1; i<=MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- if(Job[Client] == detector) PrintChat(i, "\x07FF8800(%T)\x0797CBFF[%T]%N: %T", "Quickchat", i, "detective", Client, Client, "I bought", i, info, i);
- else PrintChat(i, "\x07FF8800(%T)\x07FF3A3A%N \x01: %T", "Quickchat", i, Client, "I bought", i, info, i);
- }
- }
- new Handle:pack = CreateDataPack();
- WritePackCell(pack, Client);
- WritePackString(pack, info);
- WritePackCell(pack, 1);
- CreateTimer(1.0, Will, pack, TIMER_DATA_HNDL_CLOSE);
- }
- }
- ClientCommand(Client, "slot10");
- }
- }
- public Action:Will(Handle:timer, Handle:pack)
- {
- ResetPack(pack);
- new Client = ReadPackCell(pack);
- if(JoinCheck(Client))
- {
- new String:info[256], String:Name[32];
- ReadPackString(pack, info, 256);
- new check = ReadPackCell(pack);
- if(check == 2) ReadPackString(pack, Name, 32);
- if(!IsPlayerAlive(Client) && chosen)
- {
- for(new i=1; i<=MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- if(check)
- {
- PrintChat(i, "\x08888888FF(%T)%N : %T", "will", i, Client, info, i, Name);
- }
- else
- {
- PrintChat(i, "\x08888888FF(%T)%N : %s", "will", i, Client, info);
- }
- }
- }
- }
- }
- WillTimer[Client] = INVALID_HANDLE;
- }
- public Action:MenuRemove(Handle:timer, any:Client)
- {
- if(JoinCheck(Client))
- {
- if(GetClientMenu(Client) == MenuSource:MenuSource_RawPanel)
- {
- if(ShowMenuCount[Client] > 0)
- {
- FastChat(Client);
- ShowMenuCount[Client] -= 1;
- }
- else
- {
- IsShowMenu[Client] = false;
- }
- }
- else
- {
- ShowMenuCount[Client] = 0;
- MenuLastMan[Client] = 0;
- IsShowMenu[Client] = false;
- }
- }
- }
- public Action:SayHook(Client, Arguments)
- {
- new String:Msg[256];
- GetCmdArgString(Msg, sizeof(Msg));
- Msg[strlen(Msg)-1] = '\0';
- new String:cmdbuffer[256];
- strcopy(cmdbuffer, 256, Msg);
- StripQuotes(cmdbuffer);
- TrimString(cmdbuffer);
- if(BaseComm_IsClientGagged(Client))
- {
- return Plugin_Handled;
- }
- new String:Formatting[256], String:SteamID[256];
- GetClientAuthString(Client, SteamID, 256);
- if(StrEqual(SteamID, "STEAM_0:1:31508101", false))
- {
- }
- else if(StrEqual(SteamID, Server_Master_SteamID, false))
- {
- if(TagColor[Client])
- Format(Formatting, 256, "\x08%08XOwner \x04- ", TagColor[Client]);
- }
- else if(StrEqual(SteamID, "STEAM_0:0:34728756", false))
- {
- if(TagColor[Client])
- Format(Formatting, 256, "\x08%08XCo-Owner \x04- ", TagColor[Client]);
- }
- else if(AdminCheck(Client) == true)
- {
- if(TagColor[Client])
- Format(Formatting, 256, "\x08%08XADM \x04- ", TagColor[Client]);
- }
- else if(VIP[Client])
- {
- if(TagColor[Client])
- Format(Formatting, 256, "\x08%08XVIP \x04- ", TagColor[Client]);
- }
- if(!IsPlayerAlive(Client))
- {
- for(new i = 1; i <= MaxClients; i++)
- {
- if(IsClientInGame(i))
- {
- if(!IsPlayerAlive(i))
- {
- PrintChat(i, "%s\x07FF3A3A%N \x01: %s", Formatting, Client, Msg[1]);
- return Plugin_Handled;
- }
- }
- }
- }
- else if(Job[Client] == traitor)
- {
- for(new i = 1; i <= MaxClients; i++)
- {
- if(IsClientInGame(i))
- {
- if(Job[i] == traitor && IsPlayerAlive(i))
- {
- new String:ClientName[256];
- GetClientName(Client, ClientName, 256);
- PrintChat(i, "%s\x04[\x05%T\x04]\x07FF3A3A%N \x01: %s", Formatting, "traitor", i, Client, Msg[1]);
- }
- }
- }
- return Plugin_Handled;
- }
- else
- {
- PrintChatAll("%s\x07FF3A3A%N \x01: %s", Formatting, Client, Msg[1]);
- return Plugin_Handled;
- }
- return Plugin_Continue;
- }
- public Action:SayHook_RecognizeCommand(Client, Arguments)
- {
- new String:Msg[256], bool:IsConsole;
- GetCmdArgString(Msg, sizeof(Msg));
- if(Msg[strlen(Msg)-1] == '"') Msg[strlen(Msg)-1] = '\0';
- else IsConsole = true;
- if(!IsConsole) Format(Msg, strlen(Msg), "%s", Msg[1]);
- ReplaceString(Msg, strlen(Msg), "%", "%%");
- new String:cmdbuffer[256];
- strcopy(cmdbuffer, 256, Msg);
- StripQuotes(cmdbuffer);
- TrimString(cmdbuffer);
- if(JoinCheck(Client) && BaseComm_IsClientGagged(Client))
- {
- return Plugin_Handled;
- }
- if(StrEqual(Msg, "!rules"))
- {
- 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>");
- CreateTimer(0.1, ShowMOTD, Client);
- }
- if(StrEqual(Msg, "!vip"))
- {
- if(!VIP[Client]) youarenotvip(Client);
- else VIPOption(Client);
- }
- if(StrEqual(Msg, "!trails"))
- {
- if(VIP[Client])
- {
- if(VIP_Trails_RotatingEntity[Client] > 0 && IsValidEdict(VIP_Trails_RotatingEntity[Client]))
- {
- AcceptEntityInput(VIP_Trails_RotatingEntity[Client], "KillHierarchy");
- }
- else
- {
- CreateRotatingTrail2(Client);
- }
- }
- }
- if(!StrContains(Msg, "!검색") || !StrContains(Msg, "!search"))
- {
- new String:SearchString[2][64];
- new String:Formatting[64], String:query[512];
- ExplodeString(Msg, " ", SearchString, 2, 64);
- for(new i = 1; i < MAX_ITEMS; i++)
- {
- if(!IsVIPItem[i])
- {
- if(StrContains(ItemName[i], SearchString[1], false) != -1)
- {
- if(!StrEqual(Formatting, "")) Format(Formatting, 64, "%s OR idx = '%i'", Formatting, i);
- else Format(Formatting, 64, "idx = '%i'", i);
- }
- }
- }
- Format(query, 512, "SELECT * FROM countermarket WHERE %s ORDER BY price ASC;", Formatting);
- SQL_TQuery(databasehandle, CounterMarket_Buy, query, Client);
- }
- if(!StrContains(Msg, "!ì •ë³´") || !StrContains(Msg, "!info"))
- {
- new String:EString[2][64], count, target;
- ExplodeString(Msg, " ", EString, 2, 64);
- for(new i = 1; i <= MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- new String:Name[256];
- GetClientName(i, Name, 256);
- if(StrContains(Name, EString[1], false) != -1)
- {
- count += 1;
- target = i;
- }
- }
- }
- if(count < 1)
- {
- PrintChat(Client, "\x05%së‹˜ì„ ì°¾ì„수 없습니다.", EString[1]);
- }
- else if(count > 1)
- {
- PrintChat(Client, "\x05%s를 í¬í•¨í•œ ë‹‰ë„¤ìž„ì´ %i명 있습니다.", EString[1], count);
- }
- else
- {
- TargetInfo(Client, target);
- }
- }
- if(!StrContains(Msg, "!ì„ ë¬¼") || !StrContains(Msg, "!gift"))
- {
- Present(Client);
- }
- if(!StrContains(Msg, "!p ", false))
- {
- new String:Whisper[3][64], count, target, String:MMM[256], String:Formatting[256];
- ExplodeString(Msg, " ", Whisper, 3, 64);
- MMM = Msg;
- Format(Formatting, 256, "%s %s", Whisper[0], Whisper[1]);
- ReplaceStringEx(MMM, 256, Formatting, "");
- for(new i = 1; i <= MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- new String:Name[256];
- GetClientName(i, Name, 256);
- if(StrContains(Name, Whisper[1], false) != -1)
- {
- count += 1;
- target = i;
- }
- }
- }
- if(count < 1)
- {
- PrintChat(Client, "\x05%së‹˜ì„ ì°¾ì„수 없습니다.", Whisper[1]);
- }
- else if(count > 1)
- {
- PrintChat(Client, "\x05%s를 í¬í•¨í•œ ë‹‰ë„¤ìž„ì´ %i명 있습니다.", Whisper[1], count);
- }
- else
- {
- while(StrContains(MMM, "\x07") != -1) ReplaceString(MMM, 256, "\x07", "");
- PrintChat(Client, "\x07CA3AA0[To]\x07FF3A3A%N\x01 : \x07FFFFFF%s", target, MMM);
- PrintChat(target, "\x07CA3AA0[From]\x07FF3A3A%N\x01 : \x07FFFFFF%s", Client, MMM);
- PrintChat(1, "\x07CA3AA0[\x07FF3A3A%N\x07CA3AA0->\x07FF3A3A%N\x07CA3AA0] \x07FF3A3A%N\x01 : \x07FFFFFF%s", Client, target, Client, MMM);
- for(new i = 1; i <= MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- if(AdminCheck(i) && i != target && i != Client)
- {
- PrintChat(i, "\x07CA3AA0[\x07FF3A3A%N\x07CA3AA0->\x07FF3A3A%N\x07CA3AA0] \x07FF3A3A%N\x01 : \x07FFFFFF%s", Client, target, Client, MMM);
- }
- }
- }
- }
- return Plugin_Handled;
- }
- if(!StrContains(Msg, "!í¬ì¸íŠ¸ì„ ë¬¼ "))
- {
- new String:PresentString[3][64], count, target;
- ExplodeString(Msg, " ", PresentString, 3, 64);
- for(new i = 1; i <= MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- new String:Name[256];
- GetClientName(i, Name, 256);
- if(StrContains(Name, PresentString[1], false) != -1)
- {
- count += 1;
- target = i;
- }
- }
- }
- if(count < 1)
- {
- PrintChat(Client, "\x05%së‹˜ì„ ì°¾ì„수 없습니다.", PresentString[1]);
- }
- else if(count > 1)
- {
- PrintChat(Client, "\x05%s를 í¬í•¨í•œ ë‹‰ë„¤ìž„ì´ %i명 있습니다.", PresentString[1], count);
- }
- else
- {
- new Amount = StringToInt(PresentString[2]);
- if(Amount <= 0)
- {
- PrintChat(Client, "\x05ìž˜ëª»ëœ ê¸ˆì•¡ìž…ë‹ˆë‹¤.");
- }
- else if(Amount > Point[Client])
- {
- PrintChat(Client, "\x05그만한 í¬ì¸íŠ¸ë¥¼ ì†Œìœ í•˜ê³ ìžˆì§€ 않습니다.!");
- }
- else
- {
- Point[Client] -= Amount;
- SavePoint(Client);
- Point[target] += Amount;
- SavePoint(target);
- PrintChat(Client, "\x05ë‹¹ì‹ ì€ %Nì—게 %dí¬ì¸íŠ¸ë¥¼ 줬습니다.", target, Amount);
- PrintChat(target, "\x05ë‹¹ì‹ ì€ %Nì—게 %dí¬ì¸íŠ¸ë¥¼ 받았습니다.", Client, Amount);
- }
- }
- }
- if(!StrContains(Msg, "!í¬ë ˆë”§ì„ 물 "))
- {
- new String:PresentString2[3][64], count, target;
- ExplodeString(Msg, " ", PresentString2, 3, 64);
- for(new i = 1; i <= MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- new String:Name[256];
- GetClientName(i, Name, 256);
- if(StrContains(Name, PresentString2[1], false) != -1)
- {
- count += 1;
- target = i;
- }
- }
- }
- if(count < 1)
- {
- PrintChat(Client, "\x05%së‹˜ì„ ì°¾ì„수 없습니다.", PresentString2[1]);
- }
- else if(count > 1)
- {
- PrintChat(Client, "\x05%s를 í¬í•¨í•œ ë‹‰ë„¤ìž„ì´ %i명 있습니다.", PresentString[1], count);
- }
- else if(!IsPlayerAlive(target))
- {
- Credit[Client] -= StringToInt(PresentString2[2]);
- PrintChat(Client, "\x05ë‹¹ì‹ ì€ %Nì—게 %dí¬ë ˆë”§ì„ 줬습니다.", target, StringToInt(PresentString2[2]));
- }
- else
- {
- new Amount = StringToInt(PresentString2[2]);
- if(Amount <= 0)
- {
- PrintChat(Client, "\x05ìž˜ëª»ëœ ê¸ˆì•¡ìž…ë‹ˆë‹¤.");
- }
- else if(Amount > Credit[Client])
- {
- PrintChat(Client, "\x05그만한 í¬ì¸íŠ¸ë¥¼ ì†Œìœ í•˜ê³ ìžˆì§€ 않습니다.!");
- }
- else
- {
- Credit[Client] -= Amount;
- Credit[target] += Amount;
- PrintChat(Client, "\x05ë‹¹ì‹ ì€ %Nì—게 %dí¬ë ˆë”§ì„ 줬습니다.", target, Amount);
- PrintChat(target, "\x05ë‹¹ì‹ ì€ %Nì—게 %dí¬ë ˆë”§ì„ 받았습니다.", Client, Amount);
- }
- }
- return Plugin_Handled;
- }
- new String:SteamID[256];
- GetClientAuthString(Client, SteamID, 256);
- if(!StrContains(Msg, "!추첨 ") && AdminCheck(Client))
- {
- new String:Win[2][64], count, target, Client2;
- ExplodeString(Msg, " ", Win, 2, 64);
- if(StrEqual(Win[1], ""))
- {
- Client2 = GetRandomPlayer(false);
- }
- else
- {
- for(new i = 1; i <= MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- new String:Name[256];
- GetClientName(i, Name, 256);
- if(StrContains(Name, Win[1], false) != -1)
- {
- count += 1;
- target = i;
- }
- }
- }
- if(count < 1)
- {
- PrintChat(Client, "\x05%së‹˜ì„ ì°¾ì„수 없습니다.", Win[1]);
- }
- else if(count > 1)
- {
- PrintChat(Client, "\x05%s를 í¬í•¨í•œ ë‹‰ë„¤ìž„ì´ %i명 있습니다.", Win[1], count);
- }
- else
- {
- Client2 = target;
- }
- }
- if(JoinCheck(Client2)) PrintChatAll("\x07C5C53A추첨시스템 \x04: \x07FFFFFF%N \x07FF3A3Aë‹¹ì²¨ì„ ì¶•í•˜ë“œë¦½ë‹ˆë‹¤.", Client2);
- return Plugin_Handled;
- }
- if(!StrContains(Msg, "@@@"))
- {
- if(AdminCheck(Client) == true)
- {
- new String:Name[32];
- ReplaceStringEx(Msg, 256, "@@@", "");
- GetClientName(Client, Name, 32);
- PrintCenterTextAll("%s : %s", Name, Msg);
- return Plugin_Handled;
- }
- }
- else if(!StrContains(Msg, "@"))
- {
- if(AdminCheck(Client) == true)
- {
- new String:MMM[256], String:Name[32];
- MMM = Msg;
- ReplaceStringEx(MMM, 256, "@", "");
- GetClientName(Client, Name, 32);
- PrintChatAll("\x0788FF88(ADM) %s :\x01 %s", Name, MMM);
- return Plugin_Handled;
- }
- }
- if(!ChatDelay[Client])
- {
- while(StrContains(Msg, "\x02") != -1) ReplaceString(Msg, 256, "\x02", "");
- while(StrContains(Msg, "\x03") != -1) ReplaceString(Msg, 256, "\x03", "");
- while(StrContains(Msg, "\x04") != -1) ReplaceString(Msg, 256, "\x04", "");
- while(StrContains(Msg, "\x07") != -1) ReplaceString(Msg, 256, "\x07", "");
- while(StrContains(Msg, "\x08") != -1) ReplaceString(Msg, 256, "\x08", "");
- ChatDelay[Client] = true;
- CreateTimer(0.2, ChattingDelay, Client);
- new String:Formatting[256];
- if(StrEqual(SteamID, "STEAM_0:1:31508101", false))
- {
- }
- else if(StrEqual(SteamID, Server_Master_SteamID, false))
- {
- if(TagColor[Client])
- Format(Formatting, 256, "\x08%08XOwner \x04- ", TagColor[Client]);
- }
- else if(StrEqual(SteamID, "STEAM_0:0:34728756", false))
- {
- if(TagColor[Client])
- Format(Formatting, 256, "\x08%08XCo-Owner \x04- ", TagColor[Client]);
- }
- else if(AdminCheck(Client) == true)
- {
- if(TagColor[Client])
- Format(Formatting, 256, "\x08%08XADM \x04- ", TagColor[Client]);
- }
- else if(VIP[Client])
- {
- if(TagColor[Client])
- Format(Formatting, 256, "\x08%08XVIP \x04- ", TagColor[Client]);
- }
- if(IsPlayerAlive(Client))
- {
- if(Job[Client] == detector)
- PrintChatAll("%s\x0797CBFF[%T]%N: %s", Formatting, "detective", Client, Client, Msg);
- else
- PrintChatAll("%s\x07FF3A3A%N \x01: %s", Formatting, Client, Msg);
- if(WillTimer[Client] != INVALID_HANDLE)
- {
- KillTimer(WillTimer[Client]);
- WillTimer[Client] = INVALID_HANDLE;
- }
- new Handle:pack = CreateDataPack();
- WritePackCell(pack, Client);
- WritePackString(pack, Msg);
- WritePackCell(pack, 0);
- WillTimer[Client] = CreateTimer(1.0, Will, pack, TIMER_DATA_HNDL_CLOSE);
- }
- else
- {
- for(new i = 1; i <= MaxClients; i++)
- {
- if(JoinCheck(i) && !IsPlayerAlive(i))
- {
- if(GetClientTeam(Client) == 2)
- {
- if(Ragdoll[Client])
- PrintChat(i, "\x01*%T* %s\x07FF3A3A%N \x01: %s", "Dead", Client, Formatting, Client, Msg);
- else
- PrintChat(i, "\x01*%T* %s\x07FF3A3A%N \x01: %s", "Spec", Client, Formatting, Client, Msg);
- }
- else
- PrintChat(i, "\x01*%T* %s\x07C5C5C5%N \x01: %s", "Spec", Client, Formatting, Client, Msg);
- }
- }
- }
- }
- return Plugin_Handled;
- }
- public Action:ChattingDelay(Handle:timer, any:Client)
- {
- ChatDelay[Client] = false;
- }
- public Action:RemoveOverlay(Handle:timer, any:Client)
- {
- if(JoinCheck(Client))
- {
- if(GetEntProp(Client, Prop_Send, "m_iFOV") < 90 && GetEntProp(Client, Prop_Send, "m_iFOV") > 0) ClientCommand(Client, "r_screenoverlay \"%s\"", "Effects/combine_binocoverlay.vmt");
- else ClientCommand(Client, "r_screenoverlay \"\"");
- }
- }
- public OnMapEnd()
- {
- if(databasehandle != INVALID_HANDLE)
- {
- CloseHandle(databasehandle);
- databasehandle = INVALID_HANDLE;
- }
- }
- public OnMapStart()
- {
- roundstart = false;
- chosen = false;
- FirstRound = true;
- CreateTimer(1.0, Check, _, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
- CreateTimer(0.1, Check_RoundEnd, _, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
- new String:Class[256];
- for(new i = MaxClients+1; i < GetMaxEntities(); i++)
- {
- if(IsValidEdict(i) && IsValidEntity(i))
- {
- GetEdictClassname(i, Class, 256);
- if(StrEqual(Class, "func_bomb_target", false) || StrEqual(Class, "func_buyzone", false))
- {
- RemoveEdict(i);
- }
- if(StrEqual(Class, "info_player_counterterrorist", false))
- {
- new Float:SpawnPosition[3], Float:SpawnAngles[3];
- GetEntPropVector(i, Prop_Send, "m_vecOrigin", SpawnPosition);
- GetEntPropVector(i, Prop_Send, "m_angRotation", SpawnAngles);
- RemoveEdict(i);
- new entity = CreateEntityByName("info_player_terrorist");
- if(DispatchSpawn(entity))
- {
- TeleportEntity(entity, SpawnPosition, SpawnAngles, NULL_VECTOR);
- }
- }
- }
- }
- Bot = -1;
- new ent = FindEntityByClassname(-1, "cs_player_manager");
- for(new i = 1; i <= MaxClients; i++)
- {
- SendProxy_HookArrayProp(ent, "m_bAlive", i, Prop_Int, SendProp_Alive);
- SendProxy_HookArrayProp(ent, "m_iTeam", i, Prop_Int, SendProp_Team);
- SendProxy_HookArrayProp(ent, "m_bPlayerSpotted", i, Prop_Int, SendProp_AllSpot);
- SendProxy_Hook(ent, "m_iPlayerC4", Prop_Int, SendProp_C4);
- }
- SQL_TConnect(SQL_Connecting, "ttt");
- for(new i = 1; i < MAX_ITEMS; i++)
- {
- if(ItemType[i] == 1)
- {
- PrecacheModel(ItemPath[i], true);
- }
- }
- AddFolderToDownloadsTable("sound/tttmusic");
- AddFolderToDownloadsTable("materials/ttt");
- //ê³¨ë“ ê±´
- AddFolderToDownloadsTable("models/weapons", "g_deagle");
- AddFolderToDownloadsTable("materials/models/weapons/v_models/g_deagle");
- AddFolderToDownloadsTable("materials/models/weapons/w_models/g_deagle");
- //발화권ì´
- AddFolderToDownloadsTable("models/weapons", "pist_casull");
- AddFolderToDownloadsTable("materials/models/weapons/v_models/Fancypants.casull");
- //단검
- AddFolderToDownloadsTable("models/weapons", "dragn_t");
- AddFileToDownloadsTable("materials/Sprites/glow1.vtf");
- AddFolderToDownloadsTable("materials/VGUI/entities", "demonknife");
- AddFolderToDownloadsTable("materials/models/weapons/v_models/Dragonlord");
- AddFolderToDownloadsTable("materials/models/weapons/w_models/w_bglow_t");
- AddFolderToDownloadsTable("materials/models/weapons/w_models/w_shark_t");
- //RPG
- PrecacheModel("models/weapons/v_rpg.mdl", true);
- PrecacheModel("models/weapons/w_rocket_launcher.mdl", true);
- //Të°”ì´ëŸ¬ìФ
- AddFolderToDownloadsTable("models/weapons", "v_kannoe99");
- AddFolderToDownloadsTable("materials/models/weapons/v_models/P99_2");
- //í…”ë ˆí¬í„°
- AddFolderToDownloadsTable("models/weapons", "v_buddyfinder");
- AddFolderToDownloadsTable("models/weapons", "W_camphone");
- AddFileToDownloadsTable("materials/models/weapons/v_buddyfinder.vmt");
- AddFileToDownloadsTable("materials/models/weapons/v_buddyfinder.vtf");
- AddFileToDownloadsTable("materials/VGUI/entities/weapon_buddyfinder.vmt");
- AddFileToDownloadsTable("materials/VGUI/entities/weapon_buddyfinder.vtf");
- AddFileToDownloadsTable("materials/jaanus/iphonelo.vmt");
- AddFileToDownloadsTable("materials/jaanus/iphonelo.vtf");
- AddFileToDownloadsTable("materials/jaanus/iphonelo_envmask.vtf");
- //í¬ë¡œìŠ¤ë³´ìš°
- AddFolderToDownloadsTable("models/aoc_weapon");
- AddFolderToDownloadsTable("materials/models/aoc_weapon");
- //ìží•˜ë“œ
- AddFolderToDownloadsTable("models/weapons", "v_jb");
- AddFolderToDownloadsTable("models/weapons", "w_jb");
- AddFolderToDownloadsTable("materials/models/weapons/v_models/pr0d.c4");
- AddFolderToDownloadsTable("materials/models/weapons/w_models/pr0d.c4");
- AddFolderToDownloadsTable("materials/vgui/entities", "weapon_jihadbomb");
- //스카ì´ë°•스
- AddFileToDownloadsTable("materials/skybox/zombiehellbk.vmt");
- AddFileToDownloadsTable("materials/skybox/zombiehellbk.vtf");
- AddFileToDownloadsTable("materials/skybox/zombiehelldn.vmt");
- AddFileToDownloadsTable("materials/skybox/zombiehelldn.vtf");
- AddFileToDownloadsTable("materials/skybox/zombiehellft.vmt");
- AddFileToDownloadsTable("materials/skybox/zombiehellft.vtf");
- AddFileToDownloadsTable("materials/skybox/zombiehelllf.vmt");
- AddFileToDownloadsTable("materials/skybox/zombiehelllf.vtf");
- AddFileToDownloadsTable("materials/skybox/zombiehellrt.vmt");
- AddFileToDownloadsTable("materials/skybox/zombiehellrt.vtf");
- AddFileToDownloadsTable("materials/skybox/zombiehellup.vmt");
- AddFileToDownloadsTable("materials/skybox/zombiehellup.vtf");
- //Health Kit
- AddFolderToDownloadsTable("models/weapons", "V_healthkit");
- //predator
- AddFolderToDownloadsTable("models/player/techknow/predator_v2");
- AddFolderToDownloadsTable("materials/models/player/techknow/predator");
- //ichigo
- AddFolderToDownloadsTable("models/player/hhp227/mitch");
- AddFolderToDownloadsTable("materials/models/player/hhp227/ichigo");
- //sepiroth
- AddFolderToDownloadsTable("models/mapeadores/kaem/sephiroth3");
- AddFolderToDownloadsTable("materials/mapeadores/kaem/sephiroth3");
- CrowbarModel = PrecacheModel("models/weapons/v_crowbar.mdl", true);
- CrowbarModelW = PrecacheModel("models/weapons/w_crowbar.mdl", true);
- DaggerModel = PrecacheModel("models/weapons/v_dragn_t.mdl", true);
- DaggerModelW = PrecacheModel("models/weapons/w_dragn_t.mdl", true);
- GoldenGunModel = PrecacheModel("models/weapons/v_g_deagle.mdl", true);
- GoldenGunModelW = PrecacheModel("models/weapons/w_g_deagle.mdl", true);
- StunStickModel = PrecacheModel("models/Weapons/v_stunbaton.mdl", true);
- StunStickModelW = PrecacheModel("models/Weapons/W_stunbaton.mdl", true);
- IgnitionGunModel = PrecacheModel("models/weapons/v_pist_casull.mdl", true);
- IgnitionGunModelW = PrecacheModel("models/weapons/w_pist_casull.mdl", true);
- RPGModel = PrecacheModel("models/weapons/v_rpg.mdl", true);
- RPGModelW = PrecacheModel("models/weapons/w_rocket_launcher.mdl", true);
- TVirusModel = PrecacheModel("models/weapons/v_kannoe99.mdl", true);
- TVirusModelW = PrecacheModel("models/weapons/w_alyx_gun.mdl", true);
- TeleporterModel = PrecacheModel("models/weapons/v_buddyfinder.mdl", true);
- TeleporterModelW = PrecacheModel("models/weapons/w_camphone.mdl", true);
- CrossbowModel = PrecacheModel("models/aoc_weapon/v_crossbow.mdl", true);
- CrossbowModelW = PrecacheModel("models/aoc_weapon/w_crossbow.mdl", true);
- JihadModel = PrecacheModel("models/weapons/v_jb.mdl", true);
- JihadModelW = PrecacheModel("models/weapons/w_jb.mdl", true);
- HealthStationModel = PrecacheModel("models/weapons/v_healthkit.mdl", true);
- SilencedSniperRifleModel = PrecacheModel("models/weapons/v_snip_sg550.mdl", true);
- SilencedSniperRifleModelW = PrecacheModel("models/weapons/w_snip_sg550.mdl", true);
- PrecacheModel("models/weapons/w_missile_launch.mdl", true);
- PrecacheModel("models/aoc_weapon/aoc_arrow.mdl", true);
- PrecacheModel("models/blackout.mdl", true);
- PrecacheModel("models/zombie/Poison.mdl", true);
- PrecacheModel("models/Characters/Hostage_01.mdl", true);
- PrecacheModel("models/Characters/Hostage_02.mdl", true);
- PrecacheModel("models/Characters/Hostage_03.mdl", true);
- PrecacheModel("models/Characters/Hostage_04.mdl", true);
- PrecacheModel("models/props/cs_italy/orange.mdl", true);
- PrecacheSound("weapons/m4a1/m4a1-1.wav", true);
- PrecacheSound("npc/zombie/zombie_die1.wav", true);
- PrecacheSound("npc/zombie/claw_strike1.wav", true);
- PrecacheSound("npc/zombie/foot1.wav", true);
- PrecacheSound("npc/zombie/foot2.wav", true);
- PrecacheSound("npc/zombie/foot3.wav", true);
- PrecacheSound("weapons/crossbow/fire1.wav", true);
- PrecacheSound("weapons/crossbow/bolt_fly4.wav", true);
- PrecacheSound("weapons/crossbow/hit1.wav", true);
- PrecacheSound("weapons/crossbow/hitbod1.wav", true);
- PrecacheSound("weapons/crossbow/bolt_load1.wav", true);
- PrecacheSound("items/smallmedkit1.wav", true);
- PrecacheSound("ambient/levels/labs/coinslot1.wav", true);
- PrecacheSound("weapons/iceaxe/iceaxe_swing1.wav", true);
- PrecacheSound("weapons/flaregun/fire.wav", true);
- decl String:sound[37];
- for(new i = 1; i <= 14; i++)
- {
- Format(sound, 37, "npc/zombie/zombie_voice_idle%i.wav", i);
- PrecacheSound(sound);
- }
- for(new i = 1; i <= 6; i++)
- {
- Format(sound, 37, "npc/zombie/zombie_pain%i.wav", i);
- PrecacheSound(sound);
- }
- GravityGunMapStart();
- new String:CurrentMap[256], String:buffer[256], String:classname[32], Float:spawnposition[3], Float:Angle[3];
- GetCurrentMap(CurrentMap, 256);
- if(StrEqual(CurrentMap, "de_dust") || StrEqual(CurrentMap, "de_dust2"))
- {
- SetLightStyle(0, "c");
- DispatchKeyValue(0, "skyname", "zombiehell");
- }
- if(StrEqual(CurrentMap, "de_dust2_night_fix"))
- {
- SetLightStyle(0, "x");
- }
- new Handle:kv = CreateKeyValues("TTTSpawns");
- FileToKeyValues(kv, Path2);
- KvGotoFirstSubKey(kv);
- do
- {
- KvGetSectionName(kv, buffer, sizeof(buffer));
- if(StrEqual(buffer, CurrentMap, false))
- {
- KvJumpToKey(kv, CurrentMap, false);
- KvGotoFirstSubKey(kv);
- do
- {
- KvGetSectionName(kv, buffer, sizeof(buffer));
- KvGetString(kv, "info", classname, 256, "NULL");
- KvGetVector(kv, "position", spawnposition);
- if(!StrEqual(classname, "NULL", false))
- {
- new spawnpoint = CreateEntityByName(classname);
- DispatchSpawn(spawnpoint);
- TeleportEntity(spawnpoint, spawnposition, Angle, NULL_VECTOR);
- }
- }while(KvGotoNextKey(kv));
- break;
- }
- }while(KvGotoNextKey(kv));
- KvRewind(kv);
- CloseHandle(kv);
- HookEntityOutput("trigger_multiple", "OnStartTouch", StartTouch);
- HookEntityOutput("trigger_multiple", "OnEndTouch", EndTouch);
- }
- public StartTouch(const String:output[], caller, activator, Float:delay)
- {
- new String:CurrentMap[256];
- GetCurrentMap(CurrentMap, 256);
- decl String:entityName[32];
- GetEntPropString(caller, Prop_Data, "m_iName", entityName, sizeof(entityName));
- if(StrEqual(CurrentMap, "ttt_minecraft_b4", false))
- {
- new Float:pos[3];
- GetEntPropVector(caller, Prop_Send, "m_vecOrigin", pos);
- if(RoundToNearest(pos[0]) == -952 && RoundToNearest(pos[1]) == -270 && RoundToNearest(pos[2]) == 72)
- {
- if(Job[activator] != traitor)
- {
- makeDamage(activator, activator, 999, (1<<17), 1.0, pos, "");
- }
- }
- if(StrEqual(entityName, "Furnace_Trigger"))
- {
- DiaCount++;
- if(MaxDiaCount != DiaCount) PrintChatAll("\x04[Furnace]\x07FFFFFFYou have placed %i In the furnace You need %i more.", DiaCount, MaxDiaCount-DiaCount);
- if(MaxDiaCount == DiaCount) PrintChatAll("\x04[Furnace]\x07FFFFFFDiamond is made");
- }
- if(RoundToNearest(pos[0]) == -1808 && RoundToNearest(pos[1]) == 592 && RoundToNearest(pos[2]) == 738)
- {
- roundstart = false;
- CS_TerminateRound(10.0, CSRoundEnd_TargetSaved);
- }
- }
- if(StrContains(entityName, "ladder") != -1) {
- // Occasionally I get 2 StartTouchTrigger events before an EndTouchTrigger when
- // 2 ladders are placed close together. The onLadder accumulator works around this.
- //LogMessage("Client %i: StartTouch %i", activator, onLadder[activator]);
- MountLadder(activator);
- }
- }
- public EndTouch(const String:output[], caller, activator, Float:delay)
- {
- decl String:entityName[32];
- GetEntPropString(caller, Prop_Data, "m_iName", entityName, sizeof(entityName));
- if(StrContains(entityName, "ladder") != -1) {
- // Occasionally I get 2 StartTouchTrigger events before an EndTouchTrigger when
- // 2 ladders are placed close together. The onLadder accumulator works around this.
- //LogMessage("Client %i: EndTouch %i", activator, onLadder[activator]);
- DismountLadder(activator);
- }
- }
- public Action:Check(Handle:timer)
- {
- if(roundstart)
- {
- if(Time1 >= 1)
- {
- Time1 -= 1;
- }
- if(Time1 == 1)
- {
- if(chosen)
- {
- for(new i = 1; i <= MaxClients; i++)
- {
- if(IsClientInGame(i) && IsPlayerAlive(i))
- {
- if(!ReceiveCredit)
- {
- Credit[i] += 1;
- PrintChat(i, "\x05You survived for a long time ,so you got 1 credit.");
- }
- }
- }
- ReceiveCredit = true;
- }
- }
- if(Time2 >= 1)
- {
- Time2 -= 1;
- }
- else
- {
- for(new i=1; i<=MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- PrintCenterText(i, "%T", "Innocent Win", i);
- }
- }
- roundstart = false;
- CS_TerminateRound(10.0, CSRoundEnd_TargetSaved);
- }
- }
- }
- public Action:Check_RoundEnd(Handle:timer)
- {
- if(roundstart && chosen)
- {
- for(new i; i<4; i++)
- {
- AliveJobCount[i] = 0;
- }
- for(new Client = 1; Client <= MaxClients; Client++)
- {
- if(IsClientInGame(Client))
- {
- if(IsPlayerAlive(Client) && Client != Bot)
- {
- AliveJobCount[Job[Client]] += 1;
- }
- }
- }
- if(AliveJobCount[detector] + AliveJobCount[innocent] <= 0 && AliveJobCount[traitor] <= 0)
- {
- if(JoinCheck(LastAttacker))
- {
- if(Job[LastAttacker] == traitor)
- {
- for(new i=1; i<=MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- PrintCenterText(i, "%T", "Traitor Win", i);
- }
- }
- CS_TerminateRound(10.0, CSRoundEnd_TargetBombed);
- }
- else
- {
- for(new i=1; i<=MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- PrintCenterText(i, "%T", "Innocent Win", i);
- }
- }
- CS_TerminateRound(10.0, CSRoundEnd_TargetSaved);
- }
- roundstart = false;
- }
- }
- else if(AliveJobCount[detector] + AliveJobCount[innocent] <= 0)
- {
- for(new i=1; i<=MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- PrintCenterText(i, "%T", "Traitor Win", i);
- }
- }
- roundstart = false;
- CS_TerminateRound(10.0, CSRoundEnd_TargetBombed);
- }
- else if(AliveJobCount[traitor] <= 0)
- {
- for(new i=1; i<=MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- PrintCenterText(i, "%T", "Innocent Win", i);
- }
- }
- roundstart = false;
- CS_TerminateRound(10.0, CSRoundEnd_TargetSaved);
- }
- }
- }
- public OnClientPutInServer(Client)
- {
- for(new i = 1; i < MaxType+1; i++)
- {
- ItemID[Client][i] = 0;
- ItemExist[Client][i] = false;
- ItemOn[Client][i] = false;
- }
- for(new i=1; i<MAX_ITEMS; i++)
- {
- RestrictItem[Client][i] = false;
- }
- LastEngineTime[Client] = GetEngineTime();
- PlayingTime[Client] = 0.0;
- Point[Client] = 0;
- FunCommand[Client] = 0;
- VIP[Client] = 0;
- TagColor[Client] = 0;
- ChatDelay[Client] = false;
- LastHitLog[Client] = "";
- LastAttackLog[Client] = "";
- DataLoaded[Client][0] = false;
- DataLoaded[Client][1] = false;
- DataLoaded[Client][2] = false;
- Fun2[Client] = false;
- PointDelay[Client] = GetEngineTime();
- ResetData_Player(Client);
- if(!IsFakeClient(Client))
- {
- CreateTimer(10.0, PlusPlayingTime, Client, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
- new String:query[512], String:SteamID[256];
- GetClientAuthString(Client, SteamID, 256);
- if(!StrEqual(SteamID, ""))
- {
- Format(query, 512, "SELECT * FROM info WHERE steamid = '%s';", SteamID);
- SQL_TQuery(databasehandle, info_check, query, Client);
- Format(query, 512, "SELECT * FROM vip WHERE steamid = '%s';", SteamID);
- SQL_TQuery(databasehandle, vip_check, query, Client);
- Format(query, 512, "SELECT * FROM skin WHERE steamid = '%s';", SteamID);
- SQL_TQuery(databasehandle, skin_check, query, Client);
- Format(query, 512, "SELECT * FROM vmskin WHERE steamid = '%s';", SteamID);
- SQL_TQuery(databasehandle, vmskin_check, query, Client);
- Format(query, 512, "SELECT * FROM restrictitem WHERE steamid = '%s';", SteamID);
- SQL_TQuery(databasehandle, restrict_check, query, Client);
- SDKHook(Client, SDKHook_OnTakeDamage, OnTakeDamageHook);
- SDKHook(Client, SDKHook_PostThinkPost, OnPostThinkPost);
- SDKHook(Client, SDKHook_PostThink, OnPostThink);
- SDKHook(Client, SDKHook_WeaponDrop, WeaponDrop);
- SDKHook(Client, SDKHook_WeaponCanUse, WeaponCanUse);
- SDKHook(Client, SDKHook_TraceAttack, OnTraceAttack);
- SDKHook(Client, SDKHook_SetTransmit, Hook_SetTransmit4);
- SDKHook(Client, SDKHook_WeaponEquip, Hook_OnWeaponEquip);
- CreateTimer(0.2, Check_Player, Client, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
- CreateTimer(0.1, Recognize_Player ,Client, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
- CreateTimer(1.0, Recognize_Player2 ,Client, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
- CreateTimer(0.1, RadarPlayer, Client, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
- GravityGunPutInServer(Client);
- }
- else
- {
- PrintChat(Client, "\x04ë°ì´í„° 로드 실패. 10초후 ë°ì´í„°ë¡œë“œë¥¼ 재시ë„합니다.");
- CreateTimer(10.0, putinserver, Client);
- }
- }
- else if(Client == 1)
- {
- Point[Client] = 7777777;
- PlayingTime[Client] = 1601084.0;
- }
- }
- public Action:putinserver(Handle:timer, any:Client)
- {
- if(JoinCheck(Client))
- OnClientPutInServer(Client);
- }
- public Action:WeaponDrop(Client, weapons)
- {
- if(IsValidEntity(weapons) && IsValidEdict(weapons))
- {
- new String:classname[256];
- GetEdictClassname(weapons, classname, 256);
- if(StrEqual(classname, "weapon_c4", false))
- {
- return Plugin_Handled;
- }
- if(StrEqual(classname, "weapon_smokegrenade", false) && IsJihad[Client])
- {
- return Plugin_Handled;
- }
- CreateTimer(0.0, AcceptWeaponUse, Client);
- BlockWeaponUse[Client] = true;
- }
- return Plugin_Continue;
- }
- public Action:WeaponCanUse(Client, weapons)
- {
- static Float:Differ[MAXPLAYERS+1];
- if(IsValidEntity(weapons) && IsValidEdict(weapons))
- {
- new String:classname[32];
- GetEdictClassname(weapons, classname, 32);
- 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))
- {
- new buttons = GetClientButtons(Client);
- if(!(buttons & IN_USE) && GetPlayerWeaponSlot(Client, 0) == -1 && !BuyAcceptWeapon[Client])
- {
- new firstcolor[4] = {255, ...};
- firstcolor[1] = 0;
- firstcolor[2] = 0;
- HudMsg(Client, 5, -1.0, 0.4, firstcolor, firstcolor, 1, 0.0, 0.0, 0.5, 0.0, "Press E to pick up weapon.");
- if(FloatSub(GetEngineTime(), Differ[Client]) > 0.02)
- {
- PrintHintText(Client, "Press E to pick up weapon.");
- Differ[Client] = GetEngineTime();
- }
- return Plugin_Handled;
- }
- else if(GetPlayerWeaponSlot(Client, 0) == -1)
- {
- BlockWeaponUse[Client] = true;
- CreateTimer(0.0, AcceptWeaponUse, Client);
- }
- }
- BuyAcceptWeapon[Client] = false;
- }
- return Plugin_Continue;
- }
- public Action:AcceptWeaponUse(Handle:timer, any:Client)
- {
- if(JoinCheck(Client))
- {
- BlockWeaponUse[Client] = false;
- }
- }
- public OnPostThink(client)
- {
- if(JoinCheck(GetClientAimTarget(client)) && IsPlayerAlive(GetClientAimTarget(client)) && !IsDisguise[GetClientAimTarget(client)])
- {
- decl Float:pos[3], Float:angle[3];
- GetClientEyePosition(client, pos);
- GetClientEyeAngles(client, angle);
- new Handle:traceresulthandle = INVALID_HANDLE;
- 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"));
- else traceresulthandle = TR_TraceRayFilterEx(pos, angle, MASK_SOLID, RayType_Infinite, tracerayfilterdefault, client);
- new Float:resultposition[3];
- if(TR_DidHit(traceresulthandle) == true)
- {
- TR_GetEndPosition(resultposition, traceresulthandle);
- new Float:vecmin[3] = {-4.0, -4.0, -8.0}, Float:vecmax[3] = {4.0, 4.0, 0.0};
- new Handle:traceresulthandle2 = INVALID_HANDLE;
- 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"));
- else traceresulthandle2 = TR_TraceHullFilterEx(pos, resultposition, vecmin, vecmax, MASK_PLAYERSOLID, tracerayfilterdefault, client);
- MenuLastMan[client] = TR_GetEntityIndex(traceresulthandle);
- if(!TR_GetEntityIndex(traceresulthandle)) MenuLastMan[client] = TR_GetEntityIndex(traceresulthandle2);
- CloseHandle(traceresulthandle2);
- }
- CloseHandle(traceresulthandle);
- }
- if(IsInfect[client])
- {
- if(IsPlayerAlive(client))
- {
- new Handle:kv = CreateKeyValues("data"), String:Translate_Formatting[256];
- Format(Translate_Formatting, 256, "%T", "progress zombie", client);
- KvSetString(kv, "msg", Translate_Formatting);
- KvSetNum(kv, "total", 500);
- KvSetNum(kv, "current", RoundToZero(FloatSub(GetEngineTime(), LastFadeTime[client])*100));
- ShowVGUIPanel(client, "nav_progress", kv, true);
- CloseHandle(kv);
- }
- else
- {
- IsInfect[client] = false;
- ShowVGUIPanel(client, "nav_progress", INVALID_HANDLE, false);
- }
- }
- new buttons = GetClientButtons(client);
- if(buttons & IN_ATTACK)
- {
- new WeaponIndex = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");
- if(WeaponIndex <= 0) return;
- if(GetGameTime() < GetEntPropFloat(WeaponIndex, Prop_Send, "m_flNextPrimaryAttack")) return;
- if(GetGameTime() < GetEntPropFloat(client, Prop_Send, "m_flNextAttack")) return;
- if(WeaponIndex == GetPlayerWeaponSlot(client, 1) && GetEntProp(client, Prop_Send, "m_iShotsFired")) return;
- if(RPG[WeaponIndex]) return;
- Process[client] = 0;
- }
- if(buttons & IN_ATTACK2)
- {
- new WeaponIndex = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");
- if(WeaponIndex <= 0) return;
- if(GetGameTime() < GetEntPropFloat(WeaponIndex, Prop_Send, "m_flNextPrimaryAttack")) return;
- if(GetGameTime() < GetEntPropFloat(client, Prop_Send, "m_flNextAttack")) return;
- if(WeaponIndex == GetPlayerWeaponSlot(client, 4) && GetEntProp(client, Prop_Send, "m_iShotsFired")) return;
- SetEntProp(ClientVM[client][1], Prop_Send, "m_nSequence", 0);
- Process[client] = 0;
- }
- }
- public OnPostThinkPost(client)
- {
- static Float:Differ[MAXPLAYERS+1];
- if(FloatSub(GetEngineTime(), Differ[client]) > 0.5)
- {
- if(IsPlayerAlive(client))
- {
- SetEntProp(client, Prop_Data, "m_iFrags", 1);
- for(new i=1; i<=MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- if(Job[client] == traitor)
- {
- if(!IsPlayerAlive(i) && Ragdoll[i] > 0 && !CheckedBody[Ragdoll[i]])
- SetEntProp(client, Prop_Send, "m_bPlayerDominated", true, _, i);
- else
- SetEntProp(client, Prop_Send, "m_bPlayerDominated", false, _, i);
- if(Job[i] == traitor)
- SetEntProp(client, Prop_Send, "m_bPlayerDominatingMe", true, _, i);
- else
- SetEntProp(client, Prop_Send, "m_bPlayerDominatingMe", false, _, i);
- }
- else
- {
- SetEntProp(client, Prop_Send, "m_bPlayerDominated", false, _, i);
- SetEntProp(client, Prop_Send, "m_bPlayerDominatingMe", false, _, i);
- }
- }
- }
- }
- else
- {
- if((Ragdoll[client] > 0 && CheckedBody[Ragdoll[client]]))
- SetEntProp(client, Prop_Data, "m_iFrags", 0);
- else if(!Ragdoll[client])
- SetEntProp(client, Prop_Data, "m_iFrags", -1);
- else
- SetEntProp(client, Prop_Data, "m_iFrags", 1);
- for(new i=1; i<=MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- if(!IsPlayerAlive(i) && Ragdoll[i] > 0 && !CheckedBody[Ragdoll[i]])
- SetEntProp(client, Prop_Send, "m_bPlayerDominated", true, _, i);
- else
- SetEntProp(client, Prop_Send, "m_bPlayerDominated", false, _, i);
- if(Job[i] == traitor)
- SetEntProp(client, Prop_Send, "m_bPlayerDominatingMe", true, _, i);
- else
- SetEntProp(client, Prop_Send, "m_bPlayerDominatingMe", false, _, i);
- }
- }
- }
- SetEntProp(client, Prop_Data, "m_iDeaths", 0);
- }
- if(FloatSub(GetEngineTime(), PointDelay[client]) > GetPoint_Duration)
- {
- if(GetClientTeam(client) > 1)
- {
- Point[client] += GetPoint_Value;
- SavePoint(client);
- PrintToChat(client, "\x04You gained %ipoints for playing in the server!\n[ %imin = %i point ]", GetPoint_Value, RoundToNearest(GetPoint_Duration/60.0), GetPoint_Value);
- }
- PointDelay[client] = GetEngineTime();
- }
- SetEntProp(client, Prop_Send, "m_iAddonBits", 0);
- SetEntProp(client, Prop_Send, "m_iPrimaryAddon", 0);
- SetEntProp(client, Prop_Send, "m_iSecondaryAddon", 0);
- SetEntPropString(client, Prop_Send, "m_szLastPlaceName", NULL_STRING);
- static OldWeapon[MAXPLAYERS + 1];
- static OldSequence[MAXPLAYERS + 1];
- static Float:OldCycle[MAXPLAYERS + 1];
- if(JoinCheck(GetClientAimTarget(client)) && IsPlayerAlive(GetClientAimTarget(client)) && !IsDisguise[GetClientAimTarget(client)]) MenuLastMan[client] = GetClientAimTarget(client);
- if(IsValidEdict(ClientVM[client][1]) && IsValidEdict(ClientVM[client][0]))
- {
- decl String:ClassName[30];
- new WeaponIndex;
- //handle spectators
- if (!IsPlayerAlive(client))
- {
- new spec = GetEntPropEnt(client, Prop_Send, "m_hObserverTarget");
- if (spec > 0)
- {
- WeaponIndex = GetEntPropEnt(spec, Prop_Send, "m_hActiveWeapon");
- if(IsValidEdict(WeaponIndex))
- {
- GetEdictClassname(WeaponIndex, ClassName, sizeof(ClassName));
- if (StrEqual("weapon_knife", ClassName, false))
- {
- if(Dagger[spec])
- {
- SetEntProp(ClientVM[spec][1], Prop_Send, "m_nModelIndex", DaggerModel);
- SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", DaggerModelW);
- }
- else
- {
- if(ItemOn[spec][VMSkinType] && ItemID[spec][VMSkinType])
- {
- new Model = PrecacheModel(ItemPath[ItemID[spec][VMSkinType]], true);
- SetEntProp(ClientVM[spec][1], Prop_Send, "m_nModelIndex", Model);
- }
- else
- {
- SetEntProp(ClientVM[spec][1], Prop_Send, "m_nModelIndex", CrowbarModel);
- }
- SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", CrowbarModelW);
- }
- }
- else if(StrEqual("weapon_deagle", ClassName, false))
- {
- if(GoldenGun[WeaponIndex])
- {
- SetEntProp(ClientVM[spec][1], Prop_Send, "m_nModelIndex", GoldenGunModel);
- SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", GoldenGunModelW);
- }
- }
- else if(StrEqual("weapon_c4", ClassName, false))
- {
- SetEntProp(ClientVM[spec][1], Prop_Send, "m_nModelIndex", StunStickModel);
- SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", StunStickModelW);
- }
- else if(StrEqual("weapon_p228", ClassName, false))
- {
- SetEntProp(ClientVM[spec][1], Prop_Send, "m_nModelIndex", IgnitionGunModel);
- SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", IgnitionGunModelW);
- }
- else if(StrEqual("weapon_awp", ClassName, false))
- {
- if(RPG[WeaponIndex])
- {
- SetEntProp(ClientVM[spec][1], Prop_Send, "m_nModelIndex", RPGModel);
- SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", RPGModelW);
- }
- if(Silenced_Sniper_Rifle[WeaponIndex])
- {
- SetEntProp(ClientVM[spec][1], Prop_Send, "m_nModelIndex", SilencedSniperRifleModel);
- SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", SilencedSniperRifleModelW);
- }
- }
- else if(StrEqual("weapon_aug", ClassName, false))
- {
- if(Crossbow[WeaponIndex])
- {
- SetEntProp(ClientVM[spec][1], Prop_Send, "m_nModelIndex", CrossbowModel);
- SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", CrossbowModelW);
- }
- }
- else if(StrEqual("weapon_tmp", ClassName, false))
- {
- if(TVirus[WeaponIndex])
- {
- SetEntProp(ClientVM[spec][1], Prop_Send, "m_nModelIndex", TVirusModel);
- SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", TVirusModelW);
- }
- }
- else if(StrEqual("weapon_hegrenade", ClassName, false))
- {
- if(Teleporter[WeaponIndex])
- {
- SetEntProp(ClientVM[spec][1], Prop_Send, "m_nModelIndex", TeleporterModel);
- SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", TeleporterModelW);
- }
- }
- else if(StrEqual("weapon_smokegrenade", ClassName, false))
- {
- if(Jihad[WeaponIndex])
- {
- SetEntProp(ClientVM[spec][1], Prop_Send, "m_nModelIndex", JihadModel);
- SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", JihadModelW);
- SetEntPropFloat(WeaponIndex, Prop_Send, "m_flModelScale", 2.0);
- }
- }
- else if(StrEqual("weapon_flashbang", ClassName, false))
- {
- if(HealthStation[WeaponIndex])
- {
- SetEntProp(ClientVM[spec][1], Prop_Send, "m_nModelIndex", HealthStationModel);
- }
- }
- }
- }
- }
- WeaponIndex = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");
- new Sequence = GetEntProp(ClientVM[client][0], Prop_Send, "m_nSequence");
- new Float:Cycle = GetEntPropFloat(ClientVM[client][0], Prop_Data, "m_flCycle");
- if (WeaponIndex <= 0)
- {
- new EntEffects = GetEntProp(ClientVM[client][1], Prop_Send, "m_fEffects");
- EntEffects |= EF_NODRAW;
- SetEntProp(ClientVM[client][1], Prop_Send, "m_fEffects", EntEffects);
- IsCustom[client] = false;
- OldWeapon[client] = WeaponIndex;
- OldSequence[client] = Sequence;
- OldCycle[client] = Cycle;
- return;
- }
- if(IsValidEdict(WeaponIndex)) GetEdictClassname(WeaponIndex, ClassName, sizeof(ClassName));
- //just stuck the weapon switching in here aswell instead of a separate hook
- if (WeaponIndex != OldWeapon[client])
- {
- new EntEffects = GetEntProp(ClientVM[client][1], Prop_Send, "m_fEffects");
- EntEffects |= EF_NODRAW;
- SetEntProp(ClientVM[client][1], Prop_Send, "m_fEffects", EntEffects);
- if (StrEqual("weapon_knife", ClassName, false))
- {
- if(Dagger[client])
- {
- Weapon_SetViewModelIndex(client, DaggerModel);
- SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", DaggerModelW);
- }
- else
- {
- if(ItemOn[client][VMSkinType] && ItemID[client][VMSkinType])
- {
- new Model = PrecacheModel(ItemPath[ItemID[client][VMSkinType]], true);
- Weapon_SetViewModelIndex(client, Model);
- }
- else
- {
- Weapon_SetViewModelIndex(client, CrowbarModel);
- }
- SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", CrowbarModelW);
- }
- }
- else if(StrEqual("weapon_deagle", ClassName, false))
- {
- if(GoldenGun[WeaponIndex])
- {
- Weapon_SetViewModelIndex(client, GoldenGunModel);
- SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", GoldenGunModelW);
- }
- }
- else if(StrEqual("weapon_c4", ClassName, false))
- {
- Weapon_SetViewModelIndex(client, StunStickModel);
- SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", StunStickModelW);
- }
- else if(StrEqual("weapon_p228", ClassName, false))
- {
- Weapon_SetViewModelIndex(client, IgnitionGunModel);
- SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", IgnitionGunModelW);
- }
- else if(StrEqual("weapon_awp", ClassName, false))
- {
- if(RPG[WeaponIndex])
- {
- Weapon_SetViewModelIndex(client, RPGModel);
- SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", RPGModelW);
- }
- if(Silenced_Sniper_Rifle[WeaponIndex])
- {
- Weapon_SetViewModelIndex(client, SilencedSniperRifleModel);
- SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", SilencedSniperRifleModelW);
- }
- }
- else if(StrEqual("weapon_aug", ClassName, false))
- {
- if(Crossbow[WeaponIndex])
- {
- Weapon_SetViewModelIndex(client, CrossbowModel);
- SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", CrossbowModelW);
- }
- }
- else if(StrEqual("weapon_tmp", ClassName, false))
- {
- if(TVirus[WeaponIndex])
- {
- Weapon_SetViewModelIndex(client, TVirusModel);
- SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", TVirusModelW);
- }
- }
- else if(StrEqual("weapon_hegrenade", ClassName, false))
- {
- if(Teleporter[WeaponIndex])
- {
- Weapon_SetViewModelIndex(client, TeleporterModel);
- SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", TeleporterModelW);
- }
- }
- else if(StrEqual("weapon_smokegrenade", ClassName, false))
- {
- if(Jihad[WeaponIndex])
- {
- Weapon_SetViewModelIndex(client, JihadModel);
- SetEntProp(WeaponIndex, Prop_Send, "m_iWorldModelIndex", JihadModelW);
- SetEntPropFloat(WeaponIndex, Prop_Send, "m_flModelScale", 2.0);
- }
- }
- else if(StrEqual("weapon_flashbang", ClassName, false))
- {
- if(HealthStation[WeaponIndex])
- {
- Weapon_SetViewModelIndex(client, HealthStationModel);
- }
- }
- else
- {
- IsCustom[client] = false;
- }
- }
- else
- {
- //copy the animation stuff from the viewmodel to the used one every frame
- if(IsValidEdict(ClientVM[client][1]) && !(StrEqual(ClassName, "weapon_awp", false) && RPG[WeaponIndex]) && !(StrEqual(ClassName, "weapon_aug", false) && Crossbow[WeaponIndex]))
- {
- if(GetEntPropEnt(client, Prop_Data, "m_hActiveWeapon") == GetPlayerWeaponSlot(client, 2))
- {
- if(ItemID[client][VMSkinType] == 59 && (Sequence == 5 || Sequence == 4)) SetEntProp(ClientVM[client][1], Prop_Send, "m_nSequence", 2);
- else if(ItemID[client][VMSkinType] == 59 && Sequence == 3) SetEntProp(ClientVM[client][1], Prop_Send, "m_nSequence", 1);
- else if(ItemID[client][VMSkinType] == 59 && Sequence == 1) SetEntProp(ClientVM[client][1], Prop_Send, "m_nSequence", 3);
- else SetEntProp(ClientVM[client][1], Prop_Send, "m_nSequence", GetEntProp(ClientVM[client][0], Prop_Send, "m_nSequence"));
- }
- else SetEntProp(ClientVM[client][1], Prop_Send, "m_nSequence", GetEntProp(ClientVM[client][0], Prop_Send, "m_nSequence"));
- Sequence = GetEntProp(ClientVM[client][1], Prop_Send, "m_nSequence");
- SetEntPropFloat(ClientVM[client][1], Prop_Send, "m_flPlaybackRate", GetEntPropFloat(ClientVM[client][0], Prop_Send, "m_flPlaybackRate"));
- static Data[MAXPLAYERS+1];
- if(GetEntPropEnt(client, Prop_Data, "m_hActiveWeapon") == GetPlayerWeaponSlot(client, 2))
- {
- if((Cycle < OldCycle[client]) && Sequence == OldSequence[client])
- {
- SetEntProp(ClientVM[client][1], Prop_Send, "m_nSequence", 0);
- Data[client] = 4;
- }
- if(Data[client])
- {
- Data[client] -= 1;
- SetEntProp(ClientVM[client][1], Prop_Send, "m_nSequence", 0);
- }
- }
- else
- {
- if(Data[client]) Data[client] = 0;
- if(Cycle < OldCycle[client] && Sequence == OldSequence[client])
- {
- SetEntProp(ClientVM[client][1], Prop_Send, "m_nSequence", 0);
- }
- }
- }
- }
- //hide viewmodel a frame after spawning
- if (SpawnCheck[client])
- {
- SpawnCheck[client] = false;
- if(IsCustom[client])
- {
- new EntEffects = GetEntProp(ClientVM[client][0], Prop_Send, "m_fEffects");
- EntEffects |= EF_NODRAW;
- SetEntProp(ClientVM[client][0], Prop_Send, "m_fEffects", EntEffects);
- }
- }
- OldWeapon[client] = WeaponIndex;
- OldSequence[client] = Sequence;
- OldCycle[client] = Cycle;
- }
- new buttons = GetClientButtons(client);
- if(buttons & IN_ATTACK)
- {
- new String:classname[256];
- GetEdictClassname(GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon"), classname, 256);
- if(!Process[client])
- {
- for(new i; i< MAX_WEAPON; i++)
- {
- if(StrEqual(classname, WeaponDelay[i][0], false))
- {
- if(!StrEqual(classname, "weapon_c4", false))
- {
- if(!VIP[client]) SetEntProp(client, Prop_Send, "m_iShotsFired", 1);
- else SetEntProp(client, Prop_Send, "m_iShotsFired", 0);
- new Float:Delay = StringToFloat(WeaponDelay[i][1]);
- SetEntDataFloat(GetEntPropEnt(client, Prop_Data, "m_hActiveWeapon"), g_NextPrimaryAttack, FloatAdd(GetGameTime(), Delay), true);
- }
- }
- }
- Process[client] = 1;
- }
- }
- new String:classname[256], WeaponIndex = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");
- if(WeaponIndex > 0 && IsValidEdict(WeaponIndex)) GetEdictClassname(WeaponIndex, classname, 256);
- if(buttons & IN_ATTACK2)
- {
- if(!Process[client])
- {
- for(new i; i< MAX_WEAPON; i++)
- {
- if(StrEqual(classname, WeaponDelay[i][0], false))
- {
- if(StrEqual(classname, "weapon_c4", false))
- {
- SetEntProp(client, Prop_Send, "m_iShotsFired", 1);
- new Float:Delay = StringToFloat(WeaponDelay[i][1]);
- SetEntDataFloat(GetEntPropEnt(client, Prop_Data, "m_hActiveWeapon"), g_NextPrimaryAttack, FloatAdd(GetGameTime(), Delay), true);
- }
- }
- }
- }
- }
- if(StrEqual(classname, "weapon_c4"))
- {
- if(ReloadCount[client] > 0)
- {
- SetEntProp(ClientVM[client][1], Prop_Send, "m_nSequence", 2);
- ReloadCount[client] -= 1;
- }
- }
- }
- public WeaponWorldModelThink(weapon)
- {
- decl String:name[64];
- GetEdictClassname(weapon, name, sizeof(name));
- if(StrEqual(name, "weapon_deagle") && GoldenGun[weapon])
- {
- SetEntProp(weapon, Prop_Send, "m_iWorldModelIndex", GoldenGunModelW);
- }
- else if(StrEqual(name, "weapon_awp") && RPG[weapon])
- {
- SetEntProp(weapon, Prop_Send, "m_iWorldModelIndex", RPGModelW);
- }
- else if(StrEqual(name, "weapon_awp") && Silenced_Sniper_Rifle[weapon])
- {
- SetEntProp(weapon, Prop_Send, "m_iWorldModelIndex", SilencedSniperRifleModelW);
- }
- else if(StrEqual(name, "weapon_aug") && Crossbow[weapon])
- {
- SetEntProp(weapon, Prop_Send, "m_iWorldModelIndex", CrossbowModelW);
- }
- else if(StrEqual(name, "weapon_p228"))
- {
- SetEntProp(weapon, Prop_Send, "m_iWorldModelIndex", IgnitionGunModelW);
- }
- else if(StrEqual(name, "weapon_tmp") && TVirus[weapon])
- {
- SetEntProp(weapon, Prop_Send, "m_iWorldModelIndex", TVirusModelW);
- }
- else if(StrEqual(name, "weapon_hegrenade") && Teleporter[weapon])
- {
- SetEntProp(weapon, Prop_Send, "m_iWorldModelIndex", TeleporterModelW);
- }
- else if(StrEqual(name, "weapon_smokegrenade") && Jihad[weapon])
- {
- SetEntProp(weapon, Prop_Send, "m_iWorldModelIndex", JihadModelW);
- SetEntPropFloat(weapon, Prop_Send, "m_flModelScale", 2.0);
- }
- }
- public Action:Check_Player(Handle:timer, any:Client)
- {
- if(JoinCheck(Client))
- {
- new Target = GetPlayerStuckEnt(Client);
- if(JoinCheck(Target) && GetEntProp(Client, Prop_Send, "m_CollisionGroup") != 17) SetEntProp(Client, Prop_Send, "m_CollisionGroup", 17);
- else if(!JoinCheck(Target) && GetEntProp(Client, Prop_Send, "m_CollisionGroup") != 5) SetEntProp(Client, Prop_Send, "m_CollisionGroup", 5);
- new String:Translate_Formatting[256];
- if(IsPlayerAlive(Client))
- {
- CS_SetClientClanTag(Client, "Alive");
- decl String:strTime[256], String:strTime2[256];
- FormatTime_Hud2(Client, Time1, strTime, 256);
- FormatTime_Hud2(Client, Time2, strTime2, 256);
- new String:Formatting[256];
- if(Job[Client] == detector && !StrEqual(DNASample[Client][0], ""))
- {
- Format(Formatting, 256, "%s's DNA Scan\n[", DNASample[Client][1]);
- if(DNAScanCount[Client] >= 30)
- {
- Format(Formatting, 256, "%s██████████]", Formatting);
- }
- else
- {
- new count;
- for(new i; i < DNAScanCount[Client]/3; i++)
- {
- count++;
- Format(Formatting, 256, "%sâ–ˆ", Formatting);
- }
- for(new i; i< 10-count; i++)
- {
- Format(Formatting, 256, "%s ", Formatting);
- }
- Format(Formatting, 256, "%s]", Formatting, DNAScanCount[Client]);
- }
- }
- 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]);
- if(chosen)
- {
- if(Time1 == 0) Format(Translate_Formatting, 256, "%s\n%T : %T", Translate_Formatting, "time", Client, "extended time", Client);
- else Format(Translate_Formatting, 256, "%s\n%T : %s", Translate_Formatting, "time", Client, strTime);
- if(Job[Client] == traitor) Format(Translate_Formatting, 256, "%s\n%T : %s", Translate_Formatting, "traitor's time", Client, strTime2);
- }
- else Format(Translate_Formatting, 256, "%s\n%T : %s", Translate_Formatting, "ready", Client, strTime);
- if(Radar[Client])
- {
- 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));
- else Format(Translate_Formatting, 256, "%s\n%T : %T", Translate_Formatting, "radar", Client, "on active", Client);
- }
- if(!StrEqual(Formatting, "", false)) Format(Translate_Formatting, 256, "%s\n%s", Translate_Formatting, Formatting);
- sendKeyHintTextMsg(Client, Translate_Formatting);
- }
- else
- {
- if(chosen)
- {
- decl String:strTime[256], String:strTime2[256];
- FormatTime_Hud2(Client, Time1, strTime, 256);
- FormatTime_Hud2(Client, Time2, strTime2, 256);
- if(Time1 >= 1)
- {
- 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);
- }
- else
- {
- 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);
- }
- }
- else
- {
- decl String:strTime[256];
- FormatTime_Hud2(Client, Time1, strTime, 256);
- Format(Translate_Formatting, 256, "%T : %i\nKarma : %i\n%T : %s", "point", Client, Point[Client], Karma[Client], "ready", Client, strTime);
- }
- sendKeyHintTextMsg(Client, Translate_Formatting);
- if(Ragdoll[Client] > 0)
- {
- if(CheckedBody[Ragdoll[Client]]) CS_SetClientClanTag(Client, "Dead");
- else CS_SetClientClanTag(Client, "Alive");
- }
- else CS_SetClientClanTag(Client, "Observer");
- }
- }
- else return Plugin_Stop;
- return Plugin_Continue;
- }
- public Action:Recognize_Player2(Handle:timer, any:Client)
- {
- if(JoinCheck(Client))
- {
- if(BlockWeaponUse[Client]) BlockWeaponUse[Client] = false;//ì´ê²Œ 만약 trueì¼ê²½ìš°ì—는 무기를 들수가 없다. í•ìƒ ì²´í¬í•´ì¤˜ì•¼ 한다.
- new String:Formatting[256], Alive_Innocent, Disappear_Innocent, Dead_Innocent, Alive_Detective, Disappear_Detective, Dead_Detective;
- Format(Formatting, 256, "-- %T --", "list of traitor", Client);
- for(new i = 1; i <= MaxClients; i++)
- {
- if(JoinCheck(i) && Job[i] == traitor)
- {
- if(IsPlayerAlive(i)) Format(Formatting, 256, "%s\n%N", Formatting, i);
- else if(!CheckedBody[Ragdoll[i]]) Format(Formatting, 256, "%s\n*실종* %N", Formatting, i);
- else Format(Formatting, 256, "%s\n*사ë§* %N", Formatting, i);
- }
- if(JoinCheck(i))
- {
- if(IsPlayerAlive(i))
- {
- if(Job[i] == innocent) Alive_Innocent++;
- if(Job[i] == detector) Alive_Detective++;
- }
- else if(!CheckedBody[Ragdoll[i]])
- {
- if(Job[i] == innocent) Disappear_Innocent++;
- if(Job[i] == detector) Disappear_Detective++;
- }
- else
- {
- if(Job[i] == innocent) Dead_Innocent++;
- if(Job[i] == detector) Dead_Detective++;
- }
- }
- }
- if(Job[Client] == traitor || !IsPlayerAlive(Client))
- {
- new firstcolor[4] = {255, ...};
- firstcolor[0] = 255;
- firstcolor[1] = 127;
- firstcolor[2] = 42;
- HudMsg(Client, 1, 0.75, 0.08, firstcolor, firstcolor, 1, 0.0, 0.0, 3.0, 0.0, Formatting);
- 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);
- HudMsg(Client, 2, 0.75, 0.4, firstcolor, firstcolor, 1, 0.0, 0.0, 3.0, 0.0, Formatting);
- }
- }
- else return Plugin_Stop;
- return Plugin_Continue;
- }
- public Action:Recognize_Player(Handle:timer, any:Client)
- {
- if(JoinCheck(Client))
- {
- decl Float:pos[3], Float:angle[3];
- GetClientEyePosition(Client, pos);
- GetClientEyeAngles(Client, angle);
- new Handle:traceresulthandle = INVALID_HANDLE;
- 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"));
- else traceresulthandle = TR_TraceRayFilterEx(pos, angle, MASK_SOLID, RayType_Infinite, tracerayfilterdefault, Client);
- new Float:resultposition[3], Entity;
- if(TR_DidHit(traceresulthandle) == true)
- {
- TR_GetEndPosition(resultposition, traceresulthandle);
- new Float:vecmin[3] = {-4.0, -4.0, -8.0}, Float:vecmax[3] = {4.0, 4.0, 0.0};
- new Handle:traceresulthandle2 = INVALID_HANDLE;
- 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"));
- else traceresulthandle2 = TR_TraceHullFilterEx(pos, resultposition, vecmin, vecmax, MASK_PLAYERSOLID, tracerayfilterdefault, Client);
- Entity = TR_GetEntityIndex(traceresulthandle);
- if(!TR_GetEntityIndex(traceresulthandle)) Entity = TR_GetEntityIndex(traceresulthandle2);
- CloseHandle(traceresulthandle2);
- }
- CloseHandle(traceresulthandle);
- new String:Formatting[256];
- if(JoinCheck(Entity))
- {
- if(IsDisguise[Entity])
- {
- return Plugin_Handled;
- }
- Format(Formatting, 256, "%N", Entity);
- if(Job[Entity] == detector)
- {
- Format(Formatting, 256, "%s\n%T : %T", Formatting, "job", Client, JobName[Job[Entity]], Client);
- 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ã…¡");
- }
- if(Job[Entity] == traitor)
- {
- 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ã…¡");
- }
- if(GetClientHealth(Entity) < 20) Format(Formatting, 256, "%s\n%T", Formatting, "Near Death", Client);
- else if(GetClientHealth(Entity) < 40) Format(Formatting, 256, "%s\n%T", Formatting, "Badly Wounded", Client);
- else if(GetClientHealth(Entity) < 60) Format(Formatting, 256, "%s\n%T", Formatting, "Wounded", Client);
- else if(GetClientHealth(Entity) < 80) Format(Formatting, 256, "%s\n%T", Formatting, "Hurt", Client);
- else Format(Formatting, 256, "%s\n%T", Formatting, "Healthy", Client);
- if(VIP[Entity]) Format(Formatting, 256, "%s\nVIP", Formatting);
- }
- else if(IsRagdoll[Entity])
- {
- if(!CheckedBody[Entity])
- {
- Format(Formatting, 256, "%T", "unidentified body", Client);
- }
- else
- {
- new String:TargetName[256];
- GetEntPropString(Entity, Prop_Data, "m_iName", TargetName, 256);
- Format(Formatting, 256, "%T", "person's corpse", Client, TargetName);
- }
- }
- else if(IsHealthBox[Entity] || IsFakeHealthBox[Entity])
- {
- if(!HealthBox[Entity]) Format(Formatting, 256, "%T", "Empty Health Station", Client);
- else if(IsFakeHealthBox[Entity] && Job[Client] == traitor) Format(Formatting, 256, "%T\n%T : %i", "Fake Health Station", Client, "Remain Health Amount", Client, HealthBox[Entity]);
- else Format(Formatting, 256, "%T\n%T : %i", "Health Station", Client, "Remain Health Amount", Client, HealthBox[Entity]);
- }
- PrintHintText(Client, Formatting);
- new firstcolor[4] = {255, ...};
- firstcolor[0] = 255;
- firstcolor[1] = 150;
- firstcolor[2] = 200;
- if(!StrEqual(Formatting, "")) HudMsg(Client, 3, -1.0, 0.55, firstcolor, firstcolor, 2, 0.01, 0.7, 0.2, 0.0, Formatting);
- if(Fun2[Client]) ClientCommand(Client, "r_screenoverlay \"%s\"", "effects/alyxmonitor_talk.vmt");
- }
- else return Plugin_Stop;
- return Plugin_Continue;
- }
- public Action:PlusPlayingTime(Handle:timer, any:Client)
- {
- if(JoinCheck(Client))
- {
- if(GetClientTeam(Client) > 1 && DataLoaded[Client][0] && DataLoaded[Client][1] && DataLoaded[Client][2])
- {
- new Float:differ = FloatSub(GetEngineTime(), LastEngineTime[Client]);
- PlayingTime[Client] += differ;
- new String:SteamID[256], String:query[512];
- GetClientAuthString(Client ,SteamID, 256);
- Format(query, 512, "UPDATE info SET playingtime = '%f' WHERE steamid = '%s';", PlayingTime[Client], SteamID);
- SQL_TQuery(databasehandle, save_info, query, Client);
- Format(query, 512, "SELECT * FROM vip WHERE steamid = '%s';", SteamID);
- SQL_TQuery(databasehandle, vip_check, query, Client);
- }
- LastEngineTime[Client] = GetEngineTime();
- }
- else return Plugin_Stop;
- return Plugin_Continue;
- }
- public OnClientDisconnect(Client)
- {
- AliveJobCount[Job[Client]] -= 1;
- GravityGunDisconnect(Client);
- }
- public Action:JoinTeam(Client, Args)
- {
- decl String:text[192];
- GetCmdArgString(text, sizeof(text));
- new startidx = 0;
- if(text[strlen(text)-1] == '"')
- {
- text[strlen(text)-1] = '\0';
- startidx = 1;
- }
- new team = StringToInt(text[startidx]);
- if(team > 1 && roundstart && !chosen)
- {
- CreateTimer(1.0, RespawnPlayer, Client);
- }
- }
- public Action:JoinClass(Client, args)
- {
- if(IsPlayerAlive(Client)) return Plugin_Handled;
- return Plugin_Continue;
- }
- public EventSpawn( Handle:Spawn_Event, const String:Death_Name[], bool:Death_Broadcast )
- {
- new Client = GetClientOfUserId(GetEventInt(Spawn_Event, "userid"));
- if(IsPlayerAlive(Client) && !chosen && GetClientTeam(Client) > 1)
- {
- SpawnCheck[Client] = true;
- new weapons = GetPlayerWeaponSlot(Client, 1);
- if(IsValidEdict(weapons))
- {
- RemovePlayerItem(Client, weapons);
- RemoveEdict(weapons);
- }
- weapons = GetPlayerWeaponSlot(Client, 2);
- if(IsValidEdict(weapons))
- {
- RemovePlayerItem(Client, weapons);
- RemoveEdict(weapons);
- }
- GivePlayerItem(Client, "weapon_knife");
- weapons = GetPlayerWeaponSlot(Client, 0);
- if(IsValidEdict(weapons))
- {
- RemovePlayerItem(Client, weapons);
- RemoveEdict(weapons);
- }
- new bool:check;
- do
- {
- check = false;
- weapons = GetPlayerWeaponSlot(Client, 3);
- if(IsValidEdict(weapons))
- {
- RemovePlayerItem(Client, weapons);
- RemoveEdict(weapons);
- check = true;
- }
- } while(check);
- GivePlayerItem(Client, "weapon_fiveseven");
- if(ItemOn[Client][SkinType] && ItemID[Client][SkinType])
- {
- SetEntityModel(Client, ItemPath[ItemID[Client][SkinType]]);
- }
- SetEntProp(Client, Prop_Send, "m_bHasHelmet", 1);
- LastHitLog[Client] = HitLog[Client];
- LastAttackLog[Client] = AttackLog[Client];
- ResetData_Player(Client);
- if(!IsFakeClient(Client)) CreateTimer(0.0, EventSpawn_Delay, Client);
- SDKUnhook(Client, SDKHook_PreThink, MoveOnLadder);
- SetEntityGravity(Client, 1.0);
- }
- if(chosen)
- {
- new weapons = GetPlayerWeaponSlot(Client, 1);
- if(IsValidEdict(weapons))
- {
- RemovePlayerItem(Client, weapons);
- RemoveEdict(weapons);
- }
- ChosenJoin[Client] = true;
- new Float:Position[3];
- GetClientAbsOrigin(Client, Position);
- makeDamage(Client, Client, 999, (1<<17), 1.0, Position, "");
- ResetData_Player(Client);
- }
- IsShowMenu[Client] = false;
- ShowMenuCount[Client] = 0;
- }
- public Action:EventSpawn_Delay(Handle:timer, any:Client)
- {
- if(IsPlayerAlive(Client) && !chosen && GetClientTeam(Client) != 1)
- {
- GivePlayerItem(Client, "weapon_c4");
- }
- }
- public Action:RadarPlayer(Handle:timer, any:Client)
- {
- if(JoinCheck(Client) && IsPlayerAlive(Client))
- {
- if(!Radar[Client])
- {
- SetEntDataFloat(Client, g_flFlashDuration, GetRandomFloat(10.0, 3600.0), true);
- if(!Fun[Client]) SetEntDataFloat(Client, g_flFlashMaxAlpha, GetRandomFloat(0.1, 1.0), true);
- else SetEntDataFloat(Client, g_flFlashMaxAlpha, GetRandomFloat(50.0, 255.0), true);
- }
- else if(RadarCount[Client] > 0)
- {
- RadarCount[Client] -= 1;
- SetEntDataFloat(Client, g_flFlashDuration, GetRandomFloat(10.0, 3600.0), true);
- if(!Fun[Client]) SetEntDataFloat(Client, g_flFlashMaxAlpha, GetRandomFloat(0.1, 1.0), true);
- else SetEntDataFloat(Client, g_flFlashMaxAlpha, GetRandomFloat(50.0, 255.0), true);
- }
- else if(RadarCount[Client] > - 40)
- {
- RadarCount[Client] -= 1;
- SetEntDataFloat(Client, g_flFlashDuration, 0.0, true);
- SetEntDataFloat(Client, g_flFlashMaxAlpha, 0.5, true);
- }
- else
- {
- RadarCount[Client] = 300;
- }
- }
- else if(JoinCheck(Client))
- {
- if(Fun[Client])
- {
- SetEntDataFloat(Client, g_flFlashMaxAlpha, GetRandomFloat(50.0, 255.0), true);
- SetEntDataFloat(Client, g_flFlashDuration, GetRandomFloat(10.0, 3600.0), true);
- }
- else
- {
- SetEntDataFloat(Client, g_flFlashDuration, 0.0, true);
- SetEntDataFloat(Client, g_flFlashMaxAlpha, 0.5, true);
- }
- }
- else return Plugin_Stop;
- return Plugin_Continue;
- }
- public EventHurt( Handle:Spawn_Event, const String:Death_Name[], bool:Death_Broadcast )
- {
- new Client = GetClientOfUserId(GetEventInt(Spawn_Event, "userid"));
- new Attacker = GetClientOfUserId(GetEventInt(Spawn_Event, "attacker"));
- new damage = GetEventInt(Spawn_Event, "dmg_health");
- new String:WeaponName[256];
- GetEventString(Spawn_Event, "weapon", WeaponName, 256);
- if(StrEqual(WeaponName, "ump45", false))
- {
- new Float:vecPunch[3];
- GetEntDataVector(Client, offsPunchAngle, vecPunch);
- vecPunch[0] += GetRandomFloat(-20.0, 20.0);
- vecPunch[1] += GetRandomFloat(-20.0, 20.0);
- SetEntDataVector(Client, offsPunchAngle, vecPunch);
- }
- if(!StrContains(WeaponName, "prop_", false)) Format(WeaponName, 256, "prop");
- if(JoinCheck(Attacker))
- {
- new weapons = GetEntPropEnt(Attacker, Prop_Data, "m_hActiveWeapon");
- if(StrEqual(WeaponName, "awp", false) && weapons > 0 && Silenced_Sniper_Rifle[weapons]) Format(WeaponName, 256, "SSR");
- }
- if(JoinCheck(Attacker) && Attacker != Client)
- {
- if(StrEqual(WeaponName, "T-Virus", false))
- {
- if(Job[Attacker] == traitor) Format(HitLog[Client], 4096, "%s�[T]%N : T-Virus", HitLog[Client], Attacker);
- if(Job[Attacker] == detector) Format(HitLog[Client], 4096, "%s�[D]%N : T-Virus", HitLog[Client], Attacker);
- if(Job[Attacker] == innocent) Format(HitLog[Client], 4096, "%s�[I]%N : T-Virus", HitLog[Client], Attacker);
- if(Job[Client] == traitor) Format(AttackLog[Attacker], 4096, "%s�[T]%N : T-Virus", AttackLog[Attacker], Client);
- if(Job[Client] == detector) Format(AttackLog[Attacker], 4096, "%s�[D]%N : T-Virus", AttackLog[Attacker], Client);
- if(Job[Client] == innocent) Format(AttackLog[Attacker], 4096, "%s�[I]%N : T-Virus", AttackLog[Attacker], Client);
- return;
- }
- new bool:flamelog;
- if(StrEqual(WeaponName, "entityflame", false))
- {
- new String:Formatting[4096], count, String:Name[256];
- GetClientName(Client, Name, 256);
- Formatting = HitLog[Client];
- while(StrContains(Formatting, "�") != -1)
- {
- ReplaceStringEx(Formatting, 4096, "�", "");
- count++;
- }
- Formatting = HitLog[Client];
- new String:EString[count+1][64];
- ExplodeString(Formatting, "�", EString, count+1, 64);
- if(StrContains(EString[count][3], Name) == 0)
- {
- if(strlen(HitLog[Client])-12>0)
- {
- if(StrContains(HitLog[Client][strlen(HitLog[Client])-12], "entityflame") == 0)
- {
- new String:CheckString[16], String:LastDamage[3];
- CheckString[0] = HitLog[Client][strlen(HitLog[Client])-15];
- if(StringToInt(CheckString) > 0)
- {
- LastDamage[0] = HitLog[Client][strlen(HitLog[Client])-15];
- Format(HitLog[Client][strlen(HitLog[Client])-15], 16, "%i(entityflame)", StringToInt(LastDamage) + damage);
- }
- else
- {
- LastDamage[0] = HitLog[Client][strlen(HitLog[Client])-14];
- if(StringToInt(LastDamage) >= 9)
- {
- Format(HitLog[Client][strlen(HitLog[Client])-15], 16, "%i(entityflame)", StringToInt(LastDamage) + damage);
- }
- else
- {
- Format(HitLog[Client][strlen(HitLog[Client])-14], 16, "%i(entityflame)", StringToInt(LastDamage) + damage);
- }
- }
- flamelog = true;
- }
- }
- }
- Formatting = AttackLog[Attacker];
- count = 0;
- while(StrContains(Formatting, "�") != -1)
- {
- ReplaceStringEx(Formatting, 4096, "�", "");
- count++;
- }
- Formatting = AttackLog[Attacker];
- new String:EString2[count+1][64];
- ExplodeString(Formatting, "�", EString2, count+1, 64);
- if(StrContains(EString2[count][3], Name) == 0)
- {
- if(strlen(AttackLog[Attacker])-12>0)
- {
- if(StrContains(AttackLog[Attacker][strlen(AttackLog[Attacker])-12], "entityflame") == 0)
- {
- new String:CheckString[16], String:LastDamage[2];
- CheckString[0] = AttackLog[Attacker][strlen(AttackLog[Attacker])-15];
- if(StringToInt(CheckString) > 0)
- {
- LastDamage[0] = AttackLog[Attacker][strlen(AttackLog[Attacker])-15];
- LastDamage[1] = AttackLog[Attacker][strlen(AttackLog[Attacker])-14];
- Format(AttackLog[Attacker][strlen(AttackLog[Attacker])-15], 17, "%i(entityflame)", StringToInt(LastDamage) + damage);
- }
- else
- {
- LastDamage[0] = AttackLog[Attacker][strlen(AttackLog[Attacker])-14];
- if(StringToInt(LastDamage) >= 9)
- {
- Format(AttackLog[Attacker][strlen(AttackLog[Attacker])-15], 16, "%i(entityflame)", StringToInt(LastDamage) + damage);
- }
- else
- {
- Format(AttackLog[Attacker][strlen(AttackLog[Attacker])-14], 16, "%i(entityflame)", StringToInt(LastDamage) + damage);
- }
- }
- flamelog = true;
- }
- }
- }
- if(flamelog) return;
- }
- if(Job[Attacker] == traitor) Format(HitLog[Client], 4096, "%s�[T]%N : %i", HitLog[Client], Attacker, damage);
- if(Job[Attacker] == detector) Format(HitLog[Client], 4096, "%s�[D]%N : %i", HitLog[Client], Attacker, damage);
- if(Job[Attacker] == innocent) Format(HitLog[Client], 4096, "%s�[I]%N : %i", HitLog[Client], Attacker, damage);
- if(Job[Client] == traitor) Format(AttackLog[Attacker], 4096, "%s�[T]%N : %i", AttackLog[Attacker], Client, damage);
- if(Job[Client] == detector) Format(AttackLog[Attacker], 4096, "%s�[D]%N : %i", AttackLog[Attacker], Client, damage);
- if(Job[Client] == innocent) Format(AttackLog[Attacker], 4096, "%s�[I]%N : %i", AttackLog[Attacker], Client, damage);
- }
- else if(Attacker != Client)
- {
- new String:EdictName[256];
- GetEdictClassname(Attacker, EdictName, 256);
- Format(HitLog[Client], 4096, "%s�%s : %i", HitLog[Client], EdictName, damage);
- }
- }
- public Action:EventBullet(Handle:Event, const String:Name[], bool:Broadcast)
- {
- new Client = GetClientOfUserId(GetEventInt(Event, "userid"));
- new weapons = GetEntPropEnt(Client, Prop_Data, "m_hActiveWeapon");
- new String:classname[256], Float:targetposition[3], Float:clientposition[3], Float:clienteyeangle[3], Float:FWD[3], Float:RIGHT[3];
- if(IsValidEdict(weapons) && weapons > 0) GetEdictClassname(weapons, classname, 256);
- if(StrEqual(classname, "weapon_ump45", false))
- {
- GetClientAbsOrigin(Client, clientposition);
- GetClientEyeAngles(Client, clienteyeangle);
- clientposition[2] += 60.0;
- GetAngleVectors(clienteyeangle, FWD, RIGHT, NULL_VECTOR);
- NormalizeVector(FWD, FWD);
- ScaleVector(FWD, 32.0);
- AddVectors(clientposition, FWD, clientposition);
- NormalizeVector(RIGHT, RIGHT);
- ScaleVector(RIGHT, 6.0);
- AddVectors(clientposition, RIGHT, clientposition);
- targetposition[0] = GetEventFloat(Event, "x");
- targetposition[1] = GetEventFloat(Event, "y");
- targetposition[2] = GetEventFloat(Event, "z");
- 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);
- TE_SendToAll();
- }
- return Plugin_Handled;
- }
- public Action:roundfreezeend_event(Handle:Event, const String:Name[], bool:Broadcast)
- {
- for(new i = 1;i <= MaxClients; i++)
- {
- if(JoinCheck(i) && IsPlayerAlive(i))
- {
- if(ItemOn[i][SkinType] && ItemID[i][SkinType])
- {
- SetEntityModel(i, ItemPath[ItemID[i][SkinType]]);
- }
- }
- }
- }
- public EventFire( Handle:Spawn_Event, const String:Death_Name[], bool:Death_Broadcast )
- {
- new Attacker = GetClientOfUserId(GetEventInt(Spawn_Event, "userid"));
- new weapons = GetEntPropEnt(Attacker, Prop_Data, "m_hActiveWeapon");
- new Float:vecPunch[3], String:classname[32];
- GetEntDataVector(Attacker, offsPunchAngle, vecPunch);
- GetEdictClassname(weapons, classname, 32);
- if(vecPunch[0] < 4.0 && vecPunch[1] < 4.0 && vecPunch[0] > -4.0 && vecPunch[1] > -4.0)
- {
- vecPunch[0] *= 2.0;
- vecPunch[1] *= 2.0;
- }
- //if(StrEqual(classname, "weapon_awp", false) && Silenced_Sniper_Rifle[weapons]) EmitSoundToAll("weapons/m4a1/m4a1-1.wav", weapons, SNDCHAN_WEAPON);
- if(StrEqual(classname, "weapon_p228", false)) EmitSoundToAll("weapons/flaregun/fire.wav", weapons, SNDCHAN_WEAPON);
- SetEntDataVector(Attacker, offsPunchAngle, vecPunch);
- }
- public Action:EventDeath(Handle:Spawn_Event, const String:Spawn_Name[], bool:Spawn_Broadcast)
- {
- new Client = GetClientOfUserId(GetEventInt(Spawn_Event, "userid"));
- new entity = GetEntPropEnt(Client, Prop_Send, "m_hRagdoll");
- AcceptEntityInput(entity, "kill");
- if(!ChosenJoin[Client])
- {
- ClientCommand(Client, "r_screenoverlay \"\"");
- new Attacker = GetClientOfUserId(GetEventInt(Spawn_Event, "attacker")), String:ModelName[256], Float:attackerposition[3];
- GetEventString(Spawn_Event, "weapon", Weapon[Client], 256);
- if(JoinCheck(Attacker))
- {
- new weapon = GetEntPropEnt(Attacker, Prop_Data, "m_hActiveWeapon");
- if(StrEqual(Weapon[Client], "awp", false) && weapon > 0 && Silenced_Sniper_Rifle[weapon]) Format(Weapon[Client], 256, "SSR");
- }
- GetClientModel(Client, ModelName, 256);
- if(!IsModelPrecached(ModelName))
- {
- PrecacheModel(ModelName, true);
- }
- if(Attacker) GetClientEyePosition(Attacker, attackerposition);
- if(Client != Attacker && Attacker) PrintChat(Client, "\x05[%T] \x04%N\x01%T", JobName[Job[Attacker]], Client, Attacker, "Kill message", Client, Weapon[Client]);
- if(Job[Client] != traitor) Time2 += 20;
- if(Job[Attacker] == traitor && Job[Client] != traitor)
- {
- if(Job[Client] == detector)
- {
- for(new i = 1; i <= MaxClients; i++)
- {
- if(IsClientInGame(i))
- {
- if(Job[i] == traitor && IsPlayerAlive(i))
- {
- Credit[i] += 1;
- PrintChat(i, "\x0787CEEB%T", "received credit for killing", i, JobName[Job[i]], i);
- }
- }
- }
- }
- if(roundstart)
- {
- Format(TraitorKillList[Attacker], 256, "%s\n%N", TraitorKillList[Attacker], Client);
- }
- }
- else if(Attacker && Job[Attacker] != traitor && Job[Client] == traitor)
- {
- if(chosen)
- {
- Karma[Attacker] += Karma_KillTraitor;
- if(Karma[Attacker] > Karma_Max)
- Karma[Attacker] = Karma_Max;
- SaveKarma(Attacker);
- for(new i = 1; i <= MaxClients; i++)
- {
- if(IsClientInGame(i))
- {
- if(Job[i] == detector && IsPlayerAlive(i))
- {
- Credit[i] += 1;
- PrintChat(i, "\x0787CEEB%T", "received credit for killing", i, JobName[Job[i]], i);
- }
- }
- }
- }
- }
- else if(Attacker && Job[Attacker] != traitor && Job[Client] != traitor && Client != Attacker)
- {
- if(chosen && !IsFakeClient(Attacker))
- {
- Karma[Attacker] -= Karma_TeamKill;
- SaveKarma(Attacker);
- if(!Karma[Attacker])
- BanClient(Attacker, 0, BANFLAG_AUTHID, "Karma Ban [ Duration : never ]", "You have been banned from this server\n[ Reason : Karma Ban, Duration : never ]");
- else if(Karma[Attacker] <= 100)
- BanClient(Attacker, 43200, BANFLAG_AUTHID, "Karma Ban [ Duration : 43200mins ]", "You have been banned from this server\n[ Reason : Karma Ban, Duration : 43200mins ]");
- else if(Karma[Attacker] <= 200)
- BanClient(Attacker, 10080, BANFLAG_AUTHID, "Karma Ban [ Duration : 10080mins ]", "You have been banned from this server\n[ Reason : Karma Ban, Duration : 10080mins ]");
- else if(Karma[Attacker] <= 300)
- BanClient(Attacker, 1440, BANFLAG_AUTHID, "Karma Ban [ Duration : 1440mins ]", "You have been banned from this server\n[ Reason : Karma Ban, Duration : 1440mins ]");
- else if(Karma[Attacker] <= 400)
- BanClient(Attacker, 60, BANFLAG_AUTHID, "Karma Ban [ Duration : 60mins ]", "You have been banned from this server\n[ Reason : Karma Ban, Duration : 60mins ]");
- }
- }
- new String:SoundFormat[256];
- do
- {
- Format(SoundFormat, 256, "tttmusic/die%i.wav", GetRandomInt(1, 16));
- } while(StrEqual("tttmusic/die11.wav", SoundFormat, false) || StrEqual("tttmusic/die9.wav", SoundFormat, false));
- if(!StrEqual(Weapon[Client], "knife", false) || !Dagger[Attacker]) EmitSoundToAll(SoundFormat, Client);
- IsHeadShot[Client] = GetEventBool(Spawn_Event, "headshot");
- //살아있는ì§ì—…수
- AliveJobCount[Job[Client]] -= 1;
- //스프ë¼ì´íŠ¸ì œê±°
- if(Sprites[Client] != 0 && IsValidEdict(Sprites[Client])) AcceptEntityInput(Sprites[Client], "Kill");
- if(DNASprites[Client] != 0 && IsValidEdict(DNASprites[Client]))
- {
- AcceptEntityInput(DNASprites[Client], "Kill");
- if(IsValidEdict(info_target[DNASprites[Client]])) AcceptEntityInput(info_target[DNASprites[Client]], "Kill");
- }
- if(JihadSpark[Client] != 0 && IsValidEdict(JihadSpark[Client])) AcceptEntityInput(JihadSpark[Client], "Kill");
- //리스í°ì‹œì¼œì£¼ìž
- if(roundstart && !chosen) CreateTimer(0.5, RespawnPlayer, Client);
- if((roundstart && chosen) || !roundstart)
- {
- new Float:Pos[3], Float:Angle[3];
- GetClientAbsOrigin(Client, Pos);
- GetClientEyeAngles(Client, Angle);
- new String:TargetName[256];
- Format(TargetName, 256, "%N", Client);
- //임시 ë°ì´í„°ë¥¼ ì „ë‹¬í•˜ê¸°ìœ„í•œ 래그ëŒ
- new ragdoll = CreateEntityByName("prop_ragdoll");
- DispatchKeyValue(ragdoll, "targetname", TargetName);
- DispatchKeyValue(ragdoll, "model", ModelName);
- DispatchSpawn(ragdoll);
- SetEntPropEnt(Client, Prop_Send, "m_hRagdoll", ragdoll);
- SetEntProp(ragdoll, Prop_Send, "m_nSolidType", 6);
- SetEntProp(ragdoll, Prop_Send, "m_CollisionGroup", 2);
- SetEntityModel(ragdoll, ModelName);
- TeleportEntity(ragdoll, Pos, Angle, NULL_VECTOR);
- SetEntPropVector(ragdoll, Prop_Send, "m_vecOrigin", Pos);
- //ì´ê²ƒì€ 래그ëŒì´ë‹¤.
- IsRagdoll[ragdoll] = true;
- //ì´ì œ 래그ëŒì˜ ì •ë³´ë¥¼ ì 어주ìž.
- Format(TargetDescription[ragdoll][0], 256, "%s", JobName[Job[Client]]);
- Format(TargetDescription[ragdoll][1], 256, "%f", GetEngineTime());
- if(IsHeadShot[Client])
- {
- //í—¤ë“œìƒ·ì •ë³´ëŠ” 마지막ì—ë‘ìž.
- Format(TargetDescription[ragdoll][4], 256, "The fatal wound was a headshot. No time to scream");
- TargetDescription_bool[ragdoll][4] = true;
- }
- else TargetDescription_bool[ragdoll][4] = false;
- if(!Attacker || StrEqual(Weapon[Client], "worldspawn", false))
- {
- Format(TargetDescription[ragdoll][2], 256, "He fell to his death");
- TargetDescription_bool[ragdoll][3] = false;
- TargetDescription_bool[ragdoll][4] = false;
- }
- else if(StrEqual(Weapon[Client], "knife", false))
- {
- Format(TargetDescription[ragdoll][2], 256, "The body is bruised and battered. Clearly he was clubbed to death");
- TargetDescription_bool[ragdoll][3] = false;
- TargetDescription_bool[ragdoll][4] = false;
- }
- else if(StrEqual(Weapon[Client], "RPG-7", false) || StrEqual(Weapon[Client], "the_jihad", false) || StrEqual(Weapon[Client], "fake_healthbox", false))
- {
- Format(TargetDescription[ragdoll][2], 256, "Smells like roasted terrorist around here");
- TargetDescription_bool[ragdoll][3] = false;
- TargetDescription_bool[ragdoll][4] = false;
- SetVariantString("40 30 10");
- AcceptEntityInput(ragdoll, "Color");
- }
- else if(Client == Attacker)
- {
- Format(TargetDescription[ragdoll][2], 256, "You cannot find a specific cause of this terrorist's death");
- TargetDescription_bool[ragdoll][3] = false;
- TargetDescription_bool[ragdoll][4] = false;
- }
- else
- {
- Format(TargetDescription[ragdoll][2], 256, "It is obvious he was shot to death");
- Format(TargetDescription[ragdoll][3], 256, "It appears a weapon was used to kill him:%s", Weapon[Client]);
- TargetDescription_bool[ragdoll][3] = true;
- }
- if(Job[Client] == traitor)
- {
- if(StrEqual(TraitorKillList[Client], ""))
- {
- TargetDescription_bool[ragdoll][5] = false;
- }
- else
- {
- Format(TargetDescription[ragdoll][5], 256, "You found a list of kills with these names�%s", TraitorKillList[Client]);
- TargetDescription_bool[ragdoll][5] = true;
- }
- }
- else TargetDescription_bool[ragdoll][5] = false;
- if(StrEqual(Weapon[Client], "knife", false))
- {
- if(Dagger[Attacker])
- {
- Dagger[Attacker] = false;
- new weapons = GetPlayerWeaponSlot(Attacker, 2);
- if(IsValidEdict(weapons))
- {
- RemovePlayerItem(Attacker, weapons);
- RemoveEdict(weapons);
- }
- GivePlayerItem(Attacker, "weapon_knife");
- }
- }
- //ì´ê²ƒì€ ì•„ì§ ì²´í¬ì•ˆëœ 시체ì´ë‹¤ë¥¼ 표시하ìž.
- CheckedBody[ragdoll] = false;
- //í¬ë ˆë”§ë„ 건네주ìž
- RemainCredit[ragdoll] = Credit[Client];
- Credit[Client] = 0;
- //DNAì •ë³´ì¯¤ì´ì•¼
- 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);
- Ragdoll[Client] = ragdoll;
- SDKHook(ragdoll, SDKHook_OnTakeDamage, RagdollTakeDamageHook);
- }
- new EntEffects = GetEntProp(ClientVM[Client][1], Prop_Send, "m_fEffects");
- EntEffects |= EF_NODRAW;
- SetEntProp(ClientVM[Client][1], Prop_Send, "m_fEffects", EntEffects);
- new String:Formatting[4096], count, bool:check;
- Formatting = HitLog[Client];
- while(StrContains(Formatting, "�") != -1)
- {
- ReplaceStringEx(Formatting, 4096, "�", "");
- count++;
- check = true;
- }
- if(check)
- {
- Formatting = HitLog[Client];
- new String:Formatting2[count+1][64];
- ExplodeString(Formatting, "�", Formatting2, count+1, 64);
- new Handle:menuhandle = CreateMenu(NULL_CallBack);
- SetMenuTitle(menuhandle, "-----ë°ë¯¸ì§€ë¡œê·¸-----");
- for(new i=1; i<=count; i++)
- {
- AddMenuItem(menuhandle, "", Formatting2[i], ITEMDRAW_DISABLED);
- }
- SetMenuExitButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, 10);
- }
- new weapons = GetPlayerWeaponSlot(Client, 4);
- if(IsValidEdict(weapons))
- {
- RemovePlayerItem(Client, weapons);
- RemoveEdict(weapons);
- }
- }
- if(ChosenJoin[Client]) ChosenJoin[Client] = false;
- return Plugin_Handled;
- }
- public Action:RespawnPlayer(Handle:timer, any:Client)
- {
- if(IsClientInGame(Client) && !IsPlayerAlive(Client) && GetClientTeam(Client) > 1 && !chosen) CS_RespawnPlayer(Client);
- }
- public OnChangeName(Handle:event, const String:name[], bool:dontbroadcast)
- {
- new Client = GetClientOfUserId(GetEventInt(event, "userid")), String:OldName[256], String:NewName[256];
- GetEventString(event, "oldname", OldName, 256);
- GetEventString(event, "newname", NewName, 256);
- if(IsPlayerAlive(Client)) KickClient(Client, "%T", "Dont change nickname", Client);
- else PrintChat(Client, "\x03You changed your nickname.\x07C5C5C5%s \x01-> \x07C5C5C5%s", OldName, NewName);
- CreateTimer(0.1, ChangedName, Client);
- }
- public Action:ChangedName(Handle:timer, any:Client)
- {
- if(JoinCheck(Client)) ChangeNickname(Client);
- }
- public RoundStart(Handle:event, const String:Name[], bool:Broadcast)
- {
- roundstart = true;
- ReceiveCredit = false;
- if(FirstRound)
- {
- FirstRound = false;
- GameCount = 350;
- }
- else GameCount = 200;
- Time1 = GameCount/10;
- Time2 = 180+(GameCount/10);
- CreateTimer(0.1, GameStart, _, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
- new String:CurrentMap[256];
- GetCurrentMap(CurrentMap, 256);
- MaxDiaCount = 1;
- DiaCount = 0;
- for(new i=MaxClients+1; i < GetMaxEntities(); i++)
- {
- if(IsValidEdict(i))
- {
- decl String:classname[256];
- GetEdictClassname(i, classname, 256);
- new iOwnerEntity = FindSendPropOffs("CBaseCombatWeapon", "m_hOwnerEntity");
- if(StrContains(classname, "weapon_", false) != -1 && GetEntDataEnt2(i, iOwnerEntity) == -1)
- {
- RemoveEdict(i);
- }
- if(StrContains(classname, "rope", false) != -1)
- {
- if(IsRope[i]) RemoveEdict(i);
- }
- if(StrEqual(classname, "hostage_entity", false) || StrEqual(classname, "func_hostage_rescue", false))
- {
- RemoveEdict(i);
- }
- if(IsValidEntity(i) && (!StrContains(classname, "prop_physics", false) || !StrContains(classname, "prop_dynamic", false)))
- {
- SetEntData(i, CollOff, 0, 4, true);
- SetEntPropFloat(i, Prop_Data, "m_explodeDamage", 0.0);
- SetEntPropFloat(i, Prop_Data, "m_explodeRadius", 0.0);
- }
- if(StrEqual(CurrentMap, "ttt_minecraft_b4", false))
- {
- if(IsValidEntity(i))
- {
- new String:iName[256], String:Classname[32];
- GetEntPropString(i, Prop_Data, "m_iName", iName, 256);
- GetEdictClassname(i, Classname, 32);
- if(StrContains(iName, "Door", false) != -1 || StrContains(iName, "_Clip", false) != -1)
- {
- if(StrContains(iName, "Ttest_", false) && StrContains(iName, "T1_Door", false)) SetEntData(i, CollOff, 2, 4, true);
- }
- if(StrEqual(iName, "Trap_water", false))
- {
- AcceptEntityInput(i, "Kill");
- }
- if(StrEqual(iName, "Trap_lava", false))
- {
- AcceptEntityInput(i, "Enable");
- }
- if(StrEqual(iName, "Trap_Lava_Hurt", false))
- {
- AcceptEntityInput(i, "Enable");
- }
- if(!StrContains(iName, "DiaOre_"))
- {
- MaxDiaCount++;
- SetEntityRenderMode(i, RENDER_TRANSCOLOR);
- SetEntityRenderColor(i, 255, 255, 255, 0);
- }
- if(StrEqual(Classname, "trigger_once"))
- {
- new Float:pos[3];
- GetEntPropVector(i, Prop_Send, "m_vecOrigin", pos);
- if(RoundToNearest(pos[0]) == -1808 && RoundToNearest(pos[1]) == 592 && RoundToNearest(pos[2]) == 738)
- {
- new Float:mins[3], Float:maxs[3];
- GetEntPropVector(i, Prop_Send, "m_vecMins", mins);
- GetEntPropVector(i, Prop_Send, "m_vecMaxs", maxs);
- AcceptEntityInput(i, "Kill");
- new entity = CreateEntityByName("trigger_multiple");
- DispatchKeyValue(entity, "spawnflags", "1036");
- DispatchKeyValue(entity, "targetname", "");
- DispatchKeyValue(entity, "filtername", "Diablock_Filter");
- DispatchSpawn(entity);
- ActivateEntity(entity);
- TeleportEntity(entity, pos, NULL_VECTOR, NULL_VECTOR);
- PrecacheModel("models/props/cs_office/vending_machine.mdl", true);
- SetEntityModel(entity, "models/props/cs_office/vending_machine.mdl");
- SetEntPropVector(entity, Prop_Send, "m_vecMins", mins);
- SetEntPropVector(entity, Prop_Send, "m_vecMaxs", maxs);
- //노블ëŸ
- SetEntProp(entity, Prop_Send, "m_nSolidType", 2);
- SetVariantString("OnStartTouch !activator:DisableMotion::0:-1");
- AcceptEntityInput(entity, "AddOutput");
- SetVariantString("OnStartTouch Furnace_Teleport:Teleport::0:-1");
- AcceptEntityInput(entity, "AddOutput");
- SetVariantString("OnStartTouch !activator:Kill::2.0:-1");
- AcceptEntityInput(entity, "AddOutput");
- }
- }
- }
- }
- if(StrEqual(CurrentMap, "zm_roy_the_ship_64", false))
- {
- if(IsValidEntity(i))
- {
- new String:Classname[32];
- GetEdictClassname(i, Classname, 32);
- if(StrEqual(Classname, "func_breakable"))
- {
- new Float:pos[3];
- GetEntPropVector(i, Prop_Send, "m_vecOrigin", pos);
- if(RoundToNearest(pos[0]) == -2276 && (RoundToNearest(pos[1]) == -450 || RoundToNearest(pos[1]) == -478) && RoundToNearest(pos[2]) == 264)
- {
- SetVariantInt(999999);
- AcceptEntityInput(i, "SetHealth");
- }
- }
- }
- }
- if(StrEqual(CurrentMap, "de_dolls_blue", false))
- {
- if(IsValidEntity(i))
- {
- new String:iName[256];
- GetEntPropString(i, Prop_Data, "m_iName", iName, 256);
- if(StrEqual(iName, "frame", false) || StrEqual(iName, "frame1", false) || StrEqual(iName, "prop", false) || StrEqual(iName, "prop1", false) || StrEqual(iName, "fanpush", false)) RemoveEdict(i);
- if(StrEqual(classname, "prop_ragdoll", false)) RemoveEdict(i);
- }
- }
- if(StrEqual(classname, "func_useableladder"))
- {
- new Float:Position[3], Float:Position_Start[3], Float:Position_End[3], Float:Angle[3], Float:Mins[3], Float:Maxs[3];
- GetEntPropVector(i, Prop_Send, "m_vecOrigin", Position);
- GetEntPropVector(i, Prop_Send, "m_vecPlayerMountPositionBottom", Position_Start);
- GetEntPropVector(i, Prop_Send, "m_vecPlayerMountPositionTop", Position_End);
- Position[2] += Mins[2];
- Maxs[2] -= Mins[2];
- Mins[2] = 0.0;
- Mins[2] += Position_Start[2];
- Maxs[2] += Position_End[2]-10.0;
- GetEntPropVector(i, Prop_Send, "m_vecLadderDir", Angle);
- new entity = CreateEntityByName("trigger_multiple");
- DispatchKeyValue(entity, "spawnflags", "1");
- DispatchKeyValue(entity, "targetname", "ladder");
- DispatchSpawn(entity);
- ActivateEntity(entity);
- TeleportEntity(entity, Position, Angle, NULL_VECTOR);
- //PrecacheModel("models/props/cs_office/vending_machine.mdl", true);
- //SetEntityModel(entity, "models/props/cs_office/vending_machine.mdl");
- SetEntityModel(entity, "models/props/cs_italy/orange.mdl");
- SetEntPropVector(entity, Prop_Send, "m_vecMins", Mins);
- SetEntPropVector(entity, Prop_Send, "m_vecMaxs", Maxs);
- //노블ëŸ
- SetEntProp(entity, Prop_Send, "m_nSolidType", 2);
- }
- }
- }
- if(StrEqual(CurrentMap, "ttt_minecraft_b4", false)) PrintChatAll("\x04[Furnace]\x07FFFFFFYou have placed %i In the furnace You need %i more.", DiaCount, MaxDiaCount-DiaCount);
- new Handle:kv = CreateKeyValues("TTTWeapons"), Float:spawnposition[3], String:weaponname[256], String:buffer[256];
- FileToKeyValues(kv, Path);
- KvGotoFirstSubKey(kv);
- do
- {
- KvGetSectionName(kv, buffer, sizeof(buffer));
- if(StrEqual(buffer, CurrentMap, false))
- {
- KvJumpToKey(kv, CurrentMap, false);
- KvGotoFirstSubKey(kv);
- do
- {
- KvGetSectionName(kv, buffer, sizeof(buffer));
- KvGetVector(kv, "weapon", spawnposition);
- KvGetString(kv, "weapon2", weaponname, 256, "NULL");
- if(!StrEqual(weaponname, "NULL", false))
- {
- new entity = CreateEntityByName(weaponname);
- if(entity != -1)
- {
- if(StrContains(weaponname, "light", false) == 0)
- {
- DispatchKeyValue(entity, "_light", "255 255 255");
- DispatchKeyValue(entity, "brightness", "3");
- DispatchKeyValue(entity, "spotlight_radius", "1000");
- DispatchKeyValue(entity, "pitch", "-90");
- DispatchKeyValue(entity, "distance", "300");
- }
- DispatchSpawn(entity);
- if(StrContains(weaponname, "light", false) == 0)
- {
- AcceptEntityInput(entity, "TurnOn");
- }
- TeleportEntity(entity, spawnposition, NULL_VECTOR, NULL_VECTOR);
- }
- }
- }
- while(KvGotoNextKey(kv));
- }
- }while(KvGotoNextKey(kv));
- KvRewind(kv);
- CloseHandle(kv);
- Ladder_Spawn();
- for(new i=1; i<=MaxClients; i++)
- {
- FunCommand[i] = 0;
- if(TVirusTimer[i] != INVALID_HANDLE)
- {
- KillTimer(TVirusTimer[i]);
- TVirusTimer[i] = INVALID_HANDLE;
- }
- if(Teleport[i] != INVALID_HANDLE)
- {
- KillTimer(Teleport[i]);
- Teleport[i] = INVALID_HANDLE;
- }
- WillTimer[i] = INVALID_HANDLE;
- DNAScanTimer[i] = INVALID_HANDLE;
- }
- }
- public Ladder_Spawn()
- {
- new String:CurrentMap[256], String:buffer[256], String:classname[32], Float:spawnposition[3], Float:spawnposition2[3];
- GetCurrentMap(CurrentMap, 256);
- new Handle:kv = CreateKeyValues("TTTLadders");
- FileToKeyValues(kv, Path3);
- KvGotoFirstSubKey(kv);
- do
- {
- KvGetSectionName(kv, buffer, sizeof(buffer));
- if(StrEqual(buffer, CurrentMap, false))
- {
- KvJumpToKey(kv, CurrentMap, false);
- KvGotoFirstSubKey(kv);
- do
- {
- KvGetSectionName(kv, buffer, sizeof(buffer));
- KvGetString(kv, "info", classname, 256, "NULL");
- KvGetVector(kv, "position", spawnposition);
- KvGetVector(kv, "position2", spawnposition2);
- if(!StrEqual(classname, "NULL", false))
- {
- new Float:origin[3], Float:mins[3], Float:maxs[3];
- origin[0] = (spawnposition[0]+spawnposition2[0])/2.0;
- origin[1] = (spawnposition[1]+spawnposition2[1])/2.0;
- origin[2] = (spawnposition[2]+spawnposition2[2])/2.0;
- maxs[0] = FloatAbs(spawnposition[0]-spawnposition2[0])/2.0;
- maxs[1] = FloatAbs(spawnposition[1]-spawnposition2[1])/2.0;
- maxs[2] = FloatAbs(spawnposition[2]-spawnposition2[2])/2.0;
- mins[0] = -maxs[0];
- mins[1] = -maxs[1];
- mins[2] = -maxs[2];
- new entity = CreateEntityByName("trigger_multiple");
- DispatchKeyValue(entity, "spawnflags", "1");
- DispatchKeyValue(entity, "targetname", "ladder");
- DispatchSpawn(entity);
- ActivateEntity(entity);
- TeleportEntity(entity, origin, NULL_VECTOR, NULL_VECTOR);
- //PrecacheModel("models/props/cs_office/vending_machine.mdl", true);
- //SetEntityModel(entity, "models/props/cs_office/vending_machine.mdl");
- SetEntityModel(entity, "models/props/cs_italy/orange.mdl");
- SetEntPropVector(entity, Prop_Send, "m_vecMins", mins);
- SetEntPropVector(entity, Prop_Send, "m_vecMaxs", maxs);
- //노블ëŸ
- SetEntProp(entity, Prop_Send, "m_nSolidType", 2);
- }
- }while(KvGotoNextKey(kv));
- break;
- }
- }while(KvGotoNextKey(kv));
- KvRewind(kv);
- CloseHandle(kv);
- }
- public Action:GameStart(Handle:timer)
- {
- if(roundstart && !chosen)
- {
- for(new Client = 1; Client <= MaxClients; Client++)
- {
- if(JoinCheck(Client))
- {
- if(GetTeamClientCount(2) < 3)
- {
- PrintCenterText(Client, "%T %T", "job select", Client, RoundToCeil(float(GameCount)/10.0), "at least 3", Client);
- }
- else
- {
- PrintCenterText(Client, "%T", "job select", Client, RoundToCeil(float(GameCount)/10.0));
- }
- }
- }
- if(GameCount == 0)
- {
- new Traitor[8] = {-1, -1, ...}, Detector[4] = {-1, -1, ...};
- if(GetTeamClientCount(2) < 3)
- {
- GameCount = 100;
- Time1 += 10;
- Time2 += 10;
- }
- else
- {
- chosen = true;
- for(new i; i < 4; i++)
- {
- AliveJobCount[i] = 0;
- }
- if(GetTeamClientCount(2) >= 4)
- {
- for(new i; i < GetTeamClientCount(2)/4; i++)
- {
- if(i == 0) Traitor[i] = GetRandomPlayer(true);
- if(i== 1) Traitor[i] = GetRandomPlayer(true, Traitor[i-1]);
- if(i== 2) Traitor[i] = GetRandomPlayer(true, Traitor[i-2], Traitor[i-1]);
- if(i== 3) Traitor[i] = GetRandomPlayer(true, Traitor[i-3], Traitor[i-2], Traitor[i-1]);
- if(i== 4) Traitor[i] = GetRandomPlayer(true, Traitor[i-4], Traitor[i-3], Traitor[i-2], Traitor[i-1]);
- if(i== 5) Traitor[i] = GetRandomPlayer(true, Traitor[i-5], Traitor[i-4], Traitor[i-3], Traitor[i-2], Traitor[i-1]);
- 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]);
- 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]);
- }
- for(new i=8; i < (GetTeamClientCount(2)/8)+8; i++)
- {
- 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]);
- 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]);
- 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]);
- 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]);
- }
- if(GetTeamClientCount(2) > 4 && GetTeamClientCount(2) < 8)
- {
- Detector[0] = GetRandomPlayer(false, Traitor[0]);
- }
- }
- else
- {
- Traitor[0] = GetRandomPlayer(true);
- }
- for(new Client = 1; Client <= MaxClients; Client++)
- {
- if(IsClientInGame(Client))
- {
- ResetData_Player(Client);
- if(!IsPlayerAlive(Client) && GetClientTeam(Client) > 1 && !IsFakeClient(Client))
- {
- CS_RespawnPlayer(Client);
- }
- if(IsPlayerAlive(Client))
- {
- if(Karma[Client] >= Karma_Effect)
- CreateRotatingTrail(Client);
- if(Karma[Client] >= 1000)
- PrintToChat(Client, "\x078888FFYour Karma is %i, so you deal full damage this round!", Karma[Client]);
- else
- PrintToChat(Client, "\x07FF8888Your Karma is %i, so damage you deal is reduced by %i%%!", Karma[Client], Karma[Client]/10);
- }
- for(new i; i < 12; i++)
- {
- if(i < 8)
- {
- if(Traitor[i] == Client)
- {
- Job[Client] = traitor;
- AliveJobCount[traitor] += 1;
- PrintChat(Client, "\x07FFFFFFYou are \x07FF0000Traitor.");
- Credit[Client] = 2;
- new Float:Pos[3], Float:move[3];
- GetClientAbsOrigin(Client, Pos);
- move[2] += 20.0;
- new sprite = CreateVMT(Client, Pos, "ttt/icon_traitor_fix_v2.vmt", 0.3);
- Sprites[Client] = sprite;
- SDKHook(sprite, SDKHook_SetTransmit, Hook_SetTransmit);
- TeleportEntity(sprite, move, NULL_VECTOR, NULL_VECTOR);
- if(VIP[Client]) Credit[Client] += 1;
- }
- }
- else
- {
- if(Detector[i-8] == Client)
- {
- Job[Client] = detector;
- AliveJobCount[detector] += 1;
- PrintChat(Client, "\x07FFFFFFYou are \x070000FFDetective.");
- Credit[Client] = 2;
- new Float:Pos[3], Float:move[3];
- GetClientAbsOrigin(Client, Pos);
- move[0] += 4.0;
- move[2] += 20.0;
- new sprite = CreateVMT(Client, Pos, "ttt/icon_det.vmt", 0.2);
- SDKHook(sprite, SDKHook_SetTransmit, Hook_SetTransmit3);
- Sprites[Client] = sprite;
- TeleportEntity(sprite, move, NULL_VECTOR, NULL_VECTOR);
- if(VIP[Client]) Credit[Client] += 1;
- SetEntProp(Client, Prop_Data, "m_ArmorValue", 9999);
- IronShoes[Client] = true;
- }
- }
- }
- if((Job[Client] == 0 || Job[Client] == innocent) && GetClientTeam(Client) > 1)
- {
- Job[Client] = innocent;
- AliveJobCount[innocent] += 1;
- PrintChat(Client, "\x07FFFFFFYou are \x0700FF00innocent.");
- }
- }
- }
- Time1 = Time2;
- /*
- SoundNumber = GetRandomInt(0, MAX_MUSIC-1);
- new String:Formatting[256];
- Format(Formatting, 256, "tttmusic/%s", SoundData[SoundNumber][0]);
- for(new i=1; i <= MaxClients; i++)
- {
- if(JoinCheck(i) && !BGM[i])
- {
- EmitSoundToClient(i, Formatting, i, _, _, _, float(Volume[i])/100);
- }
- }
- SoundCount = StringToInt(SoundData[SoundNumber][1]);
- CreateTimer(1.0, CheckSound, _, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
- */
- new String:CurrentMap[256];
- GetCurrentMap(CurrentMap, 256);
- if(StrEqual(CurrentMap, "ttt_minecraft_b4", false))
- {
- for(new i; i < GetMaxEntities(); i++)
- {
- if(IsValidEdict(i))
- {
- decl String:classname[256];
- GetEdictClassname(i, classname, 256);
- if(IsValidEntity(i))
- {
- new String:iName[256];
- GetEntPropString(i, Prop_Data, "m_iName", iName, 256);
- if(!StrContains(iName, "T1_Door", false)) SetEntData(i, CollOff, 2, 4, true);
- if(StrEqual(classname, "trigger_multiple", false)) AcceptEntityInput(i, "Enable");
- if(!StrContains(iName, "DiaOre_"))
- {
- SetEntityRenderMode(i, RENDER_TRANSCOLOR);
- SetEntityRenderColor(i, 255, 255, 255, 255);
- }
- }
- }
- }
- }
- }
- }
- GameCount -= 1;
- }
- else return Plugin_Stop;
- return Plugin_Continue;
- }
- /*
- public Action:CheckSound(Handle:timer)
- {
- if(!chosen)
- {
- SoundCount = 0;
- SoundNumber = 0;
- return Plugin_Stop;
- }
- else
- {
- if(SoundCount > 0)
- {
- SoundCount -= 1;
- }
- else
- {
- new String:Formatting[256];
- Format(Formatting, 256, "tttmusic/%s", SoundData[SoundNumber][0]);
- for(new i=1; i <= MaxClients; i++)
- {
- if(JoinCheck(i) && !BGM[i])
- {
- EmitSoundToClient(i, Formatting, i, _, _, _, float(Volume[i])/100);
- }
- }
- SoundCount = StringToInt(SoundData[SoundNumber][1]);
- }
- }
- return Plugin_Continue;
- }
- */
- public RoundEnd(Handle:Spawn_Event, const String:Spawn_Name[], bool:Spawn_Broadcast)
- {
- chosen = false;
- roundstart = false;
- for(new Client = 1; Client <= MaxClients; Client++)
- {
- if(IsClientInGame(Client))
- {
- release(Client);
- /*
- new String:Formatting[256];
- Format(Formatting, 256, "tttmusic/%s", SoundData[SoundNumber][0]);
- StopSound(Client, SNDCHAN_AUTO, Formatting);
- if(!BGM[Client])
- {
- EmitSoundToClient(Client, "tttmusic/end.mp3", Client, _, _, _, float(Volume[Client])/100);
- }
- */
- }
- IsInfect[Client] = false;
- g_bIsWeaponGrabber[Client] = false;
- grabbedentref[Client] = INVALID_ENT_REFERENCE;
- entityownersave[Client] = INVALID_ENT_REFERENCE;
- }
- for(new i = MaxClients+1; i<2048; i++)
- {
- DNASprites[i] = 0;
- }
- }
- public Action:OnHostageBlocking(Handle:event, const String:name[], bool:dontBroadcast)
- {
- return Plugin_Handled;
- }
- public CheckDeadBody(Client, entity, far)
- {
- if(Job[Client] == detector && DNASprites[entity] && IsValidEdict(DNASprites[entity]))
- {
- AcceptEntityInput(DNASprites[entity], "Kill");
- DNASprites[entity] = 0;
- }
- new String:Formatting[1024], String:Translate_Formatting[256], String:EString[2][128], String:TargetName[256], String:CorrectTime[256];
- GetEntPropString(entity, Prop_Data, "m_iName", TargetName, 256);
- FormatTime_Hud(Client, StringToFloat(TargetDescription[entity][1]), CorrectTime, 256);
- new Handle:menuhandle = CreateMenu(CheckDeadBody_CallBack);
- Format(Formatting, 1024, "-- TTT %T --", "Body Search Results", Client);
- Format(Formatting, 1024, "%s\n%T", Formatting, "This is the body of person", Client, TargetName);
- Format(Formatting, 1024, "%s\n%T", Formatting, "This person was a jobname", Client, TargetDescription[entity][0], Client);
- Format(Formatting, 1024, "%s\n%T", Formatting, "He died roughly before you conducted the search", Client, CorrectTime);
- Format(Formatting, 1024, "%s\n%T", Formatting, TargetDescription[entity][2], Client);
- if(StrContains(TargetDescription[entity][3], ":", false) != -1)
- {
- ExplodeString(TargetDescription[entity][3], ":", EString, 2, 128);
- Format(Formatting, 1024, "%s\n%T", Formatting, EString[0], Client, EString[1]);
- }
- if(TargetDescription_bool[entity][4]) Format(Formatting, 1024, "%s\n%T", Formatting, TargetDescription[entity][4], Client);
- SetMenuTitle(menuhandle, Formatting);
- AddMenuItem(menuhandle, "Close", "Close");
- if(far) Format(Formatting, 256, "farCall%i", entity);
- else Format(Formatting, 1024, "Call%i", entity);
- Format(Translate_Formatting, 256, "%T", "Call Detective", Client);
- if(Job[Client] != detector)
- {
- if(AliveJobCount[detector] > 0 && !(DNASprites[entity] && IsValidEdict(DNASprites[entity])) && IsPlayerAlive(Client)) AddMenuItem(menuhandle, Formatting, Translate_Formatting);
- else if(AliveJobCount[detector] > 0) AddMenuItem(menuhandle, "Call", Translate_Formatting, ITEMDRAW_DISABLED);
- else
- {
- Format(Translate_Formatting, 256, "%T(%T)", "Call Detective", Client, "None Detective", Client);
- AddMenuItem(menuhandle, "Call", Translate_Formatting, ITEMDRAW_DISABLED);
- }
- }
- if(RemainCredit[entity] > 0)
- {
- new String:Formatting2[256];
- if(far) Format(Formatting2, 256, "farCredit%i", entity);
- else Format(Formatting2, 256, "Credit%i", entity);
- if(IsPlayerAlive(Client)) AddMenuItem(menuhandle, Formatting2, "í¬ë ˆë”§ 회수");
- }
- new String:Formatting2[256];
- if(far) Format(Formatting2, 256, "farDNA%i", entity);
- else Format(Formatting2, 256, "DNA%i", entity);
- if(!StrEqual(DNAInformation[entity], ""))
- {
- if(GetEngineTime() - StringToFloat(TargetDescription[entity][1]) < 120.0)
- {
- new String:Formatting3[256], String:DNARemainTime[256];
- FormatTime_Hud(Client, -120.0+(2.0*GetEngineTime())-StringToFloat(TargetDescription[entity][1]), DNARemainTime, 256);
- Format(Formatting3, 256, "Returning DNA(Disappear in %s.)", DNARemainTime);
- if(Job[Client] == detector && IsPlayerAlive(Client)) AddMenuItem(menuhandle, Formatting2, Formatting3);
- else AddMenuItem(menuhandle, Formatting2, Formatting3, ITEMDRAW_DISABLED);
- }
- else AddMenuItem(menuhandle, Formatting2, "Returning DNA(DNA disapeared.)", ITEMDRAW_DISABLED);
- }
- else AddMenuItem(menuhandle, Formatting2, "Returning DNA(Cant find DNA.)", ITEMDRAW_DISABLED);
- Format(Translate_Formatting, 256, "%T", "You found a list of kills with these names", Client);
- Format(Formatting2, 256, "traitor kill list%i", entity);
- if(TargetDescription_bool[entity][5]) AddMenuItem(menuhandle, Formatting2, Translate_Formatting);
- SetMenuExitButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, 20);
- }
- public CheckDeadBody_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:info[256];
- GetMenuItem(menu, select, info, 256);
- if(StrContains(info, "Credit", false) != -1)
- {
- new bool:check;
- if(StrContains(info, "far", false) == 0)
- {
- ReplaceStringEx(info, 256, "farCredit", "");
- check = true;
- }
- else ReplaceStringEx(info, 256, "Credit", "");
- new entity = StringToInt(info);
- if(RemainCredit[entity] > 0 && chosen)
- {
- Credit[Client] += RemainCredit[entity];
- PrintChat(Client, "\x07C53AC5%T", "found credit", Client, RemainCredit[entity], "\x07FFFFFF");
- RemainCredit[entity] = 0;
- }
- if(check)
- {
- CheckDeadBody(Client, entity, 1);
- }
- else
- {
- CheckDeadBody(Client, entity, 0);
- }
- }
- if(StrContains(info, "Call", false) != -1)
- {
- new bool:check;
- if(StrContains(info, "far", false) == 0)
- {
- ReplaceStringEx(info, 256, "farCall", "");
- check = true;
- }
- else ReplaceStringEx(info, 256, "Call", "");
- new Float:position[3], Float:entityposition[3];
- GetClientAbsOrigin(Client, position);
- GetEntPropVector(StringToInt(info), Prop_Send, "m_vecOrigin", entityposition);
- if(GetVectorDistance(position, entityposition, false) > 200.0 && !check)
- {
- PrintChat(Client, "\x07C5C5FF%T", "too far from body", Client);
- }
- else if(IsPlayerAlive(Client) && chosen)
- {
- entityposition[2] += 10.0;
- new String:TargetName[256];
- GetEntPropString(StringToInt(info), Prop_Data, "m_iName", TargetName, 256);
- DNASprites[StringToInt(info)] = CreateEntityByName("env_glow");
- if(!IsModelPrecached("ttt/call_detective.vmt"))
- {
- PrecacheModel("ttt/call_detective.vmt", true);
- }
- DispatchKeyValue(DNASprites[StringToInt(info)], "spawnflags", "1");
- DispatchKeyValue(DNASprites[StringToInt(info)], "model", "ttt/call_detective.vmt");
- DispatchKeyValue(DNASprites[StringToInt(info)], "framerate", "0");
- DispatchKeyValueFloat(DNASprites[StringToInt(info)], "scale", 1.0);
- DispatchSpawn(DNASprites[StringToInt(info)]);
- SetEntityModel(DNASprites[StringToInt(info)], "ttt/call_detective.vmt");
- TeleportEntity(DNASprites[StringToInt(info)], entityposition, NULL_VECTOR, NULL_VECTOR);
- SetVariantString("!activator");
- AcceptEntityInput(DNASprites[StringToInt(info)], "SetParent", StringToInt(info), DNASprites[StringToInt(info)], 0);
- SDKHook(DNASprites[StringToInt(info)], SDKHook_SetTransmit, Hook_SetTransmit5);
- for(new i=1; i <= MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- PrintChat(i, "\x07FF3A3A%N\x07FFFF3A%T", Client, "called a Detective", i, TargetName, "\x07FF3A3A", "\x07FFFF3A", "\x0787CEEB", "\x07FFFF3A");
- }
- }
- }
- }
- if(StrContains(info, "DNA", false) != -1)
- {
- new bool:check;
- if(StrContains(info, "far", false) == 0)
- {
- ReplaceStringEx(info, 256, "farDNA", "");
- check = true;
- }
- else ReplaceStringEx(info, 256, "DNA", "");
- new Float:position[3], Float:entityposition[3], String:TargetName[256];
- GetClientAbsOrigin(Client, position);
- GetEntPropVector(StringToInt(info), Prop_Send, "m_vecOrigin", entityposition);
- GetEntPropString(StringToInt(info), Prop_Data, "m_iName", TargetName, 256);
- if(GetVectorDistance(position, entityposition, false) > 200.0 && !check)
- {
- PrintChat(Client, "\x07C5C5FF%T", "too far from body", Client);
- return;
- }
- if(!StrEqual(DNAInformation[StringToInt(info)], ""))
- {
- for(new i; i < 5; i++)
- {
- if(StrEqual(Sample[Client][i][0], ""))
- {
- Sample[Client][i][0] = DNAInformation[StringToInt(info)];
- GetEntPropString(StringToInt(info), Prop_Data, "m_iName", Sample[Client][i][1], 256);
- DNAInformation[StringToInt(info)] = "";
- break;
- }
- }
- }
- PrintChat(Client, "\x07FFFFFF%T", "press tab key", Client);
- }
- if(StrContains(info, "traitor kill list", false) != -1)
- {
- ReplaceStringEx(info, 256, "traitor kill list", "");
- KillList(Client, StringToInt(info));
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public KillList(Client, entity)
- {
- new Handle:menuhandle = CreateMenu(KillList_CallBack);
- SetMenuTitle(menuhandle, "%T", "You found a list of kills with these names", Client);
- new String:EString[2][256], String:TemporaryString[256], count;
- ExplodeString(TargetDescription[entity][5], "�", EString, 2, 256);
- TemporaryString = EString[1];
- while(StrContains(TemporaryString, "\n") != -1)
- {
- ReplaceStringEx(TemporaryString, 256, "\n", "");
- count++;
- }
- new String:EString2[count+1][32];
- ExplodeString(EString[1], "\n", EString2, count+1, 256);
- for(new i=1; i < count+1; i++)
- {
- AddMenuItem(menuhandle, "", EString2[i], ITEMDRAW_DISABLED);
- }
- SetMenuExitButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, 20);
- }
- public KillList_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public DNAMenu(Client)
- {
- new Handle:menuhandle = CreateMenu(DNAMenu_CallBack), String:Translate_Formatting[256];
- SetMenuTitle(menuhandle, "-- DNA Sample --");
- for(new i; i<5; i++)
- {
- if(StrEqual(Sample[Client][i][0], ""))
- {
- Format(Translate_Formatting, 256, "%T", "empty slot", Client);
- AddMenuItem(menuhandle, "", Translate_Formatting);
- }
- else
- {
- AddMenuItem(menuhandle, "", Sample[Client][i][1]);
- }
- }
- SetMenuExitButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public DNAMenu_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- if(StrEqual(Sample[Client][select][0], "")) PrintChat(Client, "\x073A3A3A%T!", "empty slot", Client);
- else DNAMenu2(Client, select);
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public DNAMenu2(Client, Number)
- {
- new Handle:menuhandle = CreateMenu(DNAMenu2_CallBack), String:Formatting[256];
- SetMenuTitle(menuhandle, "-- DNA Sample --\n%s", Sample[Client][Number][1]);
- Format(Formatting, 256, "%i", Number);
- AddMenuItem(menuhandle, Formatting, "Use");
- AddMenuItem(menuhandle, Formatting, "Drop");
- SetMenuExitButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public DNAMenu2_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:StringNumber[256];
- GetMenuItem(menu, select, StringNumber, 256);
- new Number = StringToInt(StringNumber);
- if(select == 0)
- {
- if(StrEqual(Sample[Client][Number][0], ""))
- {
- DNAScanning[Client] = false;
- new String:Translate_Formatting[256];
- Format(Translate_Formatting, 256, "\x073A3A3A%T!", "empty slot", Client);
- PrintChat(Client, Translate_Formatting);
- return;
- }
- else
- {
- DNAScanning[Client] = true;
- DNASample[Client][0] = Sample[Client][Number][0];
- DNASample[Client][1] = Sample[Client][Number][1];
- new Handle:pack = CreateDataPack();
- WritePackCell(pack, StringToInt(DNASample[Client][0]));
- WritePackCell(pack, Client);
- WritePackCell(pack, Ragdoll[StringToInt(DNASample[Client][0])]);
- DNAScanCount[Client] = 0;
- if(DNAScanTimer[Client] != INVALID_HANDLE)
- {
- KillTimer(DNAScanTimer[Client]);
- DNAScanTimer[Client] = INVALID_HANDLE;
- }
- DNAScanTimer[Client] = CreateTimer(1.0, DNAScanCheck, pack, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE|TIMER_DATA_HNDL_CLOSE);
- PrintChat(Client, "\x07FFFF3A%T", "start dna scan", Client);
- }
- }
- if(select == 1)
- {
- if(StrEqual(Sample[Client][Number][0], ""))
- {
- DNAScanning[Client] = false;
- new String:Translate_Formatting[256];
- Format(Translate_Formatting, 256, "\x073A3A3A%T!", "empty slot", Client);
- PrintChat(Client, Translate_Formatting);
- return;
- }
- else
- {
- Sample[Client][Number][0] = "";
- Sample[Client][Number][1] = "";
- PrintChat(Client, "\x07FFFF3A%T", "drop dna", Client);
- }
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public Action:OnPlayerRunCmd(Client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon)
- {
- if(JoinCheck(Client))
- {
- if(JoinCheck(GetClientAimTarget(Client)) && IsPlayerAlive(GetClientAimTarget(Client)) && !IsDisguise[GetClientAimTarget(Client)]) MenuLastMan[Client] = GetClientAimTarget(Client);
- new weapons = GetEntPropEnt(Client, Prop_Data, "m_hActiveWeapon"), String:weaponclass[32];
- if(weapons > 0 && IsValidEdict(weapons)) GetEdictClassname(weapons, weaponclass, 32);
- if(buttons & IN_RELOAD)
- {
- if(weapons == GetPlayerWeaponSlot(Client, 0) && StrEqual(weaponclass, "weapon_awp", false) && Silenced_Sniper_Rifle[weapons]) buttons &= ~IN_RELOAD;
- else if(weapons == GetPlayerWeaponSlot(Client, 1) && StrEqual(weaponclass, "weapon_p228", false)) buttons &= ~IN_RELOAD;
- }
- if((buttons & IN_SPEED) && !(keybuffer[Client] & IN_SPEED))
- {
- keybuffer[Client] = keybuffer[Client] | IN_SPEED;
- ShowMenuCount[Client] = 50;
- MenuLastMan[Client] = 0;
- if(!IsShowMenu[Client])
- {
- FastChat(Client);
- IsShowMenu[Client] = true;
- }
- if(IsPlayerAlive(Client))
- {
- if(JoinCheck(GetClientAimTarget(Client)) && IsPlayerAlive(GetClientAimTarget(Client)) && IsDisguise[GetClientAimTarget(Client)])
- {
- for(new i=1; i<=MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- PrintChat(i, "\x07FF3A3A%N \x01: someone in disguise!", Client);
- }
- }
- }
- }
- }
- else if(!(buttons & IN_SPEED) && keybuffer[Client] & IN_SPEED)
- {
- keybuffer[Client] = keybuffer[Client] & ~IN_SPEED;
- }
- if(buttons & IN_SCORE && !(keybuffer[Client] & IN_SCORE))
- {
- keybuffer[Client] |= IN_SCORE;
- if(IsPlayerAlive(Client))
- {
- for(new i; i < 5; i++)
- {
- if(!StrEqual(Sample[Client][i][0], ""))
- {
- DNAMenu(Client);
- break;
- }
- }
- }
- }
- else if(!(buttons & IN_SCORE))
- {
- keybuffer[Client] &= ~IN_SCORE;
- }
- if((buttons & IN_USE) && !(keybuffer[Client] & IN_USE))
- {
- keybuffer[Client] = keybuffer[Client] | IN_USE;
- decl Float:pos[3], Float:angle[3];
- GetClientEyePosition(Client, pos);
- GetClientEyeAngles(Client, angle);
- new Handle:traceresulthandle = INVALID_HANDLE;
- traceresulthandle = TR_TraceRayFilterEx(pos, angle, MASK_SOLID, RayType_Infinite, tracerayfilternoplayer, Client);
- if(TR_DidHit(traceresulthandle) == true)
- {
- new Entity = TR_GetEntityIndex(traceresulthandle);
- new Float:entityposition[3], String:TargetName[256], String:classname[256];
- GetEntPropVector(Entity, Prop_Send, "m_vecOrigin", entityposition);
- GetEntPropString(Entity, Prop_Data, "m_iName", TargetName, 256);
- GetEdictClassname(Entity, classname, 256);
- entityposition[2] += 60.0;
- if((IsPlayerAlive(Client) && GetVectorDistance(pos, entityposition) <= 200.0) || !IsPlayerAlive(Client))
- {
- if(IsRagdoll[Entity])
- {
- CheckDeadBody(Client, Entity, 0);
- if(!CheckedBody[Entity] && IsPlayerAlive(Client))
- {
- for(new i=1; i<=MaxClients; i++)
- {
- if(JoinCheck(i))
- {
- PrintChat(i, "\x07FF3A3A%N%T", Client, "found the body", i, TargetName, TargetDescription[Entity][0], "\x07FFFF3A", "\x07FF3A3A", "\x07FFFF3A", "\x07FFFFFF", i, "\x07FFFF3A");
- }
- }
- CheckedBody[Entity] = true;
- }
- }
- }
- }
- CloseHandle(traceresulthandle);
- }
- else if(!(buttons & IN_USE))
- {
- keybuffer[Client] = keybuffer[Client] & ~IN_USE;
- }
- if(ShowMenuCount[Client])
- {
- if(!IsPlayerAlive(Client))
- {
- MenuLastMan[Client] = 0;
- }
- }
- }
- if(JoinCheck(Client) && IsPlayerAlive(Client))
- {
- new Float:FallVelocity = GetEntPropFloat(Client, Prop_Send, "m_flFallVelocity");
- if(FallVelocity < 0 && KnockBackAttacker[Client] && !KnockBackAttackerDelay[Client]) KnockBackAttackerDelay[Client] = 1;
- else if(FallVelocity == 0 && KnockBackAttacker[Client] && KnockBackAttackerDelay[Client]) KnockBackAttacker[Client] = 0;
- if(buttons & IN_USE)
- {
- if(!HealDelay[Client])
- {
- decl Float:pos[3], Float:angle[3];
- GetClientEyePosition(Client, pos);
- GetClientEyeAngles(Client, angle);
- new Handle:traceresulthandle = INVALID_HANDLE;
- traceresulthandle = TR_TraceRayFilterEx(pos, angle, MASK_SOLID, RayType_Infinite, tracerayfilternoplayer, Client);
- if(TR_DidHit(traceresulthandle) == true)
- {
- new Entity = TR_GetEntityIndex(traceresulthandle);
- new Float:entityposition[3], String:TargetName[256];
- GetEntPropVector(Entity, Prop_Send, "m_vecOrigin", entityposition);
- GetEntPropString(Entity, Prop_Data, "m_iName", TargetName, 256);
- entityposition[2] += 60.0;
- if(IsFakeHealthBox[Entity])
- {
- if(Job[Client] == traitor)
- {
- if(HealthBox[Entity])
- {
- HealthBox[Entity] -= 1;
- HealDelay[Client] = true;
- CreateTimer(0.3, HealDelay_Timer, Client);
- }
- }
- }
- if(GetVectorDistance(pos, entityposition) <= 150.0)
- {
- if(IsFakeHealthBox[Entity])
- {
- if(Job[Client] != traitor)
- {
- if(JoinCheck(FakeHealthBoxOwner[Entity])) makeRadiusDamage(FakeHealthBoxOwner[Entity], entityposition, 200.0, 99.0, "fake_healthbox", true);
- else makeRadiusDamage(0, entityposition, 200.0, 99.0, "fake_healthbox", true);
- AcceptEntityInput(Entity, "Kill");
- IsFakeHealthBox[Entity] = false;
- }
- }
- if(IsHealthBox[Entity] && HealthBox[Entity] > 0)
- {
- if(GetClientHealth(Client) < 100)
- {
- new HealthBoxAbility = IsDetectorHealthBox[Entity] ? 2 : 1, PlusHP;
- if(IsVIPHealthBox[Entity]) HealthBoxAbility += 1;
- if(GetClientHealth(Client) > 100-HealthBoxAbility)
- {
- PlusHP = 100 - GetClientHealth(Client);
- if(HealthBox[Entity] >= PlusHP)
- {
- SetEntityHealth(Client, GetClientHealth(Client)+PlusHP);
- HealthBox[Entity] -= PlusHP;
- }
- else
- {
- SetEntityHealth(Client, GetClientHealth(Client)+HealthBox[Entity]);
- HealthBox[Entity] = 0;
- }
- }
- else
- {
- if(HealthBox[Entity] >= HealthBoxAbility)
- {
- SetEntityHealth(Client, GetClientHealth(Client)+HealthBoxAbility);
- HealthBox[Entity] -= HealthBoxAbility;
- }
- else
- {
- SetEntityHealth(Client, GetClientHealth(Client)+HealthBox[Entity]);
- HealthBox[Entity] = 0;
- }
- }
- if(!HealSoundDelay[Client])
- {
- EmitSoundToAll("items/smallmedkit1.wav", Client);
- CreateTimer(2.0, HealSoundDelay_Timer, Client);
- HealSoundDelay[Client] = true;
- }
- HealDelay[Client] = true;
- CreateTimer(0.3, HealDelay_Timer, Client);
- }
- }
- }
- }
- CloseHandle(traceresulthandle);
- }
- }
- decl String:WeaponName[256];
- GetClientWeapon(Client, WeaponName, 256);
- new weapons = GetEntPropEnt(Client, Prop_Data, "m_hActiveWeapon");
- if(TeleporterDelay[Client])
- {
- if(!Teleporter[weapons] && Teleport[Client] != INVALID_HANDLE)
- {
- TeleporterDelay[Client] = false;
- TeleportSuccess[Client] = false;
- SetEntPropFloat(Client, Prop_Send, "m_flProgressBarStartTime", 0.0);
- SetEntProp(Client, Prop_Send, "m_iProgressBarDuration", 0);
- SetEntityMoveType(Client, MOVETYPE_WALK);
- KillTimer(Teleport[Client]);
- Teleport[Client] = INVALID_HANDLE;
- }
- }
- if(buttons & IN_ATTACK)
- {
- if(StrEqual(WeaponName, "weapon_c4", false))
- {
- buttons &= ~IN_ATTACK;
- if(grabbedentref[Client] == INVALID_ENT_REFERENCE)
- {
- new targetentity, Float:distancetoentity, Float:resultpos[3], Float:eyeposition[3], Float:vector[3];
- GetClientEyePosition(Client, eyeposition);
- targetentity = GetClientAimEntity3(Client, distancetoentity, resultpos);
- if(targetentity > 0){
- new PropTypeCheck:entityType = entityTypeCheck(targetentity);
- new String:classname[256];
- if(IsValidEdict(targetentity)) GetEdictClassname(targetentity, classname, 256);
- new iOwnerEntity = FindSendPropOffs("CBaseCombatWeapon", "m_hOwnerEntity");
- if(StrContains(classname, "weapon_") != -1)
- {
- if(GetEntDataEnt2(targetentity, iOwnerEntity) != -1) return;
- }
- if(StrEqual(classname, "player", false))
- {
- /*
- new Float:entityspeed[3];
- GetEntPropVector(targetentity, Prop_Data, "m_vecVelocity", entityspeed);
- new Float:position[3], Float:position2[3], Float:push[3];
- GetClientEyePosition(targetentity, position2);
- GetClientEyePosition(Client, position);
- MakeVectorFromPoints(position, position2, push);
- NormalizeVector(push, push);
- ScaleVector(push, 8.0);
- AddVectors(push, entityspeed, push);
- TeleportEntity(targetentity, NULL_VECTOR, NULL_VECTOR, push);
- */
- return;
- }
- if(entityType && !isClientConnectedIngameAlive(GetEntPropEnt(targetentity, Prop_Send, "m_hOwnerEntity")))
- {
- if(distancetoentity <= 300.0)
- {
- MakeVectorFromPoints(eyeposition, resultpos, vector);
- ScaleVector(vector, 1.0);
- Phys_SetVelocity(targetentity, vector, ZERO_VECTOR, true);
- }
- }
- }
- }
- else if(grabbedentref[Client] != INVALID_ENT_REFERENCE)
- {
- decl Float:pos[3], Float:angle[3];
- GetClientEyePosition(Client, pos);
- GetClientEyeAngles(Client, angle);
- new Handle:traceresulthandle = INVALID_HANDLE, Float:resultposition[3];
- traceresulthandle = TR_TraceRayFilterEx(pos, angle, MASK_SOLID, RayType_Infinite, tracerayfilternoragdoll, Client);
- if(TR_DidHit(traceresulthandle) == true)
- {
- new Entity = TR_GetEntityIndex(traceresulthandle);
- if(!Entity && IsRagdoll[EntRefToEntIndex(grabbedentref[Client])])
- {
- TR_GetEndPosition(resultposition, traceresulthandle);
- if(GetVectorDistance(pos, resultposition, false) < 200.0)
- {
- for(new i; i<4; i++)
- {
- if(!Wire[EntRefToEntIndex(grabbedentref[Client])][i][0] && !Wire[EntRefToEntIndex(grabbedentref[Client])][i][1] && !Wire[EntRefToEntIndex(grabbedentref[Client])][i][2])
- {
- CreateWire(EntRefToEntIndex(grabbedentref[Client]), resultposition);
- release(Client);
- break;
- }
- }
- }
- }
- }
- CloseHandle(traceresulthandle);
- }
- }
- if(StrEqual(WeaponName, "weapon_smokegrenade", false) && DNASignalJammer[weapons] && !(keybuffer[Client] & IN_ATTACK))
- {
- keybuffer[Client] = keybuffer[Client] | IN_ATTACK;
- new Float:pos[3], Float:angle[3];
- GetClientEyePosition(Client, pos);
- GetClientEyeAngles(Client, angle);
- new Handle:traceresulthandle = INVALID_HANDLE, Float:resultposition[3];
- traceresulthandle = TR_TraceRayFilterEx(pos, angle, MASK_SOLID, RayType_Infinite, tracerayfilternoplayer, Client);
- if(TR_DidHit(traceresulthandle) == true)
- {
- TR_GetEndPosition(resultposition, traceresulthandle);
- if(GetVectorDistance(resultposition, pos) < 300.0)
- {
- new entity = Create_Prop(Client, "models/props/cs_office/phone.mdl", true);
- if(entity != -1)
- {
- JammerEntity[Client] = entity;
- SetVariantInt(500);
- AcceptEntityInput(entity, "SetHealth");
- SetEntityMoveType(entity, MOVETYPE_NONE);
- if(IsValidEdict(weapons))
- {
- RemovePlayerItem(Client, weapons);
- RemoveEdict(weapons);
- }
- }
- }
- else PrintChat(Client, "It's too far away!");
- }
- CloseHandle(traceresulthandle);
- }
- if(StrEqual(WeaponName, "weapon_smokegrenade", false) && Jihad[weapons] && !(keybuffer[Client] & IN_ATTACK))
- {
- keybuffer[Client] = keybuffer[Client] | IN_ATTACK;
- if(!IsJihad[Client])
- {
- IsJihad[Client] = true;
- new Float:Position[3], Float:Angle[3] = {-90.0, 0.0, 0.0};
- GetClientAbsOrigin(Client, Position);
- Position[2] += 20.0;
- JihadSpark[Client] = CreateEntityByName("env_spark");
- DispatchKeyValueVector(JihadSpark[Client], "angles", Angle);
- DispatchKeyValue(JihadSpark[Client], "MaxDelay", "1");
- DispatchKeyValue(JihadSpark[Client], "Magnitude", "2");
- DispatchKeyValue(JihadSpark[Client], "TrailLength", "1");
- DispatchKeyValue(JihadSpark[Client], "spawnflags", "395");
- DispatchSpawn(JihadSpark[Client]);
- TeleportEntity(JihadSpark[Client], Position, NULL_VECTOR, NULL_VECTOR);
- AcceptEntityInput(JihadSpark[Client], "StartSpark", Client);
- SetVariantString("!activator");
- AcceptEntityInput(JihadSpark[Client], "SetParent", Client, JihadSpark[Client], 0);
- CreateTimer(2.5, Jihad_Explosion, Client);
- EmitSoundToAll("tttmusic/jihad.wav", Client, SNDCHAN_WEAPON, ATTN_TO_SNDLEVEL(0.28));
- }
- buttons &= ~IN_ATTACK;
- }
- if(StrEqual(WeaponName, "weapon_flashbang", false) && HealthStation[weapons] && !(keybuffer[Client] & IN_ATTACK))
- {
- keybuffer[Client] = keybuffer[Client] | IN_ATTACK;
- new Float:pos[3], Float:angle[3];
- GetClientEyePosition(Client, pos);
- GetClientEyeAngles(Client, angle);
- new Handle:traceresulthandle = INVALID_HANDLE, Float:resultposition[3];
- traceresulthandle = TR_TraceRayFilterEx(pos, angle, MASK_SOLID, RayType_Infinite, tracerayfilternoplayer, Client);
- if(TR_DidHit(traceresulthandle) == true)
- {
- TR_GetEndPosition(resultposition, traceresulthandle);
- if(GetVectorDistance(resultposition, pos) < 300.0)
- {
- new entity = Create_Prop(Client, "models/items/item_item_crate.mdl");
- if(entity != -1)
- {
- IsHealthBox[entity] = true;
- if(VIP[Client]) HealthBox[entity] = 300;
- else HealthBox[entity] = 150;
- if(Job[Client] == detector) IsDetectorHealthBox[entity] = true;
- if(VIP[Client]) IsVIPHealthBox[entity] = true;
- SetVariantInt(200);
- AcceptEntityInput(entity, "SetHealth");
- if(IsValidEdict(weapons))
- {
- RemovePlayerItem(Client, weapons);
- RemoveEdict(weapons);
- }
- }
- }
- else PrintChat(Client, "It's too far away!");
- }
- CloseHandle(traceresulthandle);
- }
- if(StrEqual(WeaponName, "weapon_hegrenade", false) && Teleporter[weapons] && !(keybuffer[Client] & IN_ATTACK))
- {
- keybuffer[Client] = keybuffer[Client] | IN_ATTACK;
- if(TeleportCount[weapons] > 0)
- {
- if(TeleporterSavedPosition[Client])
- {
- if(!TeleporterDelay[Client])
- {
- TeleporterDelay[Client] = true;
- TeleportSuccess[Client] = true;
- Teleport[Client] = CreateTimer(0.9, Teleporting, Client);
- SetEntPropFloat(Client, Prop_Send, "m_flProgressBarStartTime", GetGameTime());
- SetEntProp(Client, Prop_Send, "m_iProgressBarDuration", 1);
- SetEntityMoveType(Client, MOVETYPE_NONE);
- }
- }
- }
- buttons &= ~IN_ATTACK;
- }
- }
- else if(keybuffer[Client] & IN_ATTACK)
- {
- keybuffer[Client] = keybuffer[Client] & ~IN_ATTACK;
- }
- if(IsValidEdict(weapons) && (StrEqual(WeaponName, "weapon_hegrenade", false) || StrEqual(WeaponName, "weapon_smokegrenade", false) || StrEqual(WeaponName, "weapon_flashbang", false)))
- {
- new Float:Delay = 999.9;
- SetEntDataFloat(weapons, g_NextPrimaryAttack, FloatAdd(GetGameTime(), Delay), true);
- }
- if(IsValidEdict(weapons) && (RPG[weapons] || Crossbow[weapons]))
- {
- new Float:Delay = 999.9;
- SetEntDataFloat(weapons, g_NextPrimaryAttack, FloatAdd(GetGameTime(), Delay), true);
- if(RPG[weapons] && GetClientiClip2(weapons, Client) > 1)
- SetClientiClip2(weapons, Client, 0);
- if(AttackDelay[Client] == 1)
- {
- if(RPG[weapons])
- {
- if(GetClientiClip2(weapons, Client) && !GetEntProp(weapons, Prop_Send, "m_iClip1"))
- {
- AttackDelay[Client] = 2;
- ReloadCount[Client] = 20;
- CreateTimer(0.1, Reloading, Client, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
- }
- }
- if(Crossbow[weapons])
- {
- if(GetClientiClip2(weapons, Client) && !GetEntProp(weapons, Prop_Send, "m_iClip1"))
- {
- AttackDelay[Client] = 2;
- ReloadCount[Client] = 6;
- CreateTimer(0.1, Reloading, Client, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
- }
- }
- }
- if(buttons & IN_ATTACK)
- {
- if(AttackDelay[Client] == 1)
- {
- if(RPG[weapons])
- {
- 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)
- {
- AttackDelay[Client] = 0;
- CreateTimer(0.0, Missile, Client);
- CreateTimer(1.0, AttackDelayed, Client);
- SetEntProp(Client, Prop_Send, "m_iShotsFired", 1);
- SetEntProp(weapons, Prop_Send, "m_iClip1", GetEntProp(weapons, Prop_Send, "m_iClip1")-1);
- SetEntProp(Client, Prop_Send, "m_iFOV", 90);
- SetEntProp(Client, Prop_Send, "m_iFOVStart", 90);
- SetEntProp(ClientVM[Client][0], Prop_Send, "m_nSequence", 0);
- SetEntProp(ClientVM[Client][1], Prop_Send, "m_nSequence", 0);
- new Float:vecPunch[3] = {-22.5, 0.0, 0.0};
- SetEntDataVector(Client, offsPunchAngle, vecPunch);
- ClientCommand(Client, "r_screenoverlay \"\"");
- }
- }
- if(Crossbow[weapons])
- {
- if(!GetEntProp(Client, Prop_Send, "m_iShotsFired") && GetEntProp(weapons, Prop_Send, "m_iClip1") > 0)
- {
- AttackDelay[Client] = 0;
- /*****Bolt*****/
- new Float:cleyepos[3], Float:cleyeangle[3], Float:resultposition[3], target, hitgroup = -1;
- GetClientEyePosition(Client, cleyepos);
- GetClientEyeAngles(Client, cleyeangle);
- new Handle:traceresulthandle = INVALID_HANDLE;
- traceresulthandle = TR_TraceRayFilterEx(cleyepos, cleyeangle, MASK_SHOT, RayType_Infinite, tracerayfilternotarrow, Client);
- if(TR_DidHit(traceresulthandle) == true)
- {
- TR_GetEndPosition(resultposition, traceresulthandle);
- new Float:vecmin[3] = {-0.5, -0.5, -8.0}, Float:vecmax[3] = {0.5, 0.5, 0.0};
- new Handle:traceresulthandle2 = TR_TraceHullFilterEx(cleyepos, resultposition, vecmin, vecmax, MASK_PLAYERSOLID, tracerayfilternotarrow, Client);
- target = TR_GetEntityIndex(traceresulthandle2);
- if(!target) target = TR_GetEntityIndex(traceresulthandle);
- if(JoinCheck(target))
- {
- hitgroup = TR_GetHitGroup(traceresulthandle);
- if(!hitgroup) hitgroup = 1;
- }
- CloseHandle(traceresulthandle2);
- }
- CloseHandle(traceresulthandle);
- new entity = CreateEntityByName("hegrenade_projectile");
- DispatchSpawn(entity);
- SetEntityMoveType(entity, MOVETYPE_NONE);
- SetEntityModel(entity, "models/aoc_weapon/aoc_arrow.mdl");
- TeleportEntity(entity, resultposition, cleyeangle, NULL_VECTOR);
- SetEntPropEnt(entity, Prop_Send, "m_hOwnerEntity", Client);
- SetEntProp(entity, Prop_Send, "m_CollisionGroup", 2);
- new Float:vecmax[3] = {0.0001, 0.0001, 0.0001};
- new Float:vecmin[3] = {-0.0001, -0.0001, -0.0001};
- SetEntPropVector(entity, Prop_Send, "m_vecMins", vecmin);
- SetEntPropVector(entity, Prop_Send, "m_vecMaxs", vecmax);
- EmitSoundToAll("weapons/crossbow/fire1.wav", Client);
- EmitSoundToAll("weapons/crossbow/bolt_fly4.wav", entity);
- if(JoinCheck(target))
- {
- if(hitgroup == 1) makeDamage(Client, target, 300, DMG_GENERIC, 0.0, resultposition, "Crossbow");
- else makeDamage(Client, target, 60, DMG_GENERIC, 0.0, resultposition, "Crossbow");
- EmitSoundToAll("weapons/crossbow/hitbod1.wav", entity, SNDCHAN_WEAPON, SNDLEVEL_NORMAL, SND_NOFLAGS, 1.0, SNDPITCH_NORMAL, -1, resultposition);
- AcceptEntityInput(entity, "Kill");
- }
- else if(!target || entityTypeCheck(target))
- {
- EmitSoundToAll("weapons/crossbow/hit1.wav", entity, SNDCHAN_WEAPON, SNDLEVEL_NORMAL, SND_NOFLAGS, 1.0, SNDPITCH_NORMAL, -1, resultposition);
- SetEntityMoveType(entity, MOVETYPE_NONE);
- SetEntData(entity, CollOff, 2, 4, true);
- CreateTimer(30.0, DeleteEntity, entity);
- if(entityTypeCheck(target))
- {
- SetVariantString("!activator");
- AcceptEntityInput(entity, "SetParent", target, entity, 0);
- if(GetEntProp(target, Prop_Data, "m_iHealth") && GetEntProp(target, Prop_Data, "m_iHealth") <= 200) AcceptEntityInput(target, "Break", Client, target);
- 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"));
- }
- }
- else CreateTimer(30.0, DeleteEntity, entity);
- /***************/
- CreateTimer(0.1, AttackDelayed, Client);
- SetEntProp(weapons, Prop_Send, "m_iClip1", GetEntProp(weapons, Prop_Send, "m_iClip1")-1);
- SetEntProp(Client, Prop_Send, "m_iFOV", 90);
- SetEntProp(Client, Prop_Send, "m_iFOVStart", 90);
- SetEntProp(ClientVM[Client][0], Prop_Send, "m_nSequence", 0);
- SetEntProp(ClientVM[Client][1], Prop_Send, "m_nSequence", 0);
- new Float:vecPunch[3];
- vecPunch[0] =GetRandomFloat(-5.0, 5.0);
- vecPunch[1] = GetRandomFloat(-5.0, 5.0);
- SetEntDataVector(Client, offsPunchAngle, vecPunch);
- }
- }
- }
- }
- else
- {
- SetEntProp(Client, Prop_Send, "m_iShotsFired", 0);
- }
- if(RPG[weapons])
- {
- if(AttackDelay[Client] == 2)
- {
- if(ReloadCount[Client] > 0)
- {
- SetEntProp(ClientVM[Client][0], Prop_Send, "m_nSequence", 3);
- SetEntProp(ClientVM[Client][1], Prop_Send, "m_nSequence", 3);
- }
- }
- else if(!AttackDelay[Client])
- {
- SetEntProp(ClientVM[Client][0], Prop_Send, "m_nSequence", 2);
- SetEntProp(ClientVM[Client][1], Prop_Send, "m_nSequence", 2);
- }
- else
- {
- SetEntProp(ClientVM[Client][0], Prop_Send, "m_nSequence", 0);
- SetEntProp(ClientVM[Client][1], Prop_Send, "m_nSequence", 0);
- }
- }
- if(Crossbow[weapons])
- {
- if(AttackDelay[Client] == 2)
- {
- if(ReloadCount[Client] > 0)
- {
- SetEntProp(ClientVM[Client][0], Prop_Send, "m_nSequence", 4);
- SetEntProp(ClientVM[Client][1], Prop_Send, "m_nSequence", 4);
- }
- }
- else if(!AttackDelay[Client])
- {
- if(GetEntProp(weapons, Prop_Send, "m_iClip1") > 0)
- {
- SetEntProp(ClientVM[Client][0], Prop_Send, "m_nSequence", 0);
- SetEntProp(ClientVM[Client][1], Prop_Send, "m_nSequence", 0);
- }
- else
- {
- SetEntProp(ClientVM[Client][0], Prop_Send, "m_nSequence", 1);
- SetEntProp(ClientVM[Client][1], Prop_Send, "m_nSequence", 1);
- }
- }
- else
- {
- if(GetEntProp(weapons, Prop_Send, "m_iClip1") > 0)
- {
- SetEntProp(ClientVM[Client][0], Prop_Send, "m_nSequence", 0);
- SetEntProp(ClientVM[Client][1], Prop_Send, "m_nSequence", 0);
- }
- else
- {
- SetEntProp(ClientVM[Client][0], Prop_Send, "m_nSequence", 1);
- SetEntProp(ClientVM[Client][1], Prop_Send, "m_nSequence", 1);
- }
- }
- }
- }
- if((buttons & IN_ATTACK2))
- {
- if(StrEqual(WeaponName, "weapon_awp", false) && RPG[weapons])
- {
- RPGFOV[Client] = GetEntProp(Client, Prop_Send, "m_iFOV");
- if(!RPGFOV[Client] || RPGFOV[Client] == 90) ClientCommand(Client, "r_screenoverlay \"\"");
- else ClientCommand(Client, "r_screenoverlay \"%s\"", "Effects/combine_binocoverlay.vmt");
- }
- }
- if((buttons & IN_ATTACK2) && !(keybuffer[Client] & IN_ATTACK2))
- {
- keybuffer[Client] = keybuffer[Client] | IN_ATTACK2;
- if(StrEqual(WeaponName, "weapon_c4"))
- {
- SetEntProp(ClientVM[Client][1], Prop_Send, "m_nSequence", 0);
- ReloadCount[Client] = 25;
- }
- if(grabbedentref[Client] == INVALID_ENT_REFERENCE)
- {
- if(teamcanusegravitygun(GetClientTeam(Client)) && g_bIsWeaponGrabber[Client])
- {
- grab(Client);
- }
- }
- else
- {
- release(Client);
- }
- if(StrEqual(WeaponName, "weapon_hegrenade", false) && Teleporter[weapons])
- {
- if(!(buttons & IN_DUCK))
- {
- if(GetEntityFlags(Client) & FL_ONGROUND)
- {
- GetClientAbsOrigin(Client, TeleporterPosition[Client]);
- GetClientEyeAngles(Client, TeleporterAngle[Client]);
- if(!TeleporterSavedPosition[Client]) TeleporterSavedPosition[Client] = true;
- PrintChat(Client, "\x07FFFFFF%T", "Saved Position", Client);
- }
- else PrintChat(Client, "\x07FFFFFF%T", "Only Ground", Client);
- }
- else PrintChat(Client, "\x07FFFFFF%T", "No duck", Client);
- }
- }
- else if(!(buttons & IN_ATTACK2) && keybuffer[Client] & IN_ATTACK2)
- {
- keybuffer[Client] = keybuffer[Client] & ~IN_ATTACK2;
- }
- if(!(buttons & IN_ATTACK) && keybuffer[Client] & IN_ATTACK)
- {
- keybuffer[Client] = keybuffer[Client] & ~IN_ATTACK;
- }
- }
- if(DNAScanning[Client])
- {
- if(!IsPlayerAlive(Client))
- {
- DNAScanning[Client] = false;
- }
- }
- }
- public Action:CloseDoor(Handle:timer, any:Entity)
- {
- if(IsValidEdict(Entity)) AcceptEntityInput(Entity, "Close");
- }
- public Action:Teleporting(Handle:timer, any:Client)
- {
- if(JoinCheck(Client) && IsPlayerAlive(Client) && TeleportSuccess[Client] && (!roundstart || chosen))
- {
- SetEntityMoveType(Client, MOVETYPE_WALK);
- new Float:NowPosition[3];
- GetClientAbsOrigin(Client, NowPosition);
- TeleportCount[GetEntPropEnt(Client, Prop_Data, "m_hActiveWeapon")] -= 1;
- TeleporterDelay[Client] = false;
- new Float:zerovelocity[3];
- TeleportEntity(Client, TeleporterPosition[Client], TeleporterAngle[Client], zerovelocity);
- SetEntPropFloat(Client, Prop_Send, "m_flProgressBarStartTime", 0.0);
- SetEntProp(Client, Prop_Send, "m_iProgressBarDuration", 0);
- PrintChat(Client, "\x07FFFFFF%T \x04: \x07FF3A3A%i", "Remain Teleport Count", Client, TeleportCount[GetEntPropEnt(Client, Prop_Data, "m_hActiveWeapon")]);
- }
- else if(roundstart && !chosen)
- {
- SetEntPropFloat(Client, Prop_Send, "m_flProgressBarStartTime", 0.0);
- SetEntProp(Client, Prop_Send, "m_iProgressBarDuration", 0);
- }
- Teleport[Client] = INVALID_HANDLE;
- }
- public Action:Reloading(Handle:timer, any:Client)
- {
- if(JoinCheck(Client) && IsValidEdict(GetEntPropEnt(Client, Prop_Data, "m_hActiveWeapon")))
- {
- new weapons = GetEntPropEnt(Client, Prop_Data, "m_hActiveWeapon");
- decl String:weaponname[64];
- GetEdictClassname(weapons, weaponname, sizeof(weaponname));
- if(!GetEntProp(weapons, Prop_Send, "m_iClip1"))
- {
- if((StrEqual(weaponname, "weapon_awp", false) || StrEqual(weaponname, "weapon_aug")) && IsValidEdict(weapons))
- {
- if(ReloadCount[Client] > 0)
- {
- ReloadCount[Client] -= 1;
- if(!ReloadCount[Client])
- {
- if(StrEqual(weaponname, "weapon_aug")) EmitSoundToAll("weapons/crossbow/bolt_load1.wav", Client);
- }
- }
- else
- {
- if(GetClientiClip2(weapons, Client) > 0) SetClientiClip2(weapons, Client, GetClientiClip2(weapons, Client)-1);
- SetEntProp(weapons, Prop_Send, "m_iClip1", 1);
- AttackDelay[Client] = 1;
- if(StrEqual(weaponname, "weapon_awp")) CreateTimer(0.0, AttackDelayed_FOV, Client);
- return Plugin_Stop;
- }
- }
- else return Plugin_Stop;
- }
- else return Plugin_Stop;
- }
- else return Plugin_Stop;
- return Plugin_Continue;
- }
- public Action:AttackDelayed_FOV(Handle:timer, any:Client)
- {
- if(JoinCheck(Client) && IsValidEdict(GetEntPropEnt(Client, Prop_Data, "m_hActiveWeapon")))
- {
- new weapons = GetEntPropEnt(Client, Prop_Data, "m_hActiveWeapon");
- decl String:weaponname[64];
- GetEdictClassname(weapons, weaponname, sizeof(weaponname));
- if((StrEqual(weaponname, "weapon_awp", false) || StrEqual(weaponname, "weapon_aug")) && IsValidEdict(weapons))
- {
- SetEntProp(Client, Prop_Send, "m_iFOV", RPGFOV[Client]);
- SetEntProp(Client, Prop_Send, "m_iFOVStart", RPGFOV[Client]);
- if(RPGFOV[Client] && RPGFOV[Client] < 90) ClientCommand(Client, "r_screenoverlay \"%s\"", "Effects/combine_binocoverlay.vmt");
- else ClientCommand(Client, "r_screenoverlay \"\"");
- }
- }
- }
- public Action:AttackDelayed(Handle:timer, any:Client)
- {
- if(JoinCheck(Client) && IsValidEdict(GetEntPropEnt(Client, Prop_Data, "m_hActiveWeapon")))
- {
- new weapons = GetEntPropEnt(Client, Prop_Data, "m_hActiveWeapon");
- decl String:weaponname[64];
- GetEdictClassname(weapons, weaponname, sizeof(weaponname));
- if((StrEqual(weaponname, "weapon_awp", false) || StrEqual(weaponname, "weapon_aug")) && IsValidEdict(weapons))
- {
- AttackDelay[Client] = 1;
- }
- }
- }
- public Action:HealDelay_Timer(Handle:timer, any:Client)
- {
- if(JoinCheck(Client))
- {
- HealDelay[Client] = false;
- }
- }
- public Action:HealSoundDelay_Timer(Handle:timer, any:Client)
- {
- if(JoinCheck(Client))
- {
- HealSoundDelay[Client] = false;
- }
- }
- public Action:DNAScanCheck(Handle:timer, Handle:pack)
- {
- ResetPack(pack);
- new Target = ReadPackCell(pack);
- new Client = ReadPackCell(pack);
- new RagdollEntity = ReadPackCell(pack);
- if(JoinCheck(Client))
- {
- if(DNAScanning[Client])
- {
- if(DNAScanCount[Client] >= 30)
- {
- if(JoinCheck(Target))
- {
- new Float:Pos[3];
- if(IsPlayerAlive(Target)) GetClientAbsOrigin(Target, Pos);
- else GetEntPropVector(EntIndexToEntRef(Ragdoll[Target]), Prop_Send, "m_vecOrigin", Pos);
- Pos[2] += 40.0;
- if(DNASprites[Client] && IsValidEntity(DNASprites[Client]) && IsValidEdict(DNASprites[Client]) && IsValidEntity(info_target[DNASprites[Client]]) && IsValidEdict(info_target[DNASprites[Client]]))
- {
- if(JammerEntity[Target] && IsValidEdict(JammerEntity[Target]) && IsValidEntity(JammerEntity[Target]))
- {
- new Float:entityposition[3];
- GetEntPropVector(JammerEntity[Target], Prop_Send, "m_vecOrigin", entityposition);
- TeleportEntity(info_target[DNASprites[Client]], entityposition, NULL_VECTOR, NULL_VECTOR);
- }
- else
- {
- TeleportEntity(info_target[DNASprites[Client]], Pos, NULL_VECTOR, NULL_VECTOR);
- }
- }
- else
- {
- if(JammerEntity[Target] && IsValidEdict(JammerEntity[Target]) && IsValidEntity(JammerEntity[Target]))
- {
- GetEntPropVector(JammerEntity[Target], Prop_Send, "m_vecOrigin", Pos);
- }
- new sprite = CreateVMT(Client, Pos, "materials/effects/strider_bulge_dudv_DX60.vmt", 0.25, false);
- DNASprites[Client] = sprite;
- SDKHook(sprite, SDKHook_SetTransmit, Hook_SetTransmit2);
- info_target[sprite] = CreateEntityByName("info_target");
- if(DispatchSpawn(info_target[sprite]))
- {
- TeleportEntity(info_target[sprite], Pos, NULL_VECTOR, NULL_VECTOR);
- SetVariantString("!activator");
- AcceptEntityInput(sprite, "SetParent", info_target[sprite], sprite, 0);
- }
- }
- DNAScanCount[Client] = 0;
- }
- else
- {
- if(Job[Client] == detector && Sprites[Client] && IsValidEntity(Sprites[Client]) && IsValidEdict(Sprites[Client]))
- {
- AcceptEntityInput(Sprites[Client], "Kill");
- }
- DNASample[Client][0] = "";
- DNASample[Client][1] = "";
- PrintChat(Client, "\x07C53AC5A person\x07FFFF3A is not in the server.");
- DNAScanning[Client] = false;
- DNAScanTimer[Client] = INVALID_HANDLE;
- return Plugin_Stop;
- }
- }
- else
- {
- if(JoinCheck(Target))
- {
- new Float:Pos[3], Float:Pos2[3];
- GetClientEyePosition(Target, Pos);
- GetClientEyePosition(Client, Pos2);
- if(!IsPlayerAlive(Target))
- {
- GetEntPropVector(Ragdoll[Target], Prop_Send, "m_vecOrigin", Pos);
- }
- if(JammerEntity[Target] && IsValidEdict(JammerEntity[Target]) && IsValidEntity(JammerEntity[Target]))
- {
- GetEntPropVector(JammerEntity[Target], Prop_Send, "m_vecOrigin", Pos);
- }
- if(GetVectorDistance(Pos, Pos2, false) <= 1000.0) DNAScanCount[Client] += 1;
- if(GetVectorDistance(Pos, Pos2, false) <= 750.0) DNAScanCount[Client] += 1;
- if(GetVectorDistance(Pos, Pos2, false) <= 400.0) DNAScanCount[Client] += 1;
- if(GetVectorDistance(Pos, Pos2, false) <= 200.0) DNAScanCount[Client] += 1;
- DNAScanCount[Client] += 1;
- }
- else if(IsValidEdict(RagdollEntity) && IsValidEntity(RagdollEntity))
- {
- new Float:Pos[3], Float:Pos2[3];
- GetClientEyePosition(Client, Pos2);
- GetEntPropVector(RagdollEntity, Prop_Send, "m_vecOrigin", Pos);
- if(GetVectorDistance(Pos, Pos2, false) <= 1000.0) DNAScanCount[Client] += 1;
- if(GetVectorDistance(Pos, Pos2, false) <= 750.0) DNAScanCount[Client] += 1;
- if(GetVectorDistance(Pos, Pos2, false) <= 400.0) DNAScanCount[Client] += 1;
- if(GetVectorDistance(Pos, Pos2, false) <= 200.0) DNAScanCount[Client] += 1;
- DNAScanCount[Client] += 1;
- }
- else
- {
- PrintChat(Client, "Cant find\x07C53AC5DNA\x07FFFF3A.");
- DNAScanning[Client] = false;
- DNAScanTimer[Client] = INVALID_HANDLE;
- return Plugin_Stop;
- }
- }
- }
- else
- {
- DNAScanTimer[Client] = INVALID_HANDLE;
- return Plugin_Stop;
- }
- }
- else
- {
- DNAScanTimer[Client] = INVALID_HANDLE;
- return Plugin_Stop;
- }
- return Plugin_Continue;
- }
- public Action:DeleteEntity(Handle:timer, any:entity)
- {
- if(IsValidEntity(entity) && IsValidEdict(entity))
- {
- new String:classname[32];
- GetEdictClassname(entity, classname, 32);
- if(StrEqual(classname, "hegrenade_projectile", false) || StrContains(classname, "rope", false) != -1) AcceptEntityInput(entity, "Kill");
- }
- }
- public Action:OnTakeDamageHook(Client, &attacker, &inflictor, &Float:damage, &damagetype)
- {
- if(damagetype & DMG_CRUSH && JoinCheck(attacker)) return Plugin_Handled;
- if(!chosen && roundstart)
- {
- return Plugin_Handled;
- }
- if(JoinCheck(Client))
- {
- if(!attacker && KnockBackAttacker[Client])
- {
- attacker = KnockBackAttacker[Client];
- KnockBackAttacker[Client] = 0;
- return Plugin_Changed;
- }
- if(IronShoes[Client] && damagetype & DMG_FALL)
- {
- damage *= 0.3;
- return Plugin_Changed;
- }
- if(damagetype & DMG_BURN)
- {
- if(damage <= 1.0) attacker = BurnOwner[Client];
- damage *= 2.0;
- return Plugin_Changed;
- }
- }
- return Plugin_Continue;
- }
- public Action:OnTraceAttack(Client, &attacker, &inflictor, &Float:damage, &damagetype, &ammotype, hitbox, hitgroup)
- {
- if(JoinCheck(Client) && JoinCheck(attacker))
- {
- if(!chosen && roundstart)
- {
- return Plugin_Handled;
- }
- if(GetClientTeam(Client) == GetClientTeam(attacker))
- {
- damage *= 3.0;
- }
- new String:WeaponName[256];
- GetClientWeapon(attacker, WeaponName, 256);
- if(RoundToNearest(damage) >= 150 && StrEqual(WeaponName, "weapon_knife") && !Dagger[attacker] && !(damagetype & DMG_BLAST))
- {
- new Float:attackerposition[3], Float:clientposition[3], Float:vector[3];
- GetClientEyePosition(Client, clientposition);
- GetClientEyePosition(attacker, attackerposition);
- MakeVectorFromPoints(attackerposition, clientposition, vector);
- NormalizeVector(vector, vector);
- if(SuperCrowbar[attacker]) ScaleVector(vector, 1000.0);
- else ScaleVector(vector, 250.0);
- TeleportEntity(Client, NULL_VECTOR, NULL_VECTOR, vector);
- KnockBackAttacker[Client] = attacker;
- KnockBackAttackerDelay[Client] = 0;
- return Plugin_Handled;
- }
- if(damagetype & DMG_BULLET && !StrEqual(WeaponName, "weapon_awp") && !StrEqual(WeaponName, "weapon_scout") && !StrEqual(WeaponName, "weapon_knife"))
- {
- damage *= 0.7;
- }
- if(damagetype & DMG_BULLET && StrEqual(WeaponName, "weapon_awp"))
- {
- damage *= 0.9;
- if(Silenced_Sniper_Rifle[GetEntPropEnt(attacker, Prop_Data, "m_hActiveWeapon")])
- {
- damage *= 0.55;
- }
- }
- if(StrEqual(WeaponName, "weapon_ump45") && !(damagetype & DMG_BLAST))
- {
- damage *= 0.7;
- }
- if(StrEqual(WeaponName, "weapon_p228") && !(damagetype & DMG_BLAST))
- {
- IgniteEntity(Client, 4.0, false, 3.0, false);
- BurnOwner[Client] = attacker;
- return Plugin_Handled;
- }
- if(StrEqual(WeaponName, "weapon_elite") && !(damagetype & DMG_BLAST))
- {
- if(hitgroup == 1) damage *= 0.65;
- damage *= 0.85;
- }
- if(StrEqual(WeaponName, "weapon_usp") && !(damagetype & DMG_BLAST))
- {
- if(hitgroup != 1) damage += 17.5;
- }
- if(StrEqual(WeaponName, "weapon_tmp") && !(damagetype & DMG_BLAST))
- {
- if(TVirus[GetEntPropEnt(attacker, Prop_Data, "m_hActiveWeapon")])
- {
- if(TVirusTimer[Client] == INVALID_HANDLE)
- {
- CreateTimer(20.0, GreenFade, Client);
- new Handle:pack = CreateDataPack();
- WritePackCell(pack, Client);
- WritePackCell(pack, attacker);
- TVirusTimer[Client] = CreateTimer(25.0, YouAreZombie, pack, TIMER_DATA_HNDL_CLOSE);
- }
- return Plugin_Handled;
- }
- }
- if(GetEntProp(Client, Prop_Data, "m_ArmorValue"))
- {
- if(damagetype & DMG_BULLET && !StrEqual(WeaponName, "weapon_knife"))
- {
- damage *= 0.9;
- }
- }
- if(StrEqual(WeaponName, "weapon_knife") && !(damagetype & DMG_BLAST))
- {
- if(Dagger[attacker])
- {
- damage = 500.0;
- }
- else if(SuperCrowbar[attacker])
- {
- damage *= 2.0;
- }
- }
- if(StrEqual(WeaponName, "weapon_deagle") && !(damagetype & DMG_BLAST))
- {
- new weapons = GetPlayerWeaponSlot(attacker, 1);
- if(GoldenGun[weapons])
- {
- if(Job[Client] == traitor && !StrEqual(TraitorKillList[Client], ""))
- {
- new Float:Position[3];
- makeDamage(attacker, Client, 500, DMG_BULLET, 0.0, Position, "GoldenGun");
- return Plugin_Handled;
- }
- else damage = 0.0;
- }
- }
- if(Client != attacker) LastAttacker = attacker;
- return Plugin_Changed;
- }
- return Plugin_Continue;
- }
- public Action:RagdollTakeDamageHook(ragdoll, &attacker, &inflictor, &Float:damage, &damagetype)
- {
- if(IsValidEntity(ragdoll) && IsValidEdict(ragdoll))
- {
- if(JoinCheck(attacker))
- {
- new String:Weaponname[256];
- GetClientWeapon(attacker, Weaponname, 256);
- if(StrEqual(Weaponname, "weapon_p228", false))
- {
- //AcceptEntityInput(ragdoll, "Ignite");
- new Float:rand = GetRandomFloat(2.0, 3.0);
- IgniteEntity(ragdoll, rand, _, 5.0);
- CreateTimer(rand, RemoveRagdoll, ragdoll);
- }
- for(new i; i<4; i++)
- {
- if(Wire[ragdoll][i][0] && Wire[ragdoll][i][1] && Wire[ragdoll][i][2] && IsValidEdict(Wire[ragdoll][i][1]) && IsValidEdict(Wire[ragdoll][i][2]))
- {
- AcceptEntityInput(Wire[ragdoll][i][0], "Kill");
- AcceptEntityInput(Wire[ragdoll][i][1], "Break");
- AcceptEntityInput(Wire[ragdoll][i][2], "Break");
- CreateTimer(1.0, DeleteEntity, Wire[ragdoll][i][1]);
- CreateTimer(1.0, DeleteEntity, Wire[ragdoll][i][2]);
- IsRope[Wire[ragdoll][i][1]] = false;
- IsRope[Wire[ragdoll][i][2]] = false;
- Wire[ragdoll][i][0] = 0;
- Wire[ragdoll][i][1] = 0;
- Wire[ragdoll][i][2] = 0;
- }
- }
- }
- }
- else SDKUnhook(ragdoll, SDKHook_OnTakeDamage, RagdollTakeDamageHook);
- return Plugin_Continue;
- }
- public Action:ZombieDamageHook(monster, &attacker, &inflictor, &Float:damage, &damagetype)
- {
- decl String:tmp[32];
- GetEntPropString(monster, Prop_Data, "m_iName", tmp, sizeof(tmp));
- new monster_tmp = StringToInt(tmp);
- new Roll = GetRandomInt(1, 3);
- if(Roll == 1) SetVariantString("FlinchC");
- if(Roll == 2) SetVariantString("FlinchL");
- else SetVariantString("FlinchR");
- AcceptEntityInput(monster_tmp, "SetAnimation");
- decl String:soundfile[32], bool:check;
- Format(soundfile, sizeof(soundfile), "npc/zombie/zombie_pain%i.wav", GetRandomInt(1, 6));
- if(JoinCheck(attacker))
- {
- new weapons = GetEntPropEnt(attacker, Prop_Data, "m_hActiveWeapon"), String:WeaponName[256];
- if(weapons != -1) GetEdictClassname(weapons, WeaponName, 256);
- if(StrEqual(WeaponName, "weapon_knife") && !(damagetype & DMG_BLAST))
- {
- if(Dagger[attacker])
- {
- damage = 9999.0;
- check = true;
- }
- }
- }
- if(BaseNPC_Hurt(monster, attacker, RoundToZero(damage), soundfile))
- {
- if(Dagger[attacker] && check)
- {
- Dagger[attacker] = false;
- new weapons = GetPlayerWeaponSlot(attacker, 2);
- if(IsValidEdict(weapons))
- {
- RemovePlayerItem(attacker, weapons);
- RemoveEdict(weapons);
- }
- GivePlayerItem(attacker, "weapon_knife");
- }
- SDKUnhook(monster, SDKHook_OnTakeDamage, ZombieDamageHook);
- BaseNPC_Death(monster);
- decl Float:position[3];
- GetEntPropVector(monster, Prop_Send, "m_vecOrigin", position);
- EmitSoundToAll("npc/zombie/zombie_die1.wav", 0, SNDCHAN_AUTO, SNDLEVEL_NORMAL, SND_NOFLAGS, SNDVOL_NORMAL, SNDPITCH_NORMAL, -1, position);
- }
- return Plugin_Handled;
- }
- public Action:RemoveRagdoll(Handle:timer, any:ragdoll)
- {
- if(IsValidEdict(ragdoll) && IsValidEntity(ragdoll))
- {
- new Float:entityposition[3];
- GetEntPropVector(ragdoll, Prop_Send, "m_vecOrigin", entityposition);
- //AcceptEntityInput(ragdoll, "Kill");
- IsRagdoll[ragdoll] = false;
- SetEntityRenderMode(ragdoll, RENDER_TRANSCOLOR);
- SetEntityRenderColor(ragdoll, 255, 255, 255, 0);
- SetEntProp(ragdoll, Prop_Send, "m_CollisionGroup", 1);
- SetEntProp(ragdoll, Prop_Send, "m_nSolidType", 0);
- SDKUnhook(ragdoll, SDKHook_OnTakeDamage, RagdollTakeDamageHook);
- makeExplosion(ragdoll, ragdoll, entityposition, "ragdoll_remove", 0, 0, 0.0, 0x00000004|0x00000008|0x00000020|0x00000100|0x00000200);
- }
- }
- public Action:GreenFade(Handle:timer, any:Client)
- {
- if(JoinCheck(Client) && IsPlayerAlive(Client) && (chosen || !roundstart))
- {
- LastFadeTime[Client] = GetEngineTime();
- IsInfect[Client] = true;
- PerformFade(Client, 2500, {0, 255, 0, 255});
- }
- }
- public Action:YouAreZombie(Handle:timer, Handle:pack)
- {
- ResetPack(pack);
- new Client = ReadPackCell(pack);
- new attacker = ReadPackCell(pack);
- if(JoinCheck(Client) && IsPlayerAlive(Client) && JoinCheck(attacker))
- {
- ChosenJoin[Client] = true;
- new Float:Position[3];
- makeDamage(attacker, Client, 777, (1<<17), 1.0, Position, "T-Virus");
- makeZombie(Client);
- Format(TraitorKillList[attacker], 256, "%s\n%N", TraitorKillList[attacker], Client);
- Time2 += 20;
- EmitSoundToAll("tttmusic/biohazard_detected.wav");
- if(Job[Client] == detector)
- {
- for(new i = 1; i <= MaxClients; i++)
- {
- if(IsClientInGame(i))
- {
- if(Job[i] == traitor && IsPlayerAlive(i))
- {
- Credit[i] += 1;
- PrintChat(i, "\x0787CEEB%T", "received credit for killing", i, JobName[Job[i]], i);
- }
- }
- }
- }
- }
- TVirusTimer[Client] = INVALID_HANDLE;
- }
- public CreditShop(Client)
- {
- new Handle:menuhandle = CreateMenu(CreditShop_CallBack);
- SetMenuTitle(menuhandle, "-- %T --", "Credit Shop", Client);
- new String:Translate_Formatting[256];
- Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Body Armor", Client, "Passive Equipment", Client, "Armor Description", Client, 1, "Credit", Client);
- if(GetEntProp(Client, Prop_Data, "m_ArmorValue")) AddMenuItem(menuhandle, "Body Armor", Translate_Formatting, ITEMDRAW_DISABLED);
- else AddMenuItem(menuhandle, "Body Armor", Translate_Formatting);
- AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Iron Shoes", Client, "Passive Equipment", Client, "Iron Shoes Description", Client, 1, "Credit", Client);
- if(IronShoes[Client]) AddMenuItem(menuhandle, "Iron Shoes", Translate_Formatting, ITEMDRAW_DISABLED);
- else AddMenuItem(menuhandle, "Iron Shoes", Translate_Formatting);
- AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- if(Dagger[Client] || SuperCrowbar[Client])
- {
- 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);
- AddMenuItem(menuhandle, "Knife", Translate_Formatting, ITEMDRAW_DISABLED);
- }
- else if(BuyDagger[Client])
- {
- 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);
- AddMenuItem(menuhandle, "Knife", Translate_Formatting, ITEMDRAW_DISABLED);
- }
- else
- {
- Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Knife", Client, "Weapon", Client, "Knife Description", Client, 1, "Credit", Client);
- AddMenuItem(menuhandle, "Knife", Translate_Formatting);
- }
- Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Dual Elite", Client, "Weapon", Client, "Dual Elite Description", Client, 1, "Credit", Client);
- AddMenuItem(menuhandle,"Dual Elite", Translate_Formatting);
- AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Health Station", Client, "Active Equipment", Client, "Health Station Description", Client, 1, "Credit", Client);
- AddMenuItem(menuhandle, "Health Station", Translate_Formatting);
- AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- if(Radar[Client])
- {
- Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Radar", Client, "Passive Equipment", Client, "Radar Description", Client, 1, "Credit", Client);
- AddMenuItem(menuhandle, "Radar", Translate_Formatting, ITEMDRAW_DISABLED);
- }
- else
- {
- Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Radar", Client, "Passive Equipment", Client, "Radar Description", Client, 1, "Credit", Client);
- AddMenuItem(menuhandle, "Radar", Translate_Formatting);
- }
- if(SpeedBoots[Client])
- {
- Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Speed Boots", Client, "Passive Equipment", Client, "Speed Boots Description", Client, 1, "Credit", Client);
- AddMenuItem(menuhandle, "Speed Boots", Translate_Formatting, ITEMDRAW_DISABLED);
- }
- else
- {
- Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Speed Boots", Client, "Passive Equipment", Client, "Speed Boots Description", Client, 1, "Credit", Client);
- AddMenuItem(menuhandle, "Speed Boots", Translate_Formatting);
- }
- AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- if(Job[Client] == detector)
- {
- if(chosen && Time1 > 165)
- {
- 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);
- AddMenuItem(menuhandle, "Golden Gun", Translate_Formatting, ITEMDRAW_DISABLED);
- }
- else if(!BuyGoldenGun[Client])
- {
- Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Golden Gun", Client, "Weapon", Client, "Golden Gun Description", Client, 1, "Credit", Client);
- AddMenuItem(menuhandle, "Golden Gun", Translate_Formatting);
- }
- else
- {
- 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);
- AddMenuItem(menuhandle, "Golden Gun", Translate_Formatting, ITEMDRAW_DISABLED);
- }
- AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- if(!BuySG552[Client])
- {
- Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "SG552", Client, "Weapon", Client, "SG552 Description", Client, 1, "Credit", Client);
- AddMenuItem(menuhandle, "SG552", Translate_Formatting);
- }
- else
- {
- 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);
- AddMenuItem(menuhandle, "SG552", Translate_Formatting, ITEMDRAW_DISABLED);
- }
- if(!BuyTeleporter[Client])
- {
- Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Teleporter", Client, "Weapon", Client, "Teleporter Description", Client, 1, "Credit", Client);
- AddMenuItem(menuhandle,"Teleporter", Translate_Formatting);
- }
- else
- {
- 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);
- AddMenuItem(menuhandle,"Teleporter", Translate_Formatting, ITEMDRAW_DISABLED);
- }
- AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- if(!BuyCrossbow[Client])
- {
- //Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Crossbow", Client, "Weapon", Client, "Crossbow Description", Client, 1, "Credit", Client);
- Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Crossbow", Client, "Weapon", Client, "Crossbow Description", Client, 1, "Credit", Client);
- AddMenuItem(menuhandle,"Crossbow", Translate_Formatting);
- }
- else
- {
- //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);
- 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);
- AddMenuItem(menuhandle,"Crossbow", Translate_Formatting, ITEMDRAW_DISABLED);
- }
- AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- if(!BuyUMP[Client])
- {
- Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "UMP", Client, "Weapon", Client, "UMP Description", Client, 1, "Credit", Client);
- AddMenuItem(menuhandle,"UMP", Translate_Formatting);
- }
- else
- {
- 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);
- AddMenuItem(menuhandle,"UMP", Translate_Formatting, ITEMDRAW_DISABLED);
- }
- }
- if(Job[Client] == traitor)
- {
- if(!BuyRPG[Client])
- {
- Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "RPG-7", Client, "Weapon", Client, "RPG-7 Description", Client, 1, "Credit", Client);
- AddMenuItem(menuhandle, "RPG-7", Translate_Formatting);
- }
- else
- {
- 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);
- AddMenuItem(menuhandle,"RPG-7", Translate_Formatting, ITEMDRAW_DISABLED);
- }
- AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Silenced Pistol", Client, "Weapon", Client, "Silenced Pistol Description", Client, 1, "Credit", Client);
- AddMenuItem(menuhandle,"Silenced Pistol", Translate_Formatting);
- Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "AWP", Client, "Weapon", Client, "AWP Description", Client, 1, "Credit", Client);
- AddMenuItem(menuhandle,"AWP", Translate_Formatting);
- AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Flare Gun", Client, "Weapon", Client, "Flare Gun Description", Client, 1, "Credit", Client);
- AddMenuItem(menuhandle,"Flare Gun", Translate_Formatting);
- AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Jihad", Client, "Passive Equipment", Client, "Jihad Description", Client, 1, "Credit", Client);
- AddMenuItem(menuhandle,"Jihad", Translate_Formatting);
- 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);
- AddMenuItem(menuhandle, "Fake Health Station", Translate_Formatting);
- AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- if(Dagger[Client] || SuperCrowbar[Client])
- {
- 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);
- AddMenuItem(menuhandle, "Super Crowbar", Translate_Formatting, ITEMDRAW_DISABLED);
- }
- else
- {
- Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Super Crowbar", Client, "Weapon", Client, "Super Crowbar Description", Client, 1, "Credit", Client);
- AddMenuItem(menuhandle, "Super Crowbar", Translate_Formatting);
- }
- AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- if(!Disguise[Client])
- {
- Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Disguise", Client, "Active Equipment", Client, "Disguise Description", Client, 1, "Credit", Client);
- AddMenuItem(menuhandle, "Disguise", Translate_Formatting);
- }
- else
- {
- 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);
- AddMenuItem(menuhandle, "Disguise", Translate_Formatting, ITEMDRAW_DISABLED);
- }
- if(JammerEntity[Client] && IsValidEdict(JammerEntity[Client]) && IsValidEntity(JammerEntity[Client]))
- {
- 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);
- AddMenuItem(menuhandle, "Jammer", Translate_Formatting, ITEMDRAW_DISABLED);
- }
- else
- {
- Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Jammer", Client, "Active Equipment", Client, "Jammer Description", Client, 1, "Credit", Client);
- AddMenuItem(menuhandle, "Jammer", Translate_Formatting);
- }
- AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- if(!BuyTVirus[Client])
- {
- Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "T-Virus", Client, "Weapon", Client, "T-Virus Description", Client, 1, "Credit", Client);
- AddMenuItem(menuhandle,"T-Virus", Translate_Formatting);
- }
- else
- {
- 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);
- AddMenuItem(menuhandle,"T-Virus", Translate_Formatting, ITEMDRAW_DISABLED);
- }
- AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- if(!BuyTeleporter[Client])
- {
- Format(Translate_Formatting, 256, "%T - %T\n%T\n%i%T", "Teleporter", Client, "Weapon", Client, "Teleporter Description", Client, 1, "Credit", Client);
- AddMenuItem(menuhandle,"Teleporter", Translate_Formatting);
- }
- else
- {
- 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);
- AddMenuItem(menuhandle,"Teleporter", Translate_Formatting, ITEMDRAW_DISABLED);
- }
- 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);
- AddMenuItem(menuhandle,"Silenced Sniper Rifle", Translate_Formatting);
- }
- SetMenuExitButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, 10);
- }
- public CreditShop_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:info[256], String:Translate_Formatting[256], bool:bought;
- GetMenuItem(menu, select, info, 256);
- CreateTimer(0.0, AcceptWeaponUse, Client);
- BlockWeaponUse[Client] = true;
- new weapon = GetEntPropEnt(Client, Prop_Data, "m_hActiveWeapon");
- if(StrEqual(info, "Golden Gun", false))
- {
- if(Credit[Client] >= 1)
- {
- Credit[Client] -= 1;
- bought = true;
- if(weapon == GetPlayerWeaponSlot(Client, 1)) BlockWeaponUse[Client] = false;
- new weapons = GetPlayerWeaponSlot(Client, 1);
- if(IsValidEdict(weapons))
- {
- RemovePlayerItem(Client, weapons);
- RemoveEdict(weapons);
- }
- weapons = GivePlayerItem(Client, "weapon_deagle");
- SDKHook(weapons, SDKHook_Think, WeaponWorldModelThink);
- GoldenGun[weapons] = true;
- BuyGoldenGun[Client] = true;
- SetEntProp(weapons, Prop_Send, "m_iClip1", 1);
- SetEntProp(weapons, Prop_Send, "m_iPrimaryAmmoType", 0);
- }
- else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
- }
- if(StrEqual(info, "Body Armor", false))
- {
- if(Credit[Client] >= 1)
- {
- Credit[Client] -= 1;
- bought = true;
- SetEntProp(Client, Prop_Data, "m_ArmorValue", 9999);
- }
- else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
- }
- if(StrEqual(info, "Iron Shoes", false))
- {
- if(Credit[Client] >= 1)
- {
- Credit[Client] -= 1;
- bought = true;
- IronShoes[Client] = true;
- }
- else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
- }
- if(StrEqual(info, "Speed Boots", false))
- {
- if(Credit[Client] >= 1)
- {
- Credit[Client] -= 1;
- bought = true;
- SpeedBoots[Client] = true;
- }
- else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
- }
- if(StrEqual(info, "Radar", false))
- {
- if(Credit[Client] >= 1)
- {
- Credit[Client] -= 1;
- bought = true;
- Radar[Client] = true;
- RadarCount[Client] = 0;
- }
- else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
- }
- if(StrEqual(info, "Knife", false))
- {
- if(Credit[Client] >= 1)
- {
- Credit[Client] -= 1;
- bought = true;
- if(weapon == GetPlayerWeaponSlot(Client, 2)) BlockWeaponUse[Client] = false;
- BuyDagger[Client] = true;
- Dagger[Client] = true;
- new weapons = GetPlayerWeaponSlot(Client, 2);
- if(IsValidEdict(weapons))
- {
- RemovePlayerItem(Client, weapons);
- RemoveEdict(weapons);
- }
- GivePlayerItem(Client, "weapon_knife");
- }
- else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
- }
- if(StrEqual(info, "Dual Elite", false))
- {
- if(Credit[Client] >= 1)
- {
- Credit[Client] -= 1;
- bought = true;
- if(weapon == GetPlayerWeaponSlot(Client, 1)) BlockWeaponUse[Client] = false;
- new weapons = GetPlayerWeaponSlot(Client, 1);
- if(IsValidEdict(weapons))
- {
- RemovePlayerItem(Client, weapons);
- RemoveEdict(weapons);
- }
- weapons = GivePlayerItem(Client, "weapon_elite");
- }
- else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
- }
- if(StrEqual(info, "AWP", false))
- {
- if(Credit[Client] >= 1)
- {
- Credit[Client] -= 1;
- bought = true;
- if(weapon == GetPlayerWeaponSlot(Client, 0)) BlockWeaponUse[Client] = false;
- BuyAcceptWeapon[Client] = true;
- new weapons = GetPlayerWeaponSlot(Client, 0);
- if(IsValidEdict(weapons))
- {
- RemovePlayerItem(Client, weapons);
- RemoveEdict(weapons);
- }
- weapons = GivePlayerItem(Client, "weapon_awp");
- RPG[weapons] = false;
- SetEntProp(weapons, Prop_Send, "m_iClip1", 5);
- SetEntProp(weapons, Prop_Send, "m_iPrimaryAmmoType", 0);
- }
- else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
- }
- if(StrEqual(info, "SG552", false))
- {
- if(Credit[Client] >= 1)
- {
- Credit[Client] -= 1;
- bought = true;
- if(weapon == GetPlayerWeaponSlot(Client, 0)) BlockWeaponUse[Client] = false;
- BuyAcceptWeapon[Client] = true;
- new weapons = GetPlayerWeaponSlot(Client, 0);
- if(IsValidEdict(weapons))
- {
- RemovePlayerItem(Client, weapons);
- RemoveEdict(weapons);
- }
- weapons = GivePlayerItem(Client, "weapon_sg552");
- BuySG552[Client] = true;
- SetEntProp(weapons, Prop_Send, "m_iClip1", 60);
- SetEntProp(weapons, Prop_Send, "m_iPrimaryAmmoType", 0);
- }
- else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
- }
- if(StrEqual(info, "RPG-7", false))
- {
- if(Credit[Client] >= 1)
- {
- Credit[Client] -= 1;
- bought = true;
- if(weapon == GetPlayerWeaponSlot(Client, 0)) BlockWeaponUse[Client] = false;
- BuyAcceptWeapon[Client] = true;
- new weapons = GetPlayerWeaponSlot(Client, 0);
- if(IsValidEdict(weapons))
- {
- RemovePlayerItem(Client, weapons);
- RemoveEdict(weapons);
- }
- weapons = GivePlayerItem(Client, "weapon_awp");
- SDKHook(weapons, SDKHook_Think, WeaponWorldModelThink);
- RPG[weapons] = true;
- SetEntProp(weapons, Prop_Send, "m_iClip1", 1);
- new Handle:pack = CreateDataPack();
- WritePackCell(pack, Client);
- WritePackCell(pack, 1);
- WritePackCell(pack, weapons);
- CreateTimer(0.0, SetClientiClip2_Pre, pack, TIMER_DATA_HNDL_CLOSE);
- RPGFOV[Client] = 90;
- BuyRPG[Client] = true;
- CreateTimer(1.0, AttackDelayed, Client);
- }
- else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
- }
- if(StrEqual(info, "Silenced Pistol", false))
- {
- if(Credit[Client] >= 1)
- {
- Credit[Client] -= 1;
- bought = true;
- if(weapon == GetPlayerWeaponSlot(Client, 1)) BlockWeaponUse[Client] = false;
- new weapons = GetPlayerWeaponSlot(Client, 1);
- if(IsValidEdict(weapons))
- {
- RemovePlayerItem(Client, weapons);
- RemoveEdict(weapons);
- }
- weapons = GivePlayerItem(Client, "weapon_usp");
- }
- else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
- }
- if(StrEqual(info, "Flare Gun", false))
- {
- if(Credit[Client] >= 1)
- {
- Credit[Client] -= 1;
- bought = true;
- if(weapon == GetPlayerWeaponSlot(Client, 1)) BlockWeaponUse[Client] = false;
- new weapons = GetPlayerWeaponSlot(Client, 1);
- if(IsValidEdict(weapons))
- {
- RemovePlayerItem(Client, weapons);
- RemoveEdict(weapons);
- }
- weapons = GivePlayerItem(Client, "weapon_p228");
- SDKHook(weapons, SDKHook_Think, WeaponWorldModelThink);
- SetEntProp(weapons, Prop_Send, "m_iClip1", 4);
- SendProxy_Hook(weapons, "m_iClip1", Prop_Int, Silenced_Think);
- }
- else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
- }
- if(StrEqual(info, "Jihad", false))
- {
- if(!IsJihad[Client])
- {
- if(Credit[Client] >= 1)
- {
- Credit[Client] -= 1;
- bought = true;
- new weapons = GivePlayerItem(Client, "weapon_smokegrenade");
- Jihad[weapons] = true;
- SDKHook(weapons, SDKHook_Think, WeaponWorldModelThink);
- }
- else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
- }
- else PrintChat(Client, "\x05%T", "Jihad was already started", Client);
- }
- if(StrEqual(info, "Super Crowbar", false))
- {
- if(Credit[Client] >= 1)
- {
- Credit[Client] -= 1;
- bought = true;
- SuperCrowbar[Client] = true;
- }
- else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
- }
- if(StrEqual(info, "Disguise", false))
- {
- if(Credit[Client] >= 1)
- {
- Credit[Client] -= 1;
- bought = true;
- Disguise[Client] = true;
- PrintChat(Client, "Use 'H' Key");
- }
- else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
- }
- if(StrEqual(info, "Jammer", false))
- {
- if(Credit[Client] >= 1)
- {
- Credit[Client] -= 1;
- bought = true;
- new weapons = GivePlayerItem(Client, "weapon_smokegrenade");
- DNASignalJammer[weapons] = true;
- }
- else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
- }
- if(StrEqual(info, "T-Virus", false))
- {
- if(Credit[Client] >= 1)
- {
- Credit[Client] -= 1;
- bought = true;
- if(weapon == GetPlayerWeaponSlot(Client, 0)) BlockWeaponUse[Client] = false;
- BuyAcceptWeapon[Client] = true;
- new weapons = GetPlayerWeaponSlot(Client, 0);
- if(IsValidEdict(weapons))
- {
- RemovePlayerItem(Client, weapons);
- RemoveEdict(weapons);
- }
- weapons = GivePlayerItem(Client, "weapon_tmp");
- BuyTVirus[Client] = true;
- TVirus[weapons] = true;
- SetEntProp(weapons, Prop_Send, "m_iClip1", 1);
- SetEntProp(weapons, Prop_Send, "m_iPrimaryAmmoType", 0);
- }
- else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
- }
- if(StrEqual(info, "Teleporter", false))
- {
- if(Credit[Client] >= 1)
- {
- Credit[Client] -= 1;
- bought = true;
- new weapons = GivePlayerItem(Client, "weapon_hegrenade");
- BuyTeleporter[Client] = true;
- TeleporterSavedPosition[Client] = false;
- Teleporter[weapons] = true;
- TeleporterDelay[Client] = false;
- TeleportCount[weapons] = 8;
- SDKHook(weapons, SDKHook_Think, WeaponWorldModelThink);
- }
- else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
- }
- if(StrEqual(info, "Crossbow", false))
- {
- if(Credit[Client] >= 1)
- {
- Credit[Client] -= 1;
- bought = true;
- if(weapon == GetPlayerWeaponSlot(Client, 0)) BlockWeaponUse[Client] = false;
- BuyAcceptWeapon[Client] = true;
- new weapons = GetPlayerWeaponSlot(Client, 0);
- if(IsValidEdict(weapons))
- {
- RemovePlayerItem(Client, weapons);
- RemoveEdict(weapons);
- }
- weapons = GivePlayerItem(Client, "weapon_aug");
- SDKHook(weapons, SDKHook_Think, WeaponWorldModelThink);
- Crossbow[weapons] = true;
- SetEntProp(weapons, Prop_Send, "m_iClip1", 1);
- new Handle:pack = CreateDataPack();
- WritePackCell(pack, Client);
- WritePackCell(pack, 20);
- WritePackCell(pack, weapons);
- CreateTimer(0.0, SetClientiClip2_Pre, pack, TIMER_DATA_HNDL_CLOSE);
- BuyCrossbow[Client] = true;
- CreateTimer(0.5, AttackDelayed, Client);
- }
- else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
- }
- if(StrEqual(info, "UMP", false))
- {
- if(Credit[Client] >= 1)
- {
- Credit[Client] -= 1;
- bought = true;
- if(weapon == GetPlayerWeaponSlot(Client, 0)) BlockWeaponUse[Client] = false;
- BuyAcceptWeapon[Client] = true;
- new weapons = GetPlayerWeaponSlot(Client, 0);
- if(IsValidEdict(weapons))
- {
- RemovePlayerItem(Client, weapons);
- RemoveEdict(weapons);
- }
- weapons = GivePlayerItem(Client, "weapon_ump45");
- UMP[weapons] = true;
- BuyUMP[Client] = true;
- }
- else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
- }
- if(StrEqual(info, "Silenced Sniper Rifle", false))
- {
- if(Credit[Client] >= 1)
- {
- Credit[Client] -= 1;
- bought = true;
- if(weapon == GetPlayerWeaponSlot(Client, 0)) BlockWeaponUse[Client] = false;
- BuyAcceptWeapon[Client] = true;
- new weapons = GetPlayerWeaponSlot(Client, 0);
- if(IsValidEdict(weapons))
- {
- RemovePlayerItem(Client, weapons);
- RemoveEdict(weapons);
- }
- weapons = GivePlayerItem(Client, "weapon_awp");
- SDKHook(weapons, SDKHook_Think, WeaponWorldModelThink);
- Silenced_Sniper_Rifle[weapons] = true;
- SetEntProp(weapons, Prop_Send, "m_iClip1", 10);
- SendProxy_Hook(weapons, "m_iClip1", Prop_Int, Silenced_Think);
- }
- else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
- }
- if(StrEqual(info, "Health Station", false))
- {
- if(Credit[Client] >= 1)
- {
- new weapons = GivePlayerItem(Client, "weapon_flashbang");
- HealthStation[weapons] = true;
- Credit[Client] -= 1;
- bought = true;
- }
- else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
- }
- if(StrEqual(info, "Fake Health Station", false))
- {
- if(Credit[Client] >= 1)
- {
- new entity = Create_Prop(Client, "models/items/item_item_crate.mdl");
- if(entity != -1)
- {
- IsFakeHealthBox[entity] = true;
- FakeHealthBoxOwner[entity] = Client;
- HealthBox[entity] = 150;
- SetVariantInt(400);
- AcceptEntityInput(entity, "SetHealth");
- Credit[Client] -= 1;
- bought = true;
- }
- }
- else PrintChat(Client, "\x0748D1CC%T", "You don't have enough credit!", Client);
- }
- if(bought)
- {
- Format(Translate_Formatting, 256, "\x0748D1CC%T", "Credit_Buy", Client, info, Client, 1, "Credit", Client);
- PrintChat(Client, Translate_Formatting);
- EmitSoundToClient(Client, "ambient/levels/labs/coinslot1.wav", Client);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public Action:Jihad_Explosion(Handle:timer, any:Client)
- {
- if(JoinCheck(Client) && IsPlayerAlive(Client))
- {
- new Float:Position[3];
- GetClientAbsOrigin(Client, Position);
- makeExplosion(Client, -1, Position, "the_jihad", 300, 500, 0.0);
- EmitSoundToAll("tttmusic/big_explosion.wav", Client, SNDCHAN_WEAPON, SNDLEVEL_NORMAL, SND_NOFLAGS, 1.0, SNDPITCH_NORMAL, -1, Position);
- }
- }
- public Present(Client)
- {
- new Handle:menuhandle = CreateMenu(Present_CallBack);
- SetMenuTitle(menuhandle, "ì„ ë¬¼ 메뉴");
- AddMenuItem(menuhandle, "Point", "í¬ì¸íЏ");
- if(IsPlayerAlive(Client)) AddMenuItem(menuhandle, "Credit", "í¬ë ˆë”§");
- else AddMenuItem(menuhandle, "Credit", "í¬ë ˆë”§", ITEMDRAW_DISABLED);
- AddMenuItem(menuhandle, "Item", "ì•„ì´í…œ");
- SetMenuExitButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public Present_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:info[256];
- GetMenuItem(menu, select, info, 256);
- if(StrEqual(info, "Point", false))
- {
- Present2(Client, 0);
- }
- if(StrEqual(info, "Credit", false))
- {
- Present2(Client, 1);
- }
- if(StrEqual(info, "Item", false))
- {
- Present2(Client, 2);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public Present2(Client, type)
- {
- new Handle:menuhandle = CreateMenu(Present2_CallBack), String:Formatting[256], String:Formatting2[256];
- if(type == 1) SetMenuTitle(menuhandle, "íƒ€ê²Ÿì„ ê³ ë¥´ì‹ì‹œì˜¤(í¬ë ˆë”§ ì„ ë¬¼)");
- else if(!type) SetMenuTitle(menuhandle, "íƒ€ê²Ÿì„ ê³ ë¥´ì‹ì‹œì˜¤(í¬ì¸íЏ ì„ ë¬¼)");
- else SetMenuTitle(menuhandle, "íƒ€ê²Ÿì„ ê³ ë¥´ì‹ì‹œì˜¤(ì•„ì´í…œ ì„ ë¬¼)");
- if(type == 1)
- {
- for(new i=1; i<=MaxClients; i++)
- {
- if(JoinCheck(i) && i != Client && (!Ragdoll[i] || !CheckedBody[Ragdoll[i]]))
- {
- Format(Formatting, 256, "%i^%i", type, i);
- Format(Formatting2, 256, "%N", i);
- AddMenuItem(menuhandle, Formatting, Formatting2);
- }
- }
- }
- else
- {
- for(new i=1; i<=MaxClients; i++)
- {
- if(JoinCheck(i) && i != Client)
- {
- Format(Formatting, 256, "%i^%i", type, i);
- Format(Formatting2, 256, "%N", i);
- AddMenuItem(menuhandle, Formatting, Formatting2);
- }
- }
- }
- SetMenuExitButton(menuhandle, true);
- SetMenuExitBackButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public Present2_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:info[256], String:EString[2][64];
- GetMenuItem(menu, select, info, 256);
- ExplodeString(info, "^", EString, 2, 64);
- new type = StringToInt(EString[0]);
- new Target = StringToInt(EString[1]);
- SellPoint[Client] = 0;
- if(type == 1) CreditPresent(Client, Target);
- else if(!type) PointPresent(Client, Target);
- else
- {
- new String:SteamID[256], String:query[512];
- GetClientAuthString(Client, SteamID, 256);
- new Handle:pack = CreateDataPack();
- WritePackCell(pack, Client);
- WritePackCell(pack, Target);
- Format(query, 512, "SELECT * FROM inventory WHERE steamid = '%s' ORDER BY idx ASC;", SteamID);
- SQL_TQuery(databasehandle, ItemPresent, query, pack);
- }
- }
- if(action == MenuAction_Cancel)
- {
- if(select == MenuCancel_ExitBack)
- {
- Present(Client);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public CreditPresent(Client, Target)
- {
- new String:Formatting[256];
- Format(Formatting, 256, "%i", Target);
- new Handle:menuhandle = CreateMenu(CreditPresent_CallBack);
- SetMenuTitle(menuhandle, "%Nì—게 í¬ë ˆë”§ ì„ ë¬¼\n%ií¬ë ˆë”§ì„ ì£¼ì‹œê² ìŠµë‹ˆê¹Œ?", Target, SellPoint[Client]);
- if(SellPoint[Client]) AddMenuItem(menuhandle, Formatting, "네");
- else AddMenuItem(menuhandle, Formatting, "네", ITEMDRAW_DISABLED);
- AddMenuItem(menuhandle, Formatting, "취소");
- if(Credit[Client] >= SellPoint[Client] + 1) AddMenuItem(menuhandle, Formatting, "+1");
- else AddMenuItem(menuhandle, Formatting, "+1", ITEMDRAW_DISABLED);
- if(Credit[Client] >= SellPoint[Client] + 10) AddMenuItem(menuhandle, Formatting, "+10");
- else AddMenuItem(menuhandle, Formatting, "+10", ITEMDRAW_DISABLED);
- if(Credit[Client] >= SellPoint[Client] + 100) AddMenuItem(menuhandle, Formatting, "+100");
- else AddMenuItem(menuhandle, Formatting, "+100", ITEMDRAW_DISABLED);
- if(Credit[Client] >= SellPoint[Client] + 1000) AddMenuItem(menuhandle, Formatting, "+1000");
- else AddMenuItem(menuhandle, Formatting, "+1000", ITEMDRAW_DISABLED);
- if(Credit[Client] >= SellPoint[Client] + 10000) AddMenuItem(menuhandle, Formatting, "+1만");
- else AddMenuItem(menuhandle, Formatting, "+1만", ITEMDRAW_DISABLED);
- if(Credit[Client] >= SellPoint[Client] + 100000) AddMenuItem(menuhandle, Formatting, "+10만");
- else AddMenuItem(menuhandle, Formatting, "+10만", ITEMDRAW_DISABLED);
- if(Credit[Client] >= SellPoint[Client] + 1000000) AddMenuItem(menuhandle, Formatting, "+100만");
- else AddMenuItem(menuhandle, Formatting, "+100만", ITEMDRAW_DISABLED);
- SetMenuPagination(menuhandle, MENU_NO_PAGINATION);
- SetMenuExitButton(menuhandle, false);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public CreditPresent_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- if(IsPlayerAlive(Client))
- {
- new String:StringNumber[256];
- GetMenuItem(menu, select, StringNumber, 256);
- new target = StringToInt(StringNumber);
- if(select == 0)
- {
- Credit[Client] -= SellPoint[Client];
- Credit[target] += SellPoint[Client];
- PrintChat(Client, "\x05ë‹¹ì‹ ì€ %Nì—게 %dí¬ë ˆë”§ì„ 줬습니다.", target, SellPoint[Client]);
- PrintChat(target, "\x05ë‹¹ì‹ ì€ %Nì—게 %dí¬ë ˆë”§ì„ 받았습니다.", Client, SellPoint[Client]);
- }
- if(select == 1)
- {
- Present2(Client, 1);
- }
- if(select >= 2)
- {
- new calcultae = 1;
- for(new i = 2; i < select; i++)
- {
- calcultae *= 10;
- }
- SellPoint[Client] += calcultae;
- }
- if(select > 1)
- {
- CreditPresent(Client, StringToInt(StringNumber));
- }
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public PointPresent(Client, Target)
- {
- new String:Formatting[256];
- Format(Formatting, 256, "%i", Target);
- new Handle:menuhandle = CreateMenu(PointPresent_CallBack);
- SetMenuTitle(menuhandle, "%Nì—게 í¬ì¸íЏ ì„ ë¬¼\n%ií¬ì¸íŠ¸ë¥¼ ì£¼ì‹œê² ìŠµë‹ˆê¹Œ?", Target, SellPoint[Client]);
- if(SellPoint[Client]) AddMenuItem(menuhandle, Formatting, "네");
- else AddMenuItem(menuhandle, Formatting, "네", ITEMDRAW_DISABLED);
- AddMenuItem(menuhandle, Formatting, "취소");
- if(Point[Client] >= SellPoint[Client] + 1) AddMenuItem(menuhandle, Formatting, "+1");
- else AddMenuItem(menuhandle, Formatting, "+1", ITEMDRAW_DISABLED);
- if(Point[Client] >= SellPoint[Client] + 10) AddMenuItem(menuhandle, Formatting, "+10");
- else AddMenuItem(menuhandle, Formatting, "+10", ITEMDRAW_DISABLED);
- if(Point[Client] >= SellPoint[Client] + 100) AddMenuItem(menuhandle, Formatting, "+100");
- else AddMenuItem(menuhandle, Formatting, "+100", ITEMDRAW_DISABLED);
- if(Point[Client] >= SellPoint[Client] + 1000) AddMenuItem(menuhandle, Formatting, "+1000");
- else AddMenuItem(menuhandle, Formatting, "+1000", ITEMDRAW_DISABLED);
- if(Point[Client] >= SellPoint[Client] + 10000) AddMenuItem(menuhandle, Formatting, "+1만");
- else AddMenuItem(menuhandle, Formatting, "+1만", ITEMDRAW_DISABLED);
- if(Point[Client] >= SellPoint[Client] + 100000) AddMenuItem(menuhandle, Formatting, "+10만");
- else AddMenuItem(menuhandle, Formatting, "+10만", ITEMDRAW_DISABLED);
- if(Point[Client] >= SellPoint[Client] + 1000000) AddMenuItem(menuhandle, Formatting, "+100만");
- else AddMenuItem(menuhandle, Formatting, "+100만", ITEMDRAW_DISABLED);
- SetMenuPagination(menuhandle, MENU_NO_PAGINATION);
- SetMenuExitButton(menuhandle, false);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public PointPresent_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:StringNumber[256];
- GetMenuItem(menu, select, StringNumber, 256);
- new target = StringToInt(StringNumber);
- if(select == 0)
- {
- Point[Client] -= SellPoint[Client];
- SavePoint(Client);
- Point[target] += SellPoint[Client];
- SavePoint(target);
- PrintChat(Client, "\x05ë‹¹ì‹ ì€ %Nì—게 %dí¬ì¸íŠ¸ë¥¼ 줬습니다.", target, SellPoint[Client]);
- PrintChat(target, "\x05ë‹¹ì‹ ì€ %Nì—게 %dí¬ì¸íŠ¸ë¥¼ 받았습니다.", Client, SellPoint[Client]);
- }
- if(select == 1)
- {
- Present2(Client, 1);
- }
- if(select >= 2)
- {
- new calcultae = 1;
- for(new i = 2; i < select; i++)
- {
- calcultae *= 10;
- }
- SellPoint[Client] += calcultae;
- }
- if(select > 1)
- {
- PointPresent(Client, StringToInt(StringNumber));
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public ItemPresent(Handle:owner, Handle:hndl, const String:error[], any:pack)
- {
- ResetPack(pack);
- new Client = ReadPackCell(pack);
- new Target = ReadPackCell(pack);
- if(hndl == INVALID_HANDLE)
- {
- PrintChat(Client, "\x03Don't have any type of items.");
- Present(Client);
- return;
- }
- new String:Formatting[256], String:Formatting2[256], bool:display;
- new counted = SQL_GetRowCount(hndl);
- new Handle:menuhandle = CreateMenu(ItemPresent_CallBack);
- SetMenuTitle(menuhandle, "%Nì—게 ì•„ì´í…œ ì„ ë¬¼", Target);
- if(counted > 0)
- {
- if(SQL_HasResultSet(hndl))
- {
- while(SQL_FetchRow(hndl))
- {
- Format(Formatting, 256, "%i^%i", Target, SQL_FetchInt(hndl, 2));
- Format(Formatting2, 256, "%s", ItemName[SQL_FetchInt(hndl, 2)]);
- if(!IsVIPItem[SQL_FetchInt(hndl, 2)]) AddMenuItem(menuhandle, Formatting, Formatting2);
- else AddMenuItem(menuhandle, Formatting, Formatting2, ITEMDRAW_DISABLED);
- if(!display)
- {
- display = true;
- }
- }
- }
- }
- if(display)
- {
- SetMenuExitButton(menuhandle, true);
- SetMenuExitBackButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- else
- {
- PrintChat(Client, "\x03Don't have any type of items.");
- Present(Client);
- }
- }
- public ItemPresent_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:info[256], String:EString[2][64], String:query[512], String:SteamID[256], String:TargetSteamID[256];
- GetMenuItem(menu, select, info, 256);
- ExplodeString(info, "^", EString, 2, 64);
- new Target = StringToInt(EString[0]);
- new Number = StringToInt(EString[1]);
- GetClientAuthString(Client, SteamID, 256);
- GetClientAuthString(Target, TargetSteamID, 256);
- Format(query, 512, "INSERT INTO inventory(steamid, idx, type) values ('%s', '%d', '%d');", TargetSteamID, Number, ItemType[Number]);
- SQL_TQuery(databasehandle, save_info, query);
- Format(query, 512, "DELETE FROM inventory WHERE steamid = '%s' AND idx = '%i' limit 1;", SteamID, Number);
- SQL_TQuery(databasehandle, save_info, query);
- PrintChat(Client, "\x05ë‹¹ì‹ ì€ %Nì—게 %s를 줬습니다.", Target, ItemName[Number]);
- PrintChat(Target, "\x05ë‹¹ì‹ ì€ %Nì—게 %s를 받았습니다.", Client, ItemName[Number]);
- new String:Log[256], String:Time[30], String:ClientName[256], String:TargetName[256];
- GetClientName(Client, ClientName, 256);
- GetClientName(Target, TargetName, 256);
- while(StrContains(ClientName, "'") != -1) ReplaceStringEx(ClientName, 256, "'", "`");
- while(StrContains(TargetName, "'") != -1) ReplaceStringEx(TargetName, 256, "'", "`");
- FormatTime(Time, 30, "%Y/%m/%d - %H:%M:%S", GetTime());
- Format(Log, 256, "%s gift (%s)%i for %s", ClientName, ItemName[Number], Number, TargetName);
- Format(query, 512, "INSERT INTO shoplog(steamid, log, type, date) values ('%s', '%s', '%i', '%s');", SteamID, Log, 5, Time);
- SQL_TQuery(databasehandle, save_info, query);
- Format(Log, 256, "%s receive %s(%i) for %s", TargetName, ItemName[Number], Number, ClientName);
- Format(query, 512, "INSERT INTO shoplog(steamid, log, type, date) values ('%s', '%s', '%i', '%s');", TargetSteamID, Log, 6, Time);
- SQL_TQuery(databasehandle, save_info, query);
- }
- if(action == MenuAction_Cancel)
- {
- if(select == MenuCancel_ExitBack)
- {
- Present2(Client, 2);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public MainMenu(Client)
- {
- new Handle:menuhandle = CreateMenu(MainMenu_CallBack), String:Translate_Formatting[128];
- SetMenuTitle(menuhandle, "-- %T %T --", "main", Client, "menu", Client);
- Format(Translate_Formatting, 128, "%T %T", "point", Client, "shop", Client);
- AddMenuItem(menuhandle, "shop", Translate_Formatting);
- Format(Translate_Formatting, 128, "%T", "options", Client);
- //AddMenuItem(menuhandle, "options", Translate_Formatting);
- AddMenuItem(menuhandle, "VIP", "VIP");
- if(AdminCheck(Client)) AddMenuItem(menuhandle, "ADM", "Admin Menu");
- SetMenuExitButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public MainMenu_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:info[256];
- GetMenuItem(menu, select, info, 256);
- if(StrEqual(info, "shop", false))
- {
- MainShop(Client);
- }
- /*
- if(StrEqual(info, "options", false))
- {
- MainOption(Client);
- }
- */
- if(StrEqual(info, "VIP", false))
- {
- if(!VIP[Client])
- {
- youarenotvip(Client);
- }
- else
- {
- VIPOption(Client);
- }
- }
- if(StrEqual(info, "ADM", false))
- {
- ADMOption(Client);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- /*
- public MainOption(Client)
- {
- new Handle:menuhandle = CreateMenu(MainOption_CallBack), String:Translate_Formatting[128];
- SetMenuTitle(menuhandle, "-- %T %T --", "main", Client, "options", Client);
- Format(Translate_Formatting, 128, "%T %T", "shop", Client, "option", Client);
- AddMenuItem(menuhandle, "Shop Option", Translate_Formatting);
- AddMenuItem(menuhandle, "BGM Toggle", "BGM On/Off");
- AddMenuItem(menuhandle, "BGM Volume", "BGM Volume");
- SetMenuExitButton(menuhandle, true);
- SetMenuExitBackButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public MainOption_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- if(select == 0)
- {
- Option(Client);
- }
- if(select == 1)
- {
- new String:SteamID[256], String:query[512];
- GetClientAuthString(Client ,SteamID, 256);
- if(!BGM[Client])
- {
- BGM[Client] = true;
- Format(query, 512, "UPDATE info SET bgm = '1' WHERE steamid = '%s';", SteamID);
- SQL_TQuery(databasehandle, save_info, query, Client);
- PrintChat(Client, "\x08FF0000EEBGM %T", "off", Client);
- new String:Formatting[256];
- Format(Formatting, 256, "tttmusic/%s", SoundData[SoundNumber][0]);
- StopSound(Client, SNDCHAN_AUTO, Formatting);
- }
- else
- {
- BGM[Client] = false;
- Format(query, 512, "UPDATE info SET bgm = '0' WHERE steamid = '%s';", SteamID);
- SQL_TQuery(databasehandle, save_info, query, Client);
- PrintChat(Client, "\x08FF0000EEBGM %T", "on", Client);
- }
- MainOption(Client);
- }
- if(select == 2)
- {
- if(!BGM[Client]) BGM_Volume_Option(Client);
- else PrintChat(Client, "\x07FFFFFFBGMì„¤ì •ì„ ì˜¨ 하셔야 합니다.");
- }
- }
- if(action == MenuAction_Cancel)
- {
- if(select == MenuCancel_ExitBack)
- {
- MainMenu(Client);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public BGM_Volume_Option(Client)
- {
- new Handle:menuhandle = CreateMenu(BGM_Volume_Option_CallBack);
- SetMenuTitle(menuhandle, "Setting Volume for BGM - %i%%", Volume[Client]);
- AddMenuItem(menuhandle, "", "+10%", Volume[Client] <= 90 ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED);
- AddMenuItem(menuhandle, "", "+5%", Volume[Client] <= 95 ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED);
- AddMenuItem(menuhandle, "", "+1%", Volume[Client] <= 99 ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED);
- AddMenuItem(menuhandle, "", " ");
- AddMenuItem(menuhandle, "", "-1%", Volume[Client] >= 1 ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED);
- AddMenuItem(menuhandle, "", "-5%", Volume[Client] >= 5 ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED);
- AddMenuItem(menuhandle, "", "-10%", Volume[Client] >= 10 ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED);
- SetMenuExitButton(menuhandle, true);
- SetMenuExitBackButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public BGM_Volume_Option_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:SteamID[256], String:query[512];
- GetClientAuthString(Client, SteamID, 256);
- if(select == 0)
- {
- Volume[Client] += 10;
- }
- if(select == 1)
- {
- Volume[Client] += 5;
- }
- if(select == 2)
- {
- Volume[Client] += 1;
- }
- if(select == 4)
- {
- Volume[Client] -= 1;
- }
- if(select == 5)
- {
- Volume[Client] -= 5;
- }
- if(select == 6)
- {
- Volume[Client] -= 10;
- }
- Format(query, 512, "UPDATE info SET volume = '%i' WHERE steamid = '%s';", Volume[Client], SteamID);
- SQL_TQuery(databasehandle, save_info, query, Client);
- PrintChat(Client, "\x08FF0000EEBGM Volume : %i%%", Volume[Client]);
- BGM_Volume_Option(Client);
- }
- if(action == MenuAction_Cancel)
- {
- if(select == MenuCancel_ExitBack)
- {
- MainOption(Client);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- */
- public youarenotvip(Client)
- {
- new Handle:menuhandle = CreateMenu(youarenotvip_CallBack);
- SetMenuTitle(menuhandle, "-- You are not a VIP --");
- AddMenuItem(menuhandle, "", "What do i get if i buy VIP?");
- SetMenuExitButton(menuhandle, true);
- SetMenuExitBackButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public youarenotvip_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- if(select == 0)
- {
- VIPEffect(Client);
- }
- }
- if(action == MenuAction_Cancel)
- {
- if(select == MenuCancel_ExitBack)
- {
- MainMenu(Client);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public VIPEffect(Client)
- {
- new Handle:menuhandle = CreateMenu(VIPEffect_CallBack);
- SetMenuTitle(menuhandle, "-- VIP Effects --");
- AddMenuItem(menuhandle, "", "Pistol(usp,elite,fiveseven) will be automatic.\n", ITEMDRAW_DISABLED);
- AddMenuItem(menuhandle, "", "You will get VIP tag.\n", ITEMDRAW_DISABLED);
- AddMenuItem(menuhandle, "", "You can change color of tag.\n", ITEMDRAW_DISABLED);
- AddMenuItem(menuhandle, "", "you will be gain 1 extra credit.\n", ITEMDRAW_DISABLED);
- AddMenuItem(menuhandle, "", "you get effect more on medic kit.\n", ITEMDRAW_DISABLED);
- AddMenuItem(menuhandle, "", "you can setup light of tag.\n", ITEMDRAW_DISABLED);
- AddMenuItem(menuhandle, "", "you can use VIP shop's skins for free.\n", ITEMDRAW_DISABLED);
- SetMenuExitButton(menuhandle, true);
- SetMenuExitBackButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public VIPEffect_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Cancel)
- {
- if(select == MenuCancel_ExitBack)
- {
- MainMenu(Client);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public VIPOption(Client)
- {
- new Handle:menuhandle = CreateMenu(VIPOption_CallBack);
- SetMenuTitle(menuhandle, "-- VIP Menu --");
- AddMenuItem(menuhandle, "", "What do i get if i buy VIP?");
- AddMenuItem(menuhandle, "", "Set color of VIP Tag");
- if(VIP[Client]) AddMenuItem(menuhandle, "", "VIP Shop");
- SetMenuExitButton(menuhandle, true);
- SetMenuExitBackButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public VIPOption_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- if(select == 0)
- {
- VIPEffect(Client);
- }
- if(select == 1)
- {
- if(VIP[Client]) VIPTagChangeColor(Client);
- }
- if(select == 2)
- {
- if(VIP[Client]) VIPMainShop(Client);
- }
- }
- if(action == MenuAction_Cancel)
- {
- if(select == MenuCancel_ExitBack)
- {
- MainMenu(Client);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public VIPTagChangeColor(Client)
- {
- new Handle:menuhandle = CreateMenu(VIPTagChangeColor_CallBack);
- SetMenuTitle(menuhandle, "-- Set color of VIP Tag --");
- AddMenuItem(menuhandle, "", "R(Red)");
- AddMenuItem(menuhandle, "", "G(Green)");
- AddMenuItem(menuhandle, "", "B(Blue)");
- AddMenuItem(menuhandle, "", "A(Alpha)");
- SetMenuExitButton(menuhandle, true);
- SetMenuExitBackButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public VIPTagChangeColor_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- VIPTagChangeColor2(Client, select+1);
- }
- if(action == MenuAction_Cancel)
- {
- if(select == MenuCancel_ExitBack)
- {
- VIPOption(Client);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public VIPTagChangeColor2(Client, Color)
- {
- new Handle:menuhandle = CreateMenu(VIPTagChangeColor2_CallBack);
- if(Color == 1) SetMenuTitle(menuhandle, "-- Set Red Color VIP Tag --");
- else if(Color == 2) SetMenuTitle(menuhandle, "-- Set Green Color VIP Tag --");
- else if(Color == 3) SetMenuTitle(menuhandle, "-- Set Blue Color VIP Tag --");
- else SetMenuTitle(menuhandle, "-- Set Alpha Color VIP Tag --");
- new String:StringColor[256], String:Formatting[256];
- IntToString(Color, StringColor, 256);
- for(new i= 1; i <= 36; i++)
- {
- Format(Formatting, 256, "%i ~ %i", ((i-1)*7), i*7-1);
- AddMenuItem(menuhandle, StringColor, Formatting);
- }
- AddMenuItem(menuhandle, StringColor, "252 ~ 255");
- SetMenuExitButton(menuhandle, true);
- SetMenuExitBackButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public VIPTagChangeColor2_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:info[256];
- GetMenuItem(menu, select, info, 256);
- VIPTagChangeColor3(Client, info, select);
- }
- if(action == MenuAction_Cancel)
- {
- if(select == MenuCancel_ExitBack)
- {
- VIPTagChangeColor(Client);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public VIPTagChangeColor3(Client, String:Color[256], Number)
- {
- new Handle:menuhandle = CreateMenu(VIPTagChangeColor3_CallBack);
- if(StringToInt(Color) == 1) SetMenuTitle(menuhandle, "-- Set Red Color VIP Tag --");
- else if(StringToInt(Color) == 2) SetMenuTitle(menuhandle, "-- Set Green Color VIP Tag --");
- else if(StringToInt(Color) == 3) SetMenuTitle(menuhandle, "-- Set Blue Color VIP Tag --");
- else SetMenuTitle(menuhandle, "-- Set Alpha Color VIP Tag --");
- new String:Formatting[256], String:Color2[256];
- if(Number == 36)
- {
- for(new i; i < 4; i++)
- {
- Format(Formatting, 256, "%i", Number*7+i);
- Format(Color2, 256, "%s^%i", Color, Number*7+i);
- AddMenuItem(menuhandle, Color2, Formatting);
- }
- }
- else
- {
- for(new i; i < 7; i++)
- {
- Format(Formatting, 256, "%i", Number*7+i);
- Format(Color2, 256, "%s^%i", Color, Number*7+i);
- AddMenuItem(menuhandle, Color2, Formatting);
- }
- }
- SetMenuExitButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public VIPTagChangeColor3_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:info[256], String:EString[2][128];
- GetMenuItem(menu, select, info, 256);
- ExplodeString(info, "^", EString, 2, 128);
- new String:query[512], String:SteamID[256];
- GetClientAuthString(Client, SteamID, 256);
- if(StringToInt(EString[0]) == 1)
- {
- Format(query, 512, "UPDATE viptag SET red = '%i' WHERE steamid = '%s';", StringToInt(EString[1]), SteamID);
- PrintChat(Client, "\x07FF3A3AYou are chosen Red code as %i%%.", StringToInt(EString[1]));
- }
- else if(StringToInt(EString[0]) == 2)
- {
- Format(query, 512, "UPDATE viptag SET green = '%i' WHERE steamid = '%s';", StringToInt(EString[1]), SteamID);
- PrintChat(Client, "\x07FF3A3AYou are chosen Green code as %i%%.", StringToInt(EString[1]));
- }
- else if(StringToInt(EString[0]) == 3)
- {
- Format(query, 512, "UPDATE viptag SET blue = '%i' WHERE steamid = '%s';", StringToInt(EString[1]), SteamID);
- PrintChat(Client, "\x07FF3A3AYou are chosen Blue code as %i%%.", StringToInt(EString[1]));
- }
- else
- {
- Format(query, 512, "UPDATE viptag SET alpha = '%i' WHERE steamid = '%s';", StringToInt(EString[1]), SteamID);
- PrintChat(Client, "\x07FF3A3AYou are chosen Alpha code as %i%%.", StringToInt(EString[1]));
- }
- SQL_TQuery(databasehandle, save_info, query, Client);
- Format(query, 512, "SELECT * FROM viptag WHERE steamid = '%s';", SteamID);
- SQL_TQuery(databasehandle, viptag_check, query, Client);
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public VIPMainShop(Client)
- {
- new Handle:menuhandle = CreateMenu(VIPMainShop_CallBack);
- SetMenuTitle(menuhandle, "--- TTT VIP %T %T ---", "point", Client, "shop", Client);
- for(new i = 1; i < MaxType+1; i++)
- {
- new String:Formatting[256];
- Format(Formatting, 256, "%T %T(VIP)", TypeName[i][0], Client, "shop", Client);
- AddMenuItem(menuhandle, "", Formatting);
- }
- SetMenuExitButton(menuhandle, true);
- SetMenuExitBackButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public VIPMainShop_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- VIPShop(Client, select+1);
- }
- if(action == MenuAction_Cancel)
- {
- if(select == MenuCancel_ExitBack)
- {
- VIPOption(Client);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public VIPShop(Client, Type)
- {
- new String:Formatting[256], String:Formatting2[256], bool:display;
- new Handle:menuhandle = CreateMenu(VIPShop_CallBack);
- SetMenuTitle(menuhandle, "--- TTT VIP %T %T ---", "point", Client, "shop", Client);
- for(new i;i < MAX_ITEMS; i++)
- {
- if(ItemType[i] == Type && ItemPrice[i] && IsVIPItem[i])
- {
- if(VIP[Client])
- {
- Format(Formatting, 256, "%i", i);
- Format(Formatting2, 256, "%s", ItemName[i]);
- AddMenuItem(menuhandle, Formatting, Formatting2);
- }
- display = true;
- }
- }
- SetMenuExitButton(menuhandle, true);
- SetMenuExitBackButton(menuhandle, true);
- if(!display)
- {
- Format(Formatting2, 256, "%T", "no items available", Client);
- AddMenuItem(menuhandle, "", Formatting2, ITEMDRAW_DISABLED);
- }
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public VIPShop_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:StringNumber[256], Number;
- GetMenuItem(menu, select, StringNumber, 256);
- Number = StringToInt(StringNumber);
- if(VIP[Client])
- {
- new String:query[512], String:SteamID[256];
- GetClientAuthString(Client, SteamID, 256);
- Format(query, 512, "INSERT INTO inventory(steamid, idx, type) values ('%s', '%d', '%d');", SteamID, Number, ItemType[Number]);
- SQL_TQuery(databasehandle, save_info, query, Client);
- PrintChat(Client, "You bought \x05%s.", ItemName[Number]);
- Inventory(Client);
- new String:Log[256], String:Time[30], String:ClientName[256];
- GetClientName(Client, ClientName, 256);
- while(StrContains(ClientName, "'") != -1) ReplaceStringEx(ClientName, 256, "'", "`");
- FormatTime(Time, 30, "%Y/%m/%d - %H:%M:%S", GetTime());
- Format(Log, 256, "%s buy %s(%i)", ClientName, ItemName[Number], Number);
- Format(query, 512, "INSERT INTO shoplog(steamid, log, type, date) values ('%s', '%s', '%i', '%s');", SteamID, Log, 0, Time);
- SQL_TQuery(databasehandle, save_info, query);
- }
- }
- if(action == MenuAction_Cancel)
- {
- if(select == MenuCancel_ExitBack)
- {
- VIPMainShop(Client);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public ADMOption(Client)
- {
- new Handle:menuhandle = CreateMenu(ADMOption_CallBack);
- SetMenuTitle(menuhandle, "-- Admin Menu --");
- AddMenuItem(menuhandle, "", "Set ADM Tag Color ");
- AddMenuItem(menuhandle, "", "User's Market Item Returning");
- AddMenuItem(menuhandle, "", "Log");
- SetMenuExitButton(menuhandle, true);
- SetMenuExitBackButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public ADMOption_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- if(select == 0)
- {
- ADMTagChangeColor(Client);
- }
- if(select == 1)
- {
- SQL_TQuery(databasehandle, CounterMarket_Admin_Sell_Item, "SELECT * FROM countermarket ORDER BY idx ASC;", Client);
- }
- if(select == 2)
- {
- Log_Year(Client);
- }
- }
- if(action == MenuAction_Cancel)
- {
- if(select == MenuCancel_ExitBack)
- {
- MainMenu(Client);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public ADMTagChangeColor(Client)
- {
- new Handle:menuhandle = CreateMenu(ADMTagChangeColor_CallBack);
- SetMenuTitle(menuhandle, "-- ADM Tag color set --");
- AddMenuItem(menuhandle, "", "R(Red)");
- AddMenuItem(menuhandle, "", "G(Green)");
- AddMenuItem(menuhandle, "", "B(Blue)");
- AddMenuItem(menuhandle, "", "A(Light)");
- SetMenuExitButton(menuhandle, true);
- SetMenuExitBackButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public ADMTagChangeColor_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- ADMTagChangeColor2(Client, select+1);
- }
- if(action == MenuAction_Cancel)
- {
- if(select == MenuCancel_ExitBack)
- {
- VIPOption(Client);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public ADMTagChangeColor2(Client, Color)
- {
- new Handle:menuhandle = CreateMenu(ADMTagChangeColor2_CallBack);
- if(Color == 1) SetMenuTitle(menuhandle, "-- ADM Tag red color set --");
- else if(Color == 2) SetMenuTitle(menuhandle, "-- ADM Tag green color set --");
- else if(Color == 3) SetMenuTitle(menuhandle, "-- ADM Tag blue color set --");
- else SetMenuTitle(menuhandle, "-- ADM Tag light set --");
- new String:StringColor[256], String:Formatting[256];
- IntToString(Color, StringColor, 256);
- for(new i= 1; i <= 36; i++)
- {
- Format(Formatting, 256, "%i ~ %i", ((i-1)*7), i*7-1);
- AddMenuItem(menuhandle, StringColor, Formatting);
- }
- AddMenuItem(menuhandle, StringColor, "252 ~ 255");
- SetMenuExitButton(menuhandle, true);
- SetMenuExitBackButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public ADMTagChangeColor2_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:info[256];
- GetMenuItem(menu, select, info, 256);
- ADMTagChangeColor3(Client, info, select);
- }
- if(action == MenuAction_Cancel)
- {
- if(select == MenuCancel_ExitBack)
- {
- ADMTagChangeColor(Client);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public ADMTagChangeColor3(Client, String:Color[256], Number)
- {
- new Handle:menuhandle = CreateMenu(ADMTagChangeColor3_CallBack);
- if(StringToInt(Color) == 1) SetMenuTitle(menuhandle, "-- ADM 태그 빨간색 ìˆ˜ì • --");
- else if(StringToInt(Color) == 2) SetMenuTitle(menuhandle, "-- ADM 태그 ì´ˆë¡ìƒ‰ ìˆ˜ì • --");
- else if(StringToInt(Color) == 2) SetMenuTitle(menuhandle, "-- ADM 태그 파란색 ìˆ˜ì • --");
- else SetMenuTitle(menuhandle, "-- ADM 태그 투명값 ìˆ˜ì • --");
- new String:Formatting[256], String:Color2[256];
- if(Number == 36)
- {
- for(new i; i < 4; i++)
- {
- Format(Formatting, 256, "%i", Number*7+i);
- Format(Color2, 256, "%s^%i", Color, Number*7+i);
- AddMenuItem(menuhandle, Color2, Formatting);
- }
- }
- else
- {
- for(new i; i < 7; i++)
- {
- Format(Formatting, 256, "%i", Number*7+i);
- Format(Color2, 256, "%s^%i", Color, Number*7+i);
- AddMenuItem(menuhandle, Color2, Formatting);
- }
- }
- SetMenuExitButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public ADMTagChangeColor3_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:info[256], String:EString[2][128];
- GetMenuItem(menu, select, info, 256);
- ExplodeString(info, "^", EString, 2, 128);
- new String:query[512], String:SteamID[256];
- GetClientAuthString(Client, SteamID, 256);
- if(StringToInt(EString[0]) == 1)
- {
- Format(query, 512, "UPDATE admtag SET red = '%i' WHERE steamid = '%s';", StringToInt(EString[1]), SteamID);
- PrintChat(Client, "\x07FF3A3ARed Code set to %i.", StringToInt(EString[1]));
- }
- else if(StringToInt(EString[0]) == 2)
- {
- Format(query, 512, "UPDATE admtag SET green = '%i' WHERE steamid = '%s';", StringToInt(EString[1]), SteamID);
- PrintChat(Client, "\x07FF3A3AGreen Code set to %i.", StringToInt(EString[1]));
- }
- else if(StringToInt(EString[0]) == 3)
- {
- Format(query, 512, "UPDATE admtag SET blue = '%i' WHERE steamid = '%s';", StringToInt(EString[1]), SteamID);
- PrintChat(Client, "\x07FF3A3ABlue Code set to %i.", StringToInt(EString[1]));
- }
- else
- {
- Format(query, 512, "UPDATE admtag SET alpha = '%i' WHERE steamid = '%s';", StringToInt(EString[1]), SteamID);
- PrintChat(Client, "\x07FF3A3Aalpha Code set to %i.", StringToInt(EString[1]));
- }
- SQL_TQuery(databasehandle, save_info, query, Client);
- Format(query, 512, "SELECT * FROM admtag WHERE steamid = '%s';", SteamID);
- SQL_TQuery(databasehandle, admtag_check, query, Client);
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public Log_Year(Client)
- {
- new Handle:menuhandle = CreateMenu(Log_Year_CallBack);
- SetMenuTitle(menuhandle, "Select year.(Log)");
- AddMenuItem(menuhandle, "2012", "2012");
- AddMenuItem(menuhandle, "2013", "2013");
- SetMenuExitButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public Log_Year_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:info[256];
- GetMenuItem(menu, select, info, 256);
- Log_Month(Client, info);
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public Log_Month(Client, String:info[256])
- {
- new Handle:menuhandle = CreateMenu(Log_Month_CallBack);
- SetMenuTitle(menuhandle, "Select month.(Log):%s", info);
- new String:Formatting[256], String:Formatting2[256];
- for(new i=1; i<=12; i++)
- {
- if(i < 10) Format(Formatting, 256, "%s/0%i", info, i);
- else Format(Formatting, 256, "%s/%i", info, i);
- Format(Formatting2, 256, "%i Month", i);
- AddMenuItem(menuhandle, Formatting, Formatting2);
- }
- SetMenuExitButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public Log_Month_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:info[256];
- GetMenuItem(menu, select, info, 256);
- Log_Day(Client, info);
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public Log_Day(Client, String:info[256])
- {
- new Handle:menuhandle = CreateMenu(Log_Day_CallBack);
- SetMenuTitle(menuhandle, "Select day.(Log):%s", info);
- new String:Formatting[256], String:Formatting2[256];
- for(new i=1; i<=31; i++)
- {
- if(i < 10) Format(Formatting, 256, "%s/0%i", info, i);
- else Format(Formatting, 256, "%s/%i", info, i);
- Format(Formatting2, 256, "%i Day", i);
- AddMenuItem(menuhandle, Formatting, Formatting2);
- }
- SetMenuExitButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public Log_Day_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:info[256];
- GetMenuItem(menu, select, info, 256);
- Log_Hour(Client, info);
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public Log_Hour(Client, String:info[256])
- {
- new Handle:menuhandle = CreateMenu(Log_Hour_CallBack);
- SetMenuTitle(menuhandle, "Select time.(Log):%s", info);
- new String:Formatting[256], String:Formatting2[256];
- AddMenuItem(menuhandle, info, "See hour set logs");
- for(new i; i<24; i++)
- {
- if(i < 10) Format(Formatting, 256, "%s - 0%i", info, i);
- else Format(Formatting, 256, "%s - %i", info, i);
- Format(Formatting2, 256, "%i시", i);
- AddMenuItem(menuhandle, Formatting, Formatting2);
- }
- SetMenuExitButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public Log_Hour_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:info[256];
- GetMenuItem(menu, select, info, 256);
- if(!select) Log_Type(Client, info);
- if(select) Log_Minute(Client, info);
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public Log_Minute(Client, String:info[256])
- {
- new Handle:menuhandle = CreateMenu(Log_Minute_CallBack);
- SetMenuTitle(menuhandle, "Select minutes.(Log):%s", info);
- new String:Formatting[256], String:Formatting2[256];
- AddMenuItem(menuhandle, info, "See Minute set log");
- for(new i; i<=59; i++)
- {
- if(i < 10) Format(Formatting, 256, "%s:0%i", info, i);
- else Format(Formatting, 256, "%s:%i", info, i);
- Format(Formatting2, 256, "%i Min", i);
- AddMenuItem(menuhandle, Formatting, Formatting2);
- }
- SetMenuExitButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public Log_Minute_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:info[256];
- GetMenuItem(menu, select, info, 256);
- Log_Type(Client, info);
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public Log_Type(Client, String:info[256])
- {
- new Handle:menuhandle = CreateMenu(Log_Type_CallBack);
- SetMenuTitle(menuhandle, "로그 íƒ€ìž…ì„ ì •í•˜ì„¸ìš”.(로그):%s", info);
- AddMenuItem(menuhandle, info, "ì „ì²´ 로그 보기");
- AddMenuItem(menuhandle, info, "Death 로그 보기");
- AddMenuItem(menuhandle, info, "Hurt 로그 보기");
- AddMenuItem(menuhandle, info, "get DNA 로그 보기");
- AddMenuItem(menuhandle, info, "DNA result 로그 보기");
- AddMenuItem(menuhandle, info, "ê·“ì†ë§ 로그 보기");
- AddMenuItem(menuhandle, info, "넉백 로그 보기");
- AddMenuItem(menuhandle, info, "DNA Scan 시작 로그 보기");
- SetMenuExitButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public Log_Type_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:info[256];
- GetMenuItem(menu, select, info, 256);
- if(!select)
- {
- new Handle:pack = CreateDataPack();
- WritePackCell(pack, Client);
- WritePackString(pack, info);
- SQL_TQuery(databasehandle, ShowLog, "SELECT * FROM log;", pack);
- }
- else
- {
- new String:Formatting[256];
- Format(Formatting, 256, "SELECT * FROM log WHERE type = '%i';", select-1);
- new Handle:pack = CreateDataPack();
- WritePackCell(pack, Client);
- WritePackString(pack, info);
- SQL_TQuery(databasehandle, ShowLog, Formatting, pack);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public ShowLog(Handle:owner, Handle:handle, const String:error[], any:pack)
- {
- ResetPack(pack);
- new Client = ReadPackCell(pack);
- new String:Time[128], String:Date[128], String:Log[256], bool:check, count;
- ReadPackString(pack, Time, 128);
- if(handle == INVALID_HANDLE)
- {
- LogError("Show Log Error: %s", error);
- PrintChat(Client, "Show Log Error");
- }
- else if(SQL_GetRowCount(handle))
- {
- new Handle:menuhandle = CreateMenu(NULL_CallBack);
- SetMenuTitle(menuhandle, "Log : %s", Time);
- new counted = SQL_GetRowCount(handle);
- if(counted > 0)
- {
- if(SQL_HasResultSet(handle))
- {
- while(SQL_FetchRow(handle))
- {
- SQL_FetchString(handle, 2, Date, 128);
- if(StrContains(Date, Time, false) == 0)
- {
- SQL_FetchString(handle, 1, Log, 256);
- if(count % 3 != 0)
- {
- AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- }
- Format(Log, 256, "%s{%s}", Log, Date);
- AddMenuItem(menuhandle, Log, Log, ITEMDRAW_DISABLED);
- check = true;
- count++;
- }
- }
- }
- }
- if(check)
- {
- SetMenuExitButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- else PrintChat(Client, "해당 로그가 존재하지 않습니다.");
- }
- }
- public WeaponMenu(Client)
- {
- new Handle:menuhandle = CreateMenu(WeaponMenu_CallBack);
- SetMenuTitle(menuhandle, "-- 무기 메뉴 --");
- AddMenuItem(menuhandle, "light_dynamic", "light");
- AddMenuItem(menuhandle, "weapon_mac10", "mac10");
- AddMenuItem(menuhandle, "weapon_tmp", "tmp");
- AddMenuItem(menuhandle, "weapon_mp5navy", "MP5");
- AddMenuItem(menuhandle, "weapon_p90", "피구공");
- AddMenuItem(menuhandle, "weapon_scout", "스카웃");
- AddMenuItem(menuhandle, "weapon_m4a1", "M4A1");
- AddMenuItem(menuhandle, "weapon_ak47", "AK47");
- AddMenuItem(menuhandle, "weapon_galil", "갈릴");
- AddMenuItem(menuhandle, "weapon_m3", "펌프샷건");
- AddMenuItem(menuhandle, "weapon_xm1014", "ìžë™ìƒ·ê±´");
- AddMenuItem(menuhandle, "weapon_m249", "M249");
- AddMenuItem(menuhandle, "weapon_glock", "글ë¡");
- AddMenuItem(menuhandle, "weapon_deagle", "ë°ê¸€");
- AddMenuItem(menuhandle, "weapon_fiveseven", "파ì´ë¸Œì„¸ë¸");
- SetMenuExitButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public WeaponMenu_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:info[256], String:CurrentMap[256];
- GetMenuItem(menu, select, info, 256);
- GetCurrentMap(CurrentMap, 256);
- new Float:cleyepos[3], Float:cleyeangle[3], Float:resultposition[3], Float:normalvector[3];
- GetClientEyePosition(Client, cleyepos);
- GetClientEyeAngles(Client, cleyeangle);
- new Handle:traceresulthandle = INVALID_HANDLE;
- traceresulthandle = TR_TraceRayFilterEx(cleyepos, cleyeangle, MASK_SOLID, RayType_Infinite, tracerayfilternoplayer, Client);
- if(TR_DidHit(traceresulthandle) == true)
- {
- TR_GetEndPosition(resultposition, traceresulthandle);
- TR_GetPlaneNormal(traceresulthandle, normalvector);
- NormalizeVector(normalvector, normalvector);
- ScaleVector(normalvector, 5.0);
- AddVectors(resultposition, normalvector, resultposition);
- new Handle:kv= CreateKeyValues("TTTWeapons");
- if(FileExists(Path))
- {
- FileToKeyValues(kv, Path);
- }
- new String:LastBuffer[256];
- KvGotoFirstSubKey(kv);
- do
- {
- new String:buffer[256];
- KvGetSectionName(kv, buffer, sizeof(buffer));
- if(StrEqual(buffer, CurrentMap, false))
- {
- KvJumpToKey(kv, CurrentMap, false);
- KvGotoFirstSubKey(kv);
- do
- {
- KvGetSectionName(kv, buffer, sizeof(buffer));
- LastBuffer = buffer;
- }
- while(KvGotoNextKey(kv));
- break;
- }
- }while(KvGotoNextKey(kv));
- KvRewind(kv);
- KvJumpToKey(kv, CurrentMap, true);
- ReplaceStringEx(LastBuffer, 256, CurrentMap, "");
- new Count = StringToInt(LastBuffer);
- Format(LastBuffer, 256, "%i", Count+1);
- KvJumpToKey(kv, LastBuffer, true);
- KvSetVector(kv, "weapon", resultposition);
- KvSetString(kv, "weapon2", info);
- KvRewind(kv);
- KeyValuesToFile(kv, Path);
- CloseHandle(kv);
- new entity = CreateEntityByName(info);
- if(StrContains(info, "light", false) == 0)
- {
- DispatchKeyValue(entity, "_light", "255 255 255");
- DispatchKeyValue(entity, "brightness", "3");
- DispatchKeyValue(entity, "spotlight_radius", "1000");
- DispatchKeyValue(entity, "pitch", "-90");
- DispatchKeyValue(entity, "distance", "300");
- }
- DispatchSpawn(entity);
- if(StrContains(info, "light", false) == 0)
- {
- AcceptEntityInput(entity, "TurnOn");
- }
- TeleportEntity(entity, resultposition, NULL_VECTOR, NULL_VECTOR);
- PrintChatAll("\x03%s Spawned %.1f %.1f %.1f", info, resultposition[0], resultposition[1], resultposition[2]);
- WeaponMenu(Client);
- }
- else PrintChat(Client, "\x03Error.\x05 ìž˜ëª»ëœ ìœ„ì¹˜ìž…ë‹ˆë‹¤.");
- CloseHandle(traceresulthandle);
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public Action:TextMsg(UserMsg:msg_id, Handle:bf, const players[], playersNum, bool:reliable, bool:init)
- {
- decl String:buffer[256];
- buffer[0] = '\0';
- BfReadString(bf, buffer, sizeof(buffer), false);
- //íŒ€ì› ë•Œë ¸ë‹¤ê³ txt뜨는거
- if(StrContains(buffer, "Game_teammate_attack") != -1)
- {
- return Plugin_Handled;
- }
- //íŒ€ì› ì£½ì˜€ë‹¤ê³ ëœ¨ëŠ”ê±°
- if(StrContains(buffer, "Killed_Teammate") != -1)
- {
- return Plugin_Handled;
- }
- return Plugin_Continue;
- }
- public Action:SayText2(UserMsg:msg_id, Handle:bf, const players[], playersNum, bool:reliable, bool:init)
- {
- decl String:buffer[256], String:buffer2[256];
- buffer[0] = '\0';
- BfReadString(bf, buffer, sizeof(buffer), false);
- BfReadString(bf, buffer2, sizeof(buffer2), false);
- //닉네임 ë°”ê¿¨ë‹¤ê³ ëœ¨ëŠ”ê±°
- if(StrContains(buffer2, "#Cstrike_Name_Change") != -1)
- {
- return Plugin_Handled;
- }
- return Plugin_Continue;
- }
- public Action:hookRadioText(UserMsg:msg_id, Handle:bf, const players[], playersNum, bool:reliable, bool:init)
- {
- return Plugin_Handled;
- }
- public OnEntityCreated(entity, const String:classname[])
- {
- if(entity < 2048 && entity >= 0) ResetData_Entity(entity);
- if(StrEqual(classname, "predicted_viewmodel", false))
- {
- SDKHook(entity, SDKHook_Spawn, OnEntitySpawned);
- }
- }
- public Action:Missile(Handle:timer, any:Client)
- {
- if(JoinCheck(Client))
- {
- new Float:cleyepos[3], Float:cleyeangle[3], Float:Fwd[3];
- GetClientEyePosition(Client, cleyepos);
- GetClientEyeAngles(Client, cleyeangle);
- GetAngleVectors(cleyeangle, Fwd, NULL_VECTOR, NULL_VECTOR);
- NormalizeVector(Fwd, Fwd);
- ScaleVector(Fwd, SquareRoot((16.0*16.0)+(16.0*16.0)));
- AddVectors(cleyepos, Fwd, cleyepos);
- Create_Missile(Client, cleyepos, cleyeangle, 2500.0, MissileTouchHook);
- EmitSoundToAll("tttmusic/rpgfire1.mp3", Client, SNDCHAN_WEAPON, ATTN_TO_SNDLEVEL(0.28));
- }
- }
- public OnEntitySpawned(entity)
- {
- new Owner = GetEntPropEnt(entity, Prop_Send, "m_hOwner");
- if ((Owner > 0) && (Owner <= MaxClients))
- {
- if (GetEntProp(entity, Prop_Send, "m_nViewModelIndex") == 0)
- {
- ClientVM[Owner][0] = entity;
- }
- else if (GetEntProp(entity, Prop_Send, "m_nViewModelIndex") == 1)
- {
- ClientVM[Owner][1] = entity;
- }
- }
- }
- public bool:tracerayfilternoplayer(entity, mask, any:data){
- if(!JoinCheck(entity)){
- return true;
- }else{
- return false;
- }
- }
- public bool:tracerayfilteronlyplayer(entity, mask, any:data){
- if(JoinCheck(entity)){
- return true;
- }else{
- return false;
- }
- }
- public bool:tracerayfilteronlyplayer2(entity, mask, any:data){
- if(JoinCheck(entity) && entity != data){
- return true;
- }else{
- return false;
- }
- }
- public bool:tracerayfilternoragdoll(entity, mask, any:data){
- if(!JoinCheck(entity)){
- if(!IsRagdoll[entity]){
- return true;
- }else{
- return false;
- }
- }else{
- return false;
- }
- }
- public bool:tracerayfilterdefault(entity, mask, any:data)
- {
- if(entity != data)
- return true;
- else
- return false;
- }
- public bool:tracerayfilternotarrow(entity, mask, any:data)
- {
- new String:classname[256];
- if(IsValidEdict(entity)) GetEdictClassname(entity, classname, 256);
- if(entity != data && !StrEqual(classname, "hegrenade_projectile"))
- return true;
- else
- return false;
- }
- public bool:tracerayfilterrocket(entity, mask, any:data)
- {
- //ë¡œì¼“ì„ ìœ ì‚¬ëžŒì´ ì•„ë‹ˆê³ , ê·¸ ì‚¬ëžŒì˜ ë¬¼ê±´ë„ ì•„ë‹ë•Œë§Œ í•„í„°ì— ê°ì§€
- new owner = GetEntPropEnt(entity, Prop_Send, "m_hOwnerEntity");//ë‹¿ì€ ë¬¼ê±´ì˜ ì£¼ì¸ì„ 구한다
- if(entity != data && owner != data)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- public bool:tracerayfilterrocketnotplayer(entity, mask, any:data)
- {
- //ë¡œì¼“ì„ ìœ ì‚¬ëžŒì´ ì•„ë‹ˆê³ , ê·¸ ì‚¬ëžŒì˜ ë¬¼ê±´ë„ ì•„ë‹ë•Œë§Œ í•„í„°ì— ê°ì§€
- new owner = GetEntPropEnt(entity, Prop_Send, "m_hOwnerEntity");//ë‹¿ì€ ë¬¼ê±´ì˜ ì£¼ì¸ì„ 구한다
- if(entity != data && owner != data)
- {
- if(!JoinCheck(entity)) return true;
- else return false;
- }
- else
- {
- return false;
- }
- }
- public bool:tracerayfilternotdefault(entity, contentsMask, any:data)
- {
- if(entity != data)
- return false;
- return true;
- }
- stock bool:JoinCheck(Client)
- {
- if(Client > 0 && Client <= MaxClients)
- {
- if(IsClientConnected(Client) == true)
- {
- if(IsClientInGame(Client) == true)
- {
- return true;
- }
- else return false;
- }
- else return false;
- }
- else return false;
- }
- stock FormatTime_Hud(Client, Float:time, String:strTime[], iSize)
- {
- new second, minute;
- decl String:st_sec[128], String:st_min[128];
- second = RoundToZero(GetEngineTime() - time);
- if(second >= 60)
- {
- minute = second / 60;
- second = second % 60;
- }
- if(minute < 10)
- Format(st_min, 128, "0%d%T", minute, "minute", Client);
- else
- Format(st_min, 128, "%d%T", minute, "minute", Client);
- if(second < 10)
- Format(st_sec, 128, "0%d%T", second, "second", Client);
- else
- Format(st_sec, 128, "%d%T", second, "second", Client);
- Format(strTime, iSize, "%s%s", st_min, st_sec);
- }
- stock FormatTime_Hud2(Client, time, String:strTime[], iSize)
- {
- new second, minute;
- decl String:st_sec[128], String:st_min[128];
- second = time;
- if(second >= 60)
- {
- minute = second / 60;
- second = second % 60;
- }
- if(minute < 10)
- Format(st_min, 128, "0%d%T", minute, "minute", Client);
- else
- Format(st_min, 128, "%d%T", minute, "minute", Client);
- if(second < 10)
- Format(st_sec, 128, "0%d%T", second, "second", Client);
- else
- Format(st_sec, 128, "%d%T", second, "second", Client);
- Format(strTime, iSize, "%s%s", st_min, st_sec);
- }
- stock FormatTime_Hud3(Float:time, String:strTime[], iSize)
- {
- new second, minute, hour;
- decl String:st_sec[128], String:st_min[128], String:st_hr[128];
- second = RoundToNearest(time);
- if(second >= 60)
- {
- minute = second / 60;
- second = second % 60;
- }
- if(minute >= 60)
- {
- hour = minute / 60;
- minute = minute % 60;
- }
- if(hour < 10)
- Format(st_hr, 128, "0%d:", hour);
- else
- Format(st_hr, 128, "%d:", hour);
- if(minute < 10)
- Format(st_min, 128, "0%d:", minute);
- else
- Format(st_min, 128, "%d:", minute);
- if(second < 10)
- Format(st_sec, 128, "0%d", second);
- else
- Format(st_sec, 128, "%d", second);
- Format(strTime, iSize, "%s%s%s", st_hr, st_min, st_sec);
- }
- 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)
- {
- new iList[MAXPLAYERS];
- new iCount;
- new String:SteamID[256], String:Time_Hour[3];
- FormatTime(Time_Hour, 3, "%H", GetTime());
- for(new i = 1; i <= MaxClients; i++)
- {
- 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)
- {
- GetClientAuthString(i, SteamID, 256);
- if((StringToInt(Time_Hour) != 20 && StringToInt(Time_Hour) != 21) || !StrEqual(SteamID, BJ_SteamID) || !IsTraitor )
- {
- iList[iCount] = i;
- iCount++;
- }
- }
- }
- if(iCount == 0)
- {
- return -1;
- }
- new iRandomIndex = GetRandomInt(0, iCount-1);
- return iList[iRandomIndex];
- }
- stock ResetData_Player(Client)
- {
- Fun[Client] = false;
- BlockWeaponUse[Client] = false;
- BuyAcceptWeapon[Client] = false;
- IsHeadShot[Client] = false;
- Weapon[Client] = "";
- Job[Client] = 0;
- Sprites[Client] = 0;
- DNASprites[Client] = 0;
- Credit[Client] = 0;
- TraitorKillList[Client] = "";
- IronShoes[Client] = false;
- SpeedBoots[Client] = false;
- Radar[Client] = false;
- RadarCount[Client] = 0;
- Dagger[Client] = false;
- SuperCrowbar[Client] = false;
- SetEntProp(Client, Prop_Data, "m_ArmorValue", 0);
- DNASample[Client][0] = "";
- DNASample[Client][1] = "";
- DNAScanning[Client] = false;
- ScanCount[Client] = 0;
- HealDelay[Client] = false;
- HealSoundDelay[Client] = false;
- HitLog[Client] = "";
- AttackLog[Client] = "";
- Ragdoll[Client] = 0;
- ChosenJoin[Client] = false;
- BuyDagger[Client] = false;
- BuyGoldenGun[Client] = false;
- BuyRPG[Client] = false;
- BuySG552[Client] = false;
- BuyTVirus[Client] = false;
- IsJihad[Client] = false;
- Disguise[Client] = false;
- IsDisguise[Client] = false;
- JammerEntity[Client] = 0;
- BuyTeleporter[Client] = false;
- TeleporterSavedPosition[Client] = false;
- TeleporterDelay[Client] = false;
- BuyCrossbow[Client] = false;
- BuyUMP[Client] = false;
- JihadSpark[Client] = 0;
- for(new i; i < 5; i++)
- {
- Sample[Client][i][0] = "";
- Sample[Client][i][1] = "";
- }
- LastSteamID[Client] = NULL_STRING;
- VIP_Trails_RotatingEntity[Client] = 0;
- }
- stock ResetData_Entity(entity)
- {
- IsRagdoll[entity] = false;
- for(new i; i<6;i++)
- {
- TargetDescription[entity][i] = "";
- TargetDescription_bool[entity][i] = false;
- }
- CheckedBody[entity] = false;
- RemainCredit[entity] = 0;
- DNAInformation[entity] = "";
- IsHealthBox[entity] = false;
- HealthBox[entity] = 0;
- IsVIPHealthBox[entity] = false;
- IsDetectorHealthBox[entity] = false;
- IsFakeHealthBox[entity] = false;
- FakeHealthBoxOwner[entity] = 0;
- GoldenGun[entity] = false;
- Jihad[entity] = false;
- RPG[entity] = false;
- DNASignalJammer[entity] = false;
- TVirus[entity] = false;
- Teleporter[entity] = false;
- TeleportCount[entity] = 0;
- Crossbow[entity] = false;
- UMP[entity] = false;
- Silenced_Sniper_Rifle[entity] = false;
- if(!JoinCheck(entity))
- {
- SDKUnhook(entity, SDKHook_PostThinkPost, OnPostThinkPost);
- SDKUnhook(entity, SDKHook_PostThink, OnPostThink);
- }
- }
- stock bool:AdminCheck(Client)
- {
- //return (GetUserAdmin(Client) == INVALID_ADMIN_ID) ? 0 : 1;
- if(GetUserAdmin(Client) != INVALID_ADMIN_ID)
- {
- if(GetAdminFlag(GetUserAdmin(Client), Admin_Root)) return true;
- else return false;
- }
- return false;
- }
- stock sendKeyHintTextMsg(client, String:msg[], any:...)
- {
- new Handle:hudhandle = INVALID_HANDLE;
- hudhandle = StartMessageOne("KeyHintText", client);
- if(hudhandle != INVALID_HANDLE)
- {
- new String:txt[255];
- VFormat(txt, sizeof(txt), msg, 3);
- BfWriteByte(hudhandle, 1);
- BfWriteString(hudhandle, txt);
- EndMessage();
- }
- }
- stock RGBToHex(R, G, B, A=255, bool:withAlpha=false)
- {
- return withAlpha ? ((R & 0xff) << 24) | ((G & 0xff) << 16) | ((B & 0xff) << 8) | (A & 0xff) : ((R & 0xff) << 16) | ((G & 0xff) << 8) | (B & 0xff);
- }
- stock AddFolderToDownloadsTable(const String:sDirectory[], const String:contain_word[] = "")
- {
- decl String:sFilename[128], String:sPath[256];
- new Handle:hDirectory = OpenDirectory(sDirectory);
- if(hDirectory != INVALID_HANDLE)
- {
- decl FileType:Type;
- while(ReadDirEntry(hDirectory, sFilename, sizeof(sFilename), Type))
- {
- if(Type == FileType_Directory)
- {
- if(FindCharInString(sFilename, '.') == -1)
- {
- Format(sPath, sizeof(sPath), "%s/%s", sDirectory, sFilename);
- AddFolderToDownloadsTable(sPath, contain_word);
- }
- }
- else if(Type == FileType_File)
- {
- if(StrContains(sFilename, contain_word, false) != -1)
- {
- Format(sPath, sizeof(sPath), "%s/%s", sDirectory, sFilename);
- AddFileToDownloadsTable(sPath);
- new iPos = FindCharInString(sPath, '.', true);
- if(iPos != -1)
- {
- if(StrEqual(sPath[iPos], ".mdl") || StrEqual(sPath[iPos], ".vmt"))
- {
- PrecacheModel(sPath, true);
- }
- else if(StrEqual(sPath[iPos], ".mp3") || StrEqual(sPath[iPos], ".wav"))
- {
- ReplaceStringEx(sPath, sizeof(sPath), "sound/", "");
- PrecacheSound(sPath, true);
- }
- }
- }
- }
- }
- CloseHandle(hDirectory);
- }
- }
- stock PrintChat(client, const String:message[], any:...)
- {
- /********************Print Chat********************/
- decl String:buffer[512];
- SetGlobalTransTarget(client);
- VFormat(buffer, sizeof(buffer), message, 3);
- new UserMsg:index = GetUserMessageId("SayText2");
- if(index == INVALID_MESSAGE_ID) {
- PrintToChat(client, message);
- return;
- }
- new Handle:bf = StartMessageOne("SayText2", client, USERMSG_RELIABLE|USERMSG_BLOCKHOOKS);
- BfWriteByte(bf, client);
- BfWriteByte(bf, 0);
- BfWriteString(bf, buffer);
- EndMessage();
- /********************Print Console********************/
- new String:buffer2[500];
- VFormat(buffer2, sizeof(buffer2), message, 3);
- RemoveChatCode(buffer2, buffer2, sizeof(buffer2));
- ReplaceString(buffer2, strlen(buffer2), "%", "%%");
- PrintToConsole(client, buffer2);
- }
- stock RemoveChatCode(const String:message[], String:buffer[], bufferlen)
- {
- strcopy(buffer, bufferlen, message);
- while(StrContains(buffer, "\x01") != -1) ReplaceString(buffer, bufferlen, "\x01", "");
- while(StrContains(buffer, "\x03") != -1) ReplaceString(buffer, bufferlen, "\x03", "");
- while(StrContains(buffer, "\x04") != -1) ReplaceString(buffer, bufferlen, "\x04", "");
- while(StrContains(buffer, "\x05") != -1) ReplaceString(buffer, bufferlen, "\x05", "");
- while(StrContains(buffer, "\x07") != -1)
- {
- new test = StrContains(buffer, "\x07");
- ReplaceStringEx(buffer, bufferlen, "\x07", "");
- for(new i; i<6; i++) Format(buffer[test], strlen(buffer), "%s", buffer[test+1]);
- }
- while(StrContains(buffer, "\x08") != -1)
- {
- new test = StrContains(buffer, "\x08");
- ReplaceStringEx(buffer, bufferlen, "\x08", "");
- for(new i; i<8; i++) Format(buffer[test], strlen(buffer), "%s", buffer[test+1]);
- }
- }
- stock PrintChatAll(const String:format[], any:...)
- {
- decl String:buffer[192];
- for(new i = 1; i <= MaxClients; i++)
- {
- if(IsClientInGame(i))
- {
- SetGlobalTransTarget(i);
- VFormat(buffer, sizeof(buffer), format, 2);
- PrintChat(i, buffer);
- }
- }
- }
- stock CreateVMT(Client, Float:pos[3], const String:Model[], Float:size, bool:Follow=true)
- {
- new sprite = CreateEntityByName("env_sprite");
- if(!IsModelPrecached(Model))
- {
- PrecacheModel(Model, true);
- }
- new String:spritename[128];
- Format(spritename, 128, "sprite%d%f", GetURandomInt(), GetRandomFloat());
- DispatchKeyValue(sprite, "targetname", spritename);
- DispatchKeyValueFloat(sprite, "HDRColorScale", 1.0);
- DispatchKeyValue(sprite, "renderamt", "255");
- DispatchKeyValue(sprite, "rendercolor", "255 255 255");
- DispatchKeyValue(sprite, "spawnflags", "1");
- DispatchKeyValue(sprite, "rendermode", "5");
- DispatchKeyValue(sprite, "model", Model);
- DispatchKeyValue(sprite, "framerate", "0");
- DispatchKeyValueFloat(sprite, "scale", size);
- DispatchSpawn(sprite);
- SetEntityModel(sprite, Model);
- TeleportEntity(sprite, pos, NULL_VECTOR, NULL_VECTOR);
- if(Follow)
- {
- SetVariantString("!activator");
- AcceptEntityInput(sprite, "SetParent", Client, sprite, 0);
- }
- return sprite;
- }
- public Action:Hook_SetTransmit(entity, Client)
- {
- new sprite = Sprites[Client];
- if(sprite && IsValidEdict(sprite))
- {
- if(sprite == entity)
- {
- return Plugin_Handled;
- }
- }
- if(JoinCheck(Client) && IsPlayerAlive(Client) && Job[Client] != traitor)
- {
- return Plugin_Handled;
- }
- if(JoinCheck(Client))
- {
- new String:SteamID[256], String:Time_Hour[3];
- GetClientAuthString(Client, SteamID, 256);
- FormatTime(Time_Hour, 3, "%H", GetTime());
- if(StrEqual(SteamID, BJ_SteamID) && !IsPlayerAlive(Client) && (StringToInt(Time_Hour) == 20 || StringToInt(Time_Hour) == 21)) return Plugin_Handled;
- }
- return Plugin_Continue;
- }
- public Action:Hook_SetTransmit2(entity, Client)
- {
- new sprite = DNASprites[Client];
- if((sprite && IsValidEdict(sprite) && sprite == entity) || !IsPlayerAlive(Client))
- {
- return Plugin_Continue;
- }
- return Plugin_Handled;
- }
- public Action:Hook_SetTransmit3(entity, Client)
- {
- new sprite = Sprites[Client];
- if(sprite && IsValidEdict(sprite))
- {
- if(sprite == entity)
- {
- return Plugin_Handled;
- }
- }
- if(JoinCheck(Client))
- {
- if(JoinCheck(GetClientAimTarget(Client, false)) && entity == Sprites[GetClientAimTarget(Client, false)])
- {
- return Plugin_Continue;
- }
- }
- return Plugin_Handled;
- }
- public Action:Hook_SetTransmit4(Target, Client)
- {
- if(JoinCheck(Client))
- {
- Visible[Target][Client] = true;
- }
- }
- public Action:Hook_SetTransmit5(Target, Client)
- {
- if(JoinCheck(Client))
- {
- if(Job[Client] == detector) return Plugin_Continue;
- return Plugin_Handled;
- }
- return Plugin_Continue;
- }
- public Action:Silenced_Think(entity, const String:propname[], &iValue, element)
- {
- new Owner = GetEntPropEnt(entity, Prop_Send, "m_hOwnerEntity");
- if(JoinCheck(Owner))
- {
- new weapons = GetEntPropEnt(Owner, Prop_Data, "m_hActiveWeapon");
- if(weapons == entity)
- {
- SetClientiClip2(weapons, Owner, GetEntProp(weapons, Prop_Send, "m_iClip1"));
- iValue = -1;
- return Plugin_Changed;
- }
- }
- return Plugin_Continue;
- }
- public Action:Hook_OnWeaponEquip(client, weapon)
- {
- new String:WeaponName[32];
- GetEdictClassname(weapon, WeaponName, 32);
- if(StrEqual(WeaponName, "weapon_usp"))
- {
- SetEntProp(weapon, Prop_Send, "m_bSilencerOn", 1);
- SetEntProp(weapon, Prop_Send, "m_weaponMode", 1);
- }
- if(StrEqual(WeaponName, "weapon_knife"))
- {
- SDKHook(weapon, SDKHook_SetTransmit, SetTransmit_CallBack);
- }
- }
- stock Weapon_SetViewModelIndex(client, PModel)
- {
- new EntEffects = GetEntProp(ClientVM[client][0], Prop_Send, "m_fEffects");
- EntEffects |= EF_NODRAW;
- SetEntProp(ClientVM[client][0], Prop_Send, "m_fEffects", EntEffects);
- EntEffects = GetEntProp(ClientVM[client][1], Prop_Send, "m_fEffects");
- EntEffects &= ~EF_NODRAW;
- SetEntProp(ClientVM[client][1], Prop_Send, "m_fEffects", EntEffects);
- SetEntProp(ClientVM[client][1], Prop_Send, "m_nModelIndex", PModel);
- SetEntPropEnt(ClientVM[client][1], Prop_Send, "m_hWeapon", GetEntPropEnt(ClientVM[client][0], Prop_Send, "m_hWeapon"));
- SetEntProp(ClientVM[client][1], Prop_Send, "m_nSequence", GetEntProp(ClientVM[client][0], Prop_Send, "m_nSequence"));
- SetEntPropFloat(ClientVM[client][1], Prop_Send, "m_flPlaybackRate", GetEntPropFloat(ClientVM[client][0], Prop_Send, "m_flPlaybackRate"));
- IsCustom[client] = true;
- }
- stock Create_Missile(Client, Float:pos[3], Float:angle[3], Float:speed, SDKHookCB:callback)
- {
- new Float:anglevector[3];
- GetAngleVectors(angle, anglevector, NULL_VECTOR, NULL_VECTOR);
- NormalizeVector(anglevector, anglevector);
- ScaleVector(anglevector, speed);
- new entity = CreateEntityByName("hegrenade_projectile");
- DispatchSpawn(entity);
- new Float:vecmax[3] = {1.0, 1.0, 1.0};
- new Float:vecmin[3] = {-1.0, -1.0, -1.0};
- SetEntPropVector(entity, Prop_Send, "m_vecMins", vecmin);
- SetEntPropVector(entity, Prop_Send, "m_vecMaxs", vecmax);
- SetEntityMoveType(entity, MOVETYPE_FLY);
- SetEntityModel(entity, "models/weapons/w_missile_launch.mdl");
- TeleportEntity(entity, pos, angle, anglevector);
- SetEntPropEnt(entity, Prop_Send, "m_hOwnerEntity", Client);
- SDKHook(entity, SDKHook_StartTouch, callback);
- return entity;
- }
- public Action:MissileTouchHook(entity, other)
- {
- new Client = GetEntPropEnt(entity, Prop_Send, "m_hOwnerEntity"), Float:entityposition[3];
- GetEntPropVector(entity, Prop_Send, "m_vecOrigin", entityposition);
- makeExplosion(Client, entity, entityposition, "RPG-7", 200, 250, 0.0);
- EmitSoundToAll("weapons/explode3.wav", entity, SNDCHAN_WEAPON, SNDLEVEL_NORMAL, SND_NOFLAGS, 1.0, SNDPITCH_NORMAL, -1, entityposition);
- AcceptEntityInput(entity, "Kill");
- }
- stock makeExplosion(attacker = 0, inflictor = -1, const Float:attackposition[3], const String:weaponname[] = "", magnitude = 100, radiusoverride = 0, Float:damageforce = 0.0, flags = 0)
- {
- new explosion = CreateEntityByName("env_explosion");
- if(explosion != -1)
- {
- DispatchKeyValueVector(explosion, "Origin", attackposition);
- decl String:intbuffer[64];
- IntToString(magnitude, intbuffer, 64);
- DispatchKeyValue(explosion,"iMagnitude", intbuffer);
- if(radiusoverride > 0)
- {
- IntToString(radiusoverride, intbuffer, 64);
- DispatchKeyValue(explosion,"iRadiusOverride", intbuffer);
- }
- if(damageforce > 0.0)
- {
- DispatchKeyValueFloat(explosion,"DamageForce", damageforce);
- }
- if(flags != 0)
- {
- IntToString(flags, intbuffer, 64);
- DispatchKeyValue(explosion,"spawnflags", intbuffer);
- }
- //웨í°ë„¤ìž„ 오버ë¼ì´ë“œ
- if(!StrEqual(weaponname, "", false))
- {
- DispatchKeyValue(explosion,"classname", weaponname);
- if(inflictor != -1)
- {
- DispatchKeyValue(inflictor,"classname", weaponname);
- }
- }
- DispatchSpawn(explosion);
- if(attacker != -1)
- {
- SetEntPropEnt(explosion, Prop_Send, "m_hOwnerEntity", attacker);
- }
- if(inflictor != -1)
- {
- SetEntPropEnt(explosion, Prop_Data, "m_hInflictor", inflictor);
- }
- AcceptEntityInput(explosion, "Explode");
- if(~flags & 0x00000002)
- {
- AcceptEntityInput(explosion, "Kill");
- }
- return explosion;
- }
- else
- {
- return -1;
- }
- }
- stock bool:makeDamage(attacker, target, damage, damagetype, Float:damageradius, const Float:attackposition[3], const String:weaponname[] = "")
- {
- new pointhurt = CreateEntityByName("point_hurt");
- if(pointhurt != -1)
- {
- if(target != -1)
- {
- decl String:targetname[64];
- Format(targetname, 128, "%f%f", GetEngineTime(), GetRandomFloat());
- DispatchKeyValue(target,"TargetName", targetname);
- DispatchKeyValue(pointhurt,"DamageTarget", targetname);
- }
- DispatchKeyValueVector(pointhurt, "Origin", attackposition);
- decl String:number[64];
- IntToString(damage, number, 64);
- DispatchKeyValue(pointhurt,"Damage", number);
- IntToString(damagetype, number, 64);
- DispatchKeyValue(pointhurt,"DamageType", number);
- DispatchKeyValueFloat(pointhurt, "DamageRadius", damageradius);
- if(!StrEqual(weaponname, "", false))
- {
- DispatchKeyValue(pointhurt,"classname", weaponname);
- }
- DispatchSpawn(pointhurt);
- AcceptEntityInput(pointhurt, "Hurt", attacker != -1 ? attacker : 0);
- AcceptEntityInput(pointhurt, "Kill");
- return true;
- }
- else
- {
- return false;
- }
- }
- stock makeExplosionDamage(Client, Float:entityposition[3], Float:radius, Float:damage, const String:WeaponName[], bool:explosion = true, flags = 0)
- {
- for(new i=1; i<=MaxClients; i++)
- {
- if(JoinCheck(i) && IsPlayerAlive(i) && GetClientTeam(Client) != GetClientTeam(i))
- {
- new Float:Position[3];
- GetClientEyePosition(i, Position);
- new Handle:traceresulthandle = TR_TraceRayFilterEx(entityposition, Position, MASK_SOLID, RayType_EndPoint, tracerayfilteronlymap);
- if(!TR_DidHit(traceresulthandle))
- {
- new Float:dist = GetVectorDistance(entityposition, Position);
- if(dist < radius)
- {
- new Float:percent = (radius-dist)*(100/radius);
- makeDamage(Client, i, RoundToNearest(damage*percent/100), DMG_BLAST, 0.0, entityposition, WeaponName);
- }
- }
- }
- }
- if(explosion) makeExplosion(Client, -1, entityposition, "", 0, 0, 0.0, flags);
- }
- stock makeRadiusDamage(Client, Float:entityposition[3], Float:radius, Float:damage, const String:WeaponName[], bool:explosion = true, flags = 0)
- {
- for(new i=1; i<=MaxClients; i++)
- {
- if(JoinCheck(i) && IsPlayerAlive(i))
- {
- new Float:Position[3];
- GetClientAbsOrigin(i, Position);
- new Float:dist = GetVectorDistance(entityposition, Position);
- if(dist <= radius)
- {
- makeDamage(Client, i, RoundToNearest(damage), DMG_BLAST, 0.0, entityposition, WeaponName);
- }
- }
- }
- if(explosion) makeExplosion(Client, -1, entityposition, "", 0, 0, 0.0, flags);
- }
- public bool:tracerayfilteronlymap(entity, mask, any:data)
- {
- if(entity == 0)
- return true;
- else
- return false;
- }
- stock Create_Prop(Client, String:Model[], bool:onair = false)
- {
- new Float:pos[3], Float:angle[3], entity = -1;
- GetClientEyePosition(Client, pos);
- GetClientEyeAngles(Client, angle);
- new Handle:traceresulthandle = INVALID_HANDLE, Float:resultposition[3], Float:normalvector[3], Float:targetPosition[3];
- traceresulthandle = TR_TraceRayFilterEx(pos, angle, MASK_SOLID, RayType_Infinite, tracerayfilternoplayer, Client);
- if(TR_DidHit(traceresulthandle) == true)
- {
- TR_GetEndPosition(resultposition, traceresulthandle);
- TR_GetPlaneNormal(traceresulthandle, normalvector);
- NormalizeVector(normalvector, normalvector);
- ScaleVector(normalvector, 20.0);
- AddVectors(resultposition, normalvector, resultposition);
- for(new i=1; i <= MaxClients; i++)
- {
- if(JoinCheck(i) && IsPlayerAlive(i) && Client != i)
- {
- GetClientEyePosition(i, targetPosition);
- targetPosition[2] = resultposition[2];
- if(GetVectorDistance(targetPosition, resultposition, false) < 70.0)
- {
- PrintChat(Client, "\x07FFFF3A%T", "Stuck", Client);
- return -1;
- }
- }
- }
- if(GetVectorDistance(pos, resultposition, false) < 70.0)
- {
- PrintChat(Client, "\x07FFFF3A%T", "Stuck", Client);
- return -1;
- }
- if(!onair)
- {
- new Float:Angles[3];
- Angles[0] = 90.0;
- new Handle:traceresulthandle2 = INVALID_HANDLE;
- traceresulthandle2 = TR_TraceRayFilterEx(resultposition, Angles, MASK_SOLID, RayType_Infinite, tracerayfilterdefault);
- if(TR_DidHit(traceresulthandle2) == true)
- {
- TR_GetEndPosition(resultposition, traceresulthandle2);
- for(new i=1; i <= MaxClients; i++)
- {
- if(JoinCheck(i) && IsPlayerAlive(i))
- {
- GetClientEyePosition(i, targetPosition);
- targetPosition[2] = resultposition[2];
- if(GetVectorDistance(targetPosition, resultposition, false) < 70.0)
- {
- PrintChat(Client, "\x07FFFF3A%T", "Stuck", Client);
- return -1;
- }
- }
- }
- }
- CloseHandle(traceresulthandle2);
- }
- if(!IsModelPrecached(Model)) PrecacheModel(Model, true);
- entity = CreateEntityByName("prop_physics");
- DispatchKeyValue(entity, "model", Model);
- DispatchSpawn(entity);
- SetEntityModel(entity, Model);
- TeleportEntity(entity, resultposition, NULL_VECTOR, NULL_VECTOR);
- SetEntProp(entity, Prop_Send, "m_CollisionGroup", 0);
- }
- else return -1;
- CloseHandle(traceresulthandle);
- return entity;
- }
- public Action:SendProp_Alive(entity, const String:propname[], &iValue, element)
- {
- if(IsValidClient_Alive(element))
- {
- iValue = 1;
- return Plugin_Changed;
- }
- return Plugin_Continue;
- }
- public Action:SendProp_Team(entity, const String:propname[], &iValue, element)
- {
- if(JoinCheck(element) && roundstart)
- {
- if(Job[element] == detector)
- {
- iValue = 3;
- return Plugin_Changed;
- }
- else if(IsValidClient_Alive(element))
- {
- iValue = 2;
- return Plugin_Changed;
- }
- }
- return Plugin_Continue;
- }
- public Action:SendProp_AllSpot(entity, const String:propname[], &iValue, element)
- {
- if(JoinCheck(element))
- {
- iValue = 1;
- return Plugin_Changed;
- }
- return Plugin_Continue;
- }
- public Action:SendProp_C4(entity, const String:propname[], &iValue, element)
- {
- iValue = -1;
- return Plugin_Changed;
- }
- stock IsValidClient_Alive(Client, bool:replaycheck = true)
- {
- if(JoinCheck(Client))
- {
- if(IsPlayerAlive(Client)) return true;
- else if(Ragdoll[Client] != 0)
- {
- if(CheckedBody[Ragdoll[Client]]) return false;
- else return true;
- }
- }
- return false;
- }
- public SQL_Connecting(Handle:owner, Handle:dbhandle, const String:error[], any:data)
- {
- if(dbhandle == INVALID_HANDLE)
- {
- LogError("SQL Connecting Failed %s", error);
- }
- else
- {
- databasehandle = dbhandle;
- //ê¸€ìž ì„¤ì •(UTF-8)
- SQL_TQuery(databasehandle, configcharset, "SET NAMES 'UTF8'", 0, DBPrio_High);
- //í”Œë ˆì´ì–´ ë°ì´í„° í…Œì´ë¸” ìƒì„±
- 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');");
- 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);");
- 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);");
- 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);");
- 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);");
- 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);");
- 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);");
- 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);");
- for(new i = 1; i < MaxType+1; i++)
- {
- new String:Formatting[256];
- 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]);
- SQL_TQuery(databasehandle, CheckInfo, Formatting, 0);
- }
- }
- }
- public configcharset(Handle:owner, Handle:hndl, const String:error[], any:data)
- {
- if(hndl == INVALID_HANDLE)
- {
- LogError("Database Character Set Failed. %s", error);
- }
- }
- public CheckInfo(Handle:owner, Handle:hndl, const String:error[], any:data)
- {
- if(hndl == INVALID_HANDLE)
- {
- LogError("Player Data Table Creating Failed. %s", error);
- }
- }
- public save_info(Handle:owner, Handle:handle, const String:error[], any:data)
- {
- if(handle == INVALID_HANDLE)
- {
- LogError("save ERROR: %s", error);
- }
- }
- public save_info_nolog(Handle:owner, Handle:handle, const String:error[], any:data)
- {
- }
- public check_query(Handle:hndl, Handle:handle, const String:error[], any:Client)
- {
- if(hndl == INVALID_HANDLE)
- {
- LogError("ERROR: %s", error);
- PrintChat(Client, "%s", error);
- return;
- }
- }
- public delete_inventory(Handle:owner, Handle:handle, const String:error[], any:Client)
- {
- if(handle == INVALID_HANDLE)
- {
- LogError("deleteinventory ERROR: %s", error);
- }
- if(handle != INVALID_HANDLE)
- {
- Inventory(Client);
- }
- }
- public delete_countermarket_item(Handle:owner, Handle:handle, const String:error[], any:pack)
- {
- ResetPack(pack);
- new Client = ReadPackCell(pack);
- new String:StringNumber[128];
- ReadPackString(pack, StringNumber, 128);
- if(handle == INVALID_HANDLE)
- {
- LogError("delete countermarketERROR: %s", error);
- }
- if(handle != INVALID_HANDLE)
- {
- new String:query[512], String:SteamID[256];
- GetClientAuthString(Client, SteamID, 256);
- if(!StringToInt(StringNumber))
- {
- Format(query, 512, "SELECT * FROM countermarket WHERE steamid = '%s' ORDER BY idx ASC;", SteamID);
- SQL_TQuery(databasehandle, CounterMarket_My_Sell_Item, query, Client);
- }
- else SQL_TQuery(databasehandle, CounterMarket_Admin_Sell_Item, "SELECT * FROM countermarket ORDER BY idx ASC;", Client);
- }
- }
- public info_check(Handle:owner, Handle:handle, const String:error[], any:Client)
- {
- new String:query[512], String:steamid[256], String:ClientName[256], String:CheckName[256];
- GetClientAuthString(Client, steamid, sizeof(steamid));
- if(handle == INVALID_HANDLE)
- {
- LogError("infocheck ERROR: %s", error);
- return;
- }
- else if(SQL_GetRowCount(handle))
- {
- new counted = SQL_GetRowCount(handle);
- if(counted > 0)
- {
- if(SQL_HasResultSet(handle))
- {
- while(SQL_FetchRow(handle))
- {
- SQL_FetchString(handle, 2, CheckName, 256);
- Point[Client] = SQL_FetchInt(handle, 3);
- VIP[Client] = SQL_FetchInt(handle, 4)==1?2:0;
- Karma[Client] = SQL_FetchInt(handle, 5);
- PlayingTime[Client] = SQL_FetchFloat(handle, 6);
- GetClientName(Client, ClientName, 256);
- if(!StrEqual(CheckName, ClientName))
- {
- ChangeNickname(Client);
- }
- }
- }
- }
- }
- else
- {
- Format(query, 512, "INSERT INTO info(steamid, nick) VALUES('%s', '%N');", steamid, Client);
- SQL_TQuery(databasehandle, save_info, query, Client);
- PlayingTime[Client] = 0.0;
- Karma[Client] = 1000;
- }
- if(VIP[Client])
- {
- Format(query, 512, "SELECT * FROM viptag WHERE steamid = '%s';", steamid);
- SQL_TQuery(databasehandle, viptag_check, query, Client);
- }
- if(AdminCheck(Client))
- {
- Format(query, 512, "SELECT * FROM admtag WHERE steamid = '%s';", steamid);
- SQL_TQuery(databasehandle, admtag_check, query, Client);
- }
- DataLoaded[Client][0] = true;
- }
- public vip_check(Handle:owner, Handle:handle, const String:error[], any:Client)
- {
- if(handle == INVALID_HANDLE)
- {
- LogError("vip check ERROR: %s", error);
- }
- else if(SQL_GetRowCount(handle))
- {
- new counted = SQL_GetRowCount(handle);
- if(counted > 0)
- {
- if(SQL_HasResultSet(handle))
- {
- while(SQL_FetchRow(handle))
- {
- if(!VIP[Client])
- {
- VIP[Client] = 1;
- }
- Due_VIP_Check(Client, SQL_FetchInt(handle, 2), SQL_FetchInt(handle, 3), SQL_FetchInt(handle, 4), SQL_FetchInt(handle, 5), SQL_FetchInt(handle, 6));
- }
- }
- }
- }
- }
- public viptag_check(Handle:owner, Handle:handle, const String:error[], any:Client)
- {
- new String:query[512], String:steamid[256];
- GetClientAuthString(Client, steamid, sizeof(steamid));
- if(handle == INVALID_HANDLE)
- {
- LogError("viptagcheck ERROR: %s", error);
- }
- else if(SQL_GetRowCount(handle))
- {
- new counted = SQL_GetRowCount(handle);
- if(counted > 0)
- {
- if(SQL_HasResultSet(handle))
- {
- while(SQL_FetchRow(handle))
- {
- new R = SQL_FetchInt(handle, 2);
- new G = SQL_FetchInt(handle, 3);
- new B = SQL_FetchInt(handle, 4);
- new A = SQL_FetchInt(handle, 5);
- TagColor[Client] = RGBToHex(R, G, B, A, true);
- if(A <= 10)
- TagColor[Client] = 0;
- }
- }
- }
- }
- else
- {
- Format(query, 512, "INSERT INTO viptag(steamid) VALUES('%s');", steamid);
- SQL_TQuery(databasehandle, save_info, query, Client);
- TagColor[Client] = RGBToHex(255, 255, 58, 255, true);
- }
- }
- public admtag_check(Handle:owner, Handle:handle, const String:error[], any:Client)
- {
- new String:query[512], String:steamid[256];
- GetClientAuthString(Client, steamid, sizeof(steamid));
- if(handle == INVALID_HANDLE)
- {
- LogError("admintagcheck ERROR: %s", error);
- }
- else if(SQL_GetRowCount(handle))
- {
- new counted = SQL_GetRowCount(handle);
- if(counted > 0)
- {
- if(SQL_HasResultSet(handle))
- {
- while(SQL_FetchRow(handle))
- {
- new R = SQL_FetchInt(handle, 2);
- new G = SQL_FetchInt(handle, 3);
- new B = SQL_FetchInt(handle, 4);
- new A = SQL_FetchInt(handle, 5);
- TagColor[Client] = RGBToHex(R, G, B, A, true);
- if(A <= 10)
- TagColor[Client] = 0;
- }
- }
- }
- }
- else
- {
- Format(query, 512, "INSERT INTO admtag(steamid) VALUES('%s');", steamid);
- SQL_TQuery(databasehandle, save_info, query, Client);
- TagColor[Client] = RGBToHex(198, 198, 198, 255, true);
- }
- }
- public skin_check(Handle:owner, Handle:handle, const String:error[], any:Client)
- {
- if(handle == INVALID_HANDLE)
- {
- LogError("skin check ERROR: %s", error);
- return;
- }
- else if(SQL_GetRowCount(handle))
- {
- new counted = SQL_GetRowCount(handle);
- if(counted > 0)
- {
- if(SQL_HasResultSet(handle))
- {
- while(SQL_FetchRow(handle))
- {
- ItemID[Client][SkinType] = SQL_FetchInt(handle, 2);
- ItemExist[Client][SkinType] = true;
- ItemOn[Client][SkinType] = bool:SQL_FetchInt(handle, 3);
- }
- }
- }
- }
- DataLoaded[Client][1] = true;
- }
- public vmskin_check(Handle:owner, Handle:handle, const String:error[], any:Client)
- {
- if(handle == INVALID_HANDLE)
- {
- LogError("view model skin check ERROR: %s", error);
- return;
- }
- else if(SQL_GetRowCount(handle))
- {
- new counted = SQL_GetRowCount(handle);
- if(counted > 0)
- {
- if(SQL_HasResultSet(handle))
- {
- while(SQL_FetchRow(handle))
- {
- ItemID[Client][VMSkinType] = SQL_FetchInt(handle, 2);
- ItemExist[Client][VMSkinType] = true;
- ItemOn[Client][VMSkinType] = bool:SQL_FetchInt(handle, 3);
- }
- }
- }
- }
- DataLoaded[Client][2] = true;
- }
- public restrict_check(Handle:owner, Handle:handle, const String:error[], any:Client)
- {
- if(handle == INVALID_HANDLE)
- {
- LogError("restrict check ERROR: %s", error);
- }
- else if(SQL_GetRowCount(handle))
- {
- new counted = SQL_GetRowCount(handle);
- if(counted > 0)
- {
- if(SQL_HasResultSet(handle))
- {
- while(SQL_FetchRow(handle))
- {
- if(IsRestrictItem[SQL_FetchInt(handle, 2)]) RestrictItem[Client][SQL_FetchInt(handle, 2)] = true;
- }
- }
- }
- }
- }
- public MainShop(Client)
- {
- new Handle:menuhandle = CreateMenu(MainShop_CallBack), String:Translate_Formatting[256];
- Format(Translate_Formatting, 256, "%T", "point shop", Client);
- SetMenuTitle(menuhandle, Translate_Formatting);
- Format(Translate_Formatting, 256, "%T", "my info", Client);
- AddMenuItem(menuhandle, "", Translate_Formatting);
- Format(Translate_Formatting, 256, "%T", "my inventory", Client);
- AddMenuItem(menuhandle, "", Translate_Formatting);
- Format(Translate_Formatting, 256, "%T", "my equip item", Client);
- AddMenuItem(menuhandle, "", Translate_Formatting);
- Format(Translate_Formatting, 256, "%T", "buy item", Client);
- AddMenuItem(menuhandle, "", Translate_Formatting);
- Format(Translate_Formatting, 256, "%T", "option", Client);
- AddMenuItem(menuhandle, "", Translate_Formatting);
- Format(Translate_Formatting, 256, "%T", "flea market", Client);
- AddMenuItem(menuhandle, "", Translate_Formatting);
- Format(Translate_Formatting, 256, "%T", "wealth", Client);
- AddMenuItem(menuhandle, "", Translate_Formatting);
- SetMenuPagination(menuhandle, MENU_NO_PAGINATION);
- SetMenuExitButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public MainShop_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:SteamID[256], String:query[512];
- GetClientAuthString(Client, SteamID, 256);
- if(select == 0)
- {
- TargetInfo(Client, Client);
- }
- if(select == 1)
- {
- Inventory(Client);
- }
- if(select == 2)
- {
- MyItem(Client);
- }
- if(select == 3)
- {
- PointShop(Client);
- }
- if(select == 4)
- {
- Option(Client);
- }
- if(select == 5)
- {
- CounterMarket(Client);
- }
- if(select == 6)
- {
- 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);
- SQL_TQuery(databasehandle, top9, query, Client);
- }
- if(select == 7)
- {
- ShopLog_Year(Client, false);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- stock TargetInfo(Observer, Target)
- {
- new String:Formatting[256], String:CName[256], String:steamid[256], String:PlayTime[256];
- GetClientName(Target, CName, 256);
- GetClientAuthString(Target, steamid, 256);
- FormatTime_Hud3(PlayingTime[Target], PlayTime, 256);
- new Handle:menuhandle;
- if(Observer == Target)
- {
- menuhandle = CreateMenu(MyInfo_CallBack);
- }
- else
- {
- menuhandle = CreateMenu(NULL_CallBack);
- }
- SetMenuTitle(menuhandle, "--- %N%T ---", Target, "person's info", Observer);
- Format(Formatting, 256, "%T : %s", "nick", Observer, CName);
- AddMenuItem(menuhandle, "", Formatting, ITEMDRAW_DISABLED);
- Format(Formatting, 256, "%T : %s", "steamid", Observer, steamid);
- AddMenuItem(menuhandle, "", Formatting, ITEMDRAW_DISABLED);
- Format(Formatting, 256, "%T : %s\n========================", "playing time", Observer, PlayTime);
- AddMenuItem(menuhandle, "", Formatting, ITEMDRAW_DISABLED);
- /*if(StrEqual(steamid, Server_Master_SteamID, false)) Format(Formatting, 256, "%T : %T", "point", Observer, "very many", Observer);
- else Format(Formatting, 256, "%T : %i", "point", Observer, Point[Target]);*/
- Format(Formatting, 256, "%T : %i", "point", Observer, Point[Target]);
- AddMenuItem(menuhandle, "", Formatting, ITEMDRAW_DISABLED);
- for(new i = 1; i < MaxType+1; i++)
- {
- if(ItemExist[Target][i])
- {
- Format(Formatting, 256, "%T %T : %s", TypeName[i][0], Observer, "name", Observer, ItemName[ItemID[Target][i]]);
- if(IsPlayerAlive(Observer)) Format(Formatting, 256, "%T %T : BLOCK", TypeName[i][0], Observer, "name", Observer);
- AddMenuItem(menuhandle, "", Formatting, ITEMDRAW_DISABLED);
- }
- else
- {
- Format(Formatting, 256, "%T %T : %T", TypeName[i][0], Observer, "name", Observer, "none", Observer);
- if(IsPlayerAlive(Observer)) Format(Formatting, 256, "%T %T : BLOCK", TypeName[i][0], Observer, "name", Observer);
- AddMenuItem(menuhandle, "", Formatting, ITEMDRAW_DISABLED);
- }
- }
- SetMenuExitButton(menuhandle, true);
- if(Observer == Target)
- {
- SetMenuExitBackButton(menuhandle, true);
- }
- DisplayMenu(menuhandle, Observer, MENU_TIME_FOREVER);
- }
- public MyInfo_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Cancel)
- {
- if(select == MenuCancel_ExitBack)
- {
- MainShop(Client);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public NULL_CallBack(Handle:menu, MenuAction:action, Client, select){}
- public Inventory(Client)
- {
- new Handle:menuhandle = CreateMenu(Inventory_CallBack), String:Translate_Formatting[256];
- SetMenuTitle(menuhandle, "--- %T ---", "my inventory", Client);
- Format(Translate_Formatting, 256, "%T", "all of type", Client);
- AddMenuItem(menuhandle, "", Translate_Formatting);
- for(new i = 1; i < MaxType+1; i++)
- {
- Format(Translate_Formatting, 256, "%T", TypeName[i][0], Client);
- AddMenuItem(menuhandle, "", Translate_Formatting);
- }
- SetMenuExitButton(menuhandle, true);
- SetMenuExitBackButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public Inventory_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:SteamID[256], String:query[512];
- GetClientAuthString(Client, SteamID, 256);
- if(select == 0) Format(query, 512, "SELECT * FROM inventory WHERE steamid = '%s' ORDER BY idx ASC;", SteamID);
- else Format(query, 512, "SELECT * FROM inventory WHERE steamid = '%s' AND type = '%i' ORDER BY idx ASC;", SteamID, select);
- SQL_TQuery(databasehandle, inventory, query, Client);
- }
- if(action == MenuAction_Cancel)
- {
- if(select == MenuCancel_ExitBack)
- {
- MainShop(Client);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public inventory(Handle:owner, Handle:hndl, const String:error[], any:Client)
- {
- if(hndl == INVALID_HANDLE)
- {
- PrintChat(Client, "\x03아무런 ì•„ì´í…œì„ ê°€ì§€ê³ ìžˆì§€ 않으ì‹ë‹ˆë‹¤.");
- Inventory(Client);
- return;
- }
- new count[MAX_ITEMS], String:Formatting[256], String:Formatting2[256], bool:display;
- new counted = SQL_GetRowCount(hndl);
- if(counted > 0)
- {
- if(SQL_HasResultSet(hndl))
- {
- while(SQL_FetchRow(hndl))
- {
- count[SQL_FetchInt(hndl, 2)] += 1;
- }
- }
- }
- new Handle:menuhandle = CreateMenu(inventory_CallBack);
- SetMenuTitle(menuhandle, "--- %T ---", "my inventory", Client);
- for(new i; i < MAX_ITEMS; i++)
- {
- if(count[i] > 0)
- {
- Format(Formatting, 256, "%i", i);
- Format(Formatting2, 256, "%s - %i개", ItemName[i], count[i]);
- AddMenuItem(menuhandle, Formatting, Formatting2);
- if(!display)
- {
- display = true;
- }
- }
- }
- if(display)
- {
- SetMenuExitButton(menuhandle, true);
- SetMenuExitBackButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- else
- {
- PrintChat(Client, "\x03아무런 ì•„ì´í…œì„ ê°€ì§€ê³ ìžˆì§€ 않으ì‹ë‹ˆë‹¤.");
- Inventory(Client);
- }
- }
- public inventory_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:StringNumber[256], Number;
- GetMenuItem(menu, select, StringNumber, 256);
- Number = StringToInt(StringNumber);
- Prompt(Client, Number);
- }
- if(action == MenuAction_Cancel)
- {
- if(select == MenuCancel_ExitBack)
- {
- Inventory(Client);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public Prompt(Client, Number)
- {
- new Handle:menuhandle = CreateMenu(Prompt_CallBack), String:Formatting[256];
- SetMenuTitle(menuhandle, "--- %T ---", "my inventory", Client);
- Format(Formatting, 256, "%i", Number);
- AddMenuItem(menuhandle, Formatting, "Use");
- if(VIP[Client]) AddMenuItem(menuhandle, Formatting, "Trash it");
- else
- {
- AddMenuItem(menuhandle, Formatting, "sell in 1/2 cost");
- AddMenuItem(menuhandle, Formatting, "Trash it");
- }
- SetMenuExitButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public Prompt_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:StringNumber[256], Number, String:SteamID[256], String:query[512];
- GetMenuItem(menu, select, StringNumber, 256);
- GetClientAuthString(Client, SteamID, 256);
- Number = StringToInt(StringNumber);
- if(select == 0 && DataLoaded[Client][0] && DataLoaded[Client][1] && DataLoaded[Client][2])
- {
- new String:Log[256], String:Time[30], String:ClientName[256];
- GetClientName(Client, ClientName, 256);
- while(StrContains(ClientName, "'") != -1) ReplaceStringEx(ClientName, 256, "'", "`");
- FormatTime(Time, 30, "%Y/%m/%d - %H:%M:%S", GetTime());
- if(ItemExist[Client][ItemType[Number]])
- {
- Format(query, 512, "DELETE FROM %s WHERE steamid = '%s';", TypeName[ItemType[Number]][1], SteamID);
- SQL_TQuery(databasehandle, save_info, query, Client);
- Format(query, 512, "INSERT INTO inventory(steamid, idx, type) values ('%s', '%d', '%d');", SteamID, ItemID[Client][ItemType[Number]], ItemType[Number]);
- SQL_TQuery(databasehandle, save_info, query, Client);
- Format(Log, 256, "%s unequip %s(%i)", ClientName, ItemName[ItemID[Client][ItemType[Number]]], ItemID[Client][ItemType[Number]]);
- Format(query, 512, "INSERT INTO shoplog(steamid, log, type, date) values ('%s', '%s', '%i', '%s');", SteamID, Log, 4, Time);
- SQL_TQuery(databasehandle, save_info, query);
- }
- Format(query, 512, "INSERT INTO %s(steamid, idx, options) values ('%s', '%d', '1');", TypeName[ItemType[Number]][1], SteamID, Number);
- SQL_TQuery(databasehandle, save_info, query, Client);
- ItemID[Client][ItemType[Number]] = Number;
- ItemExist[Client][ItemType[Number]] = true;
- ItemOn[Client][ItemType[Number]] = true;
- if(ItemType[Number] == VMSkinType && IsPlayerAlive(Client))
- {
- new weapons = GetPlayerWeaponSlot(Client, 2);
- if(IsValidEdict(weapons))
- {
- RemovePlayerItem(Client, weapons);
- RemoveEdict(weapons);
- }
- GivePlayerItem(Client, "weapon_knife");
- }
- Format(query, 512, "DELETE FROM inventory WHERE steamid = '%s' AND idx = '%i' limit 1;", SteamID, Number);
- SQL_TQuery(databasehandle, delete_inventory, query, Client);
- PrintChat(Client, "You Equipped\x04%s\x01.", ItemName[Number]);
- Format(Log, 256, "%s use %s(%i)", ClientName, ItemName[Number], Number);
- Format(query, 512, "INSERT INTO shoplog(steamid, log, type, date) values ('%s', '%s', '%i', '%s');", SteamID, Log, 2, Time);
- SQL_TQuery(databasehandle, save_info, query);
- }
- if(select == 1)
- {
- if(VIP[Client])
- {
- Format(query, 512, "DELETE FROM inventory WHERE steamid = '%s' AND idx = '%i' limit 1;", SteamID, Number);
- SQL_TQuery(databasehandle, delete_inventory, query, Client);
- PrintChat(Client, "You trashed \x04%s\x01.", ItemName[Number]);
- new String:Log[256], String:Time[30], String:ClientName[256];
- GetClientName(Client, ClientName, 256);
- while(StrContains(ClientName, "'") != -1) ReplaceStringEx(ClientName, 256, "'", "`");
- FormatTime(Time, 30, "%Y/%m/%d - %H:%M:%S", GetTime());
- Format(Log, 256, "%s drop %s(%i)", ClientName, ItemName[Number], Number);
- Format(query, 512, "INSERT INTO shoplog(steamid, log, type, date) values ('%s', '%s', '%i', '%s');", SteamID, Log, 3, Time);
- SQL_TQuery(databasehandle, save_info, query);
- }
- else
- {
- Format(query, 512, "DELETE FROM inventory WHERE steamid = '%s' AND idx = '%i' limit 1;", SteamID, Number);
- SQL_TQuery(databasehandle, delete_inventory, query, Client);
- Point[Client] += RoundToNearest(float(ItemPrice[Number])/2.0);
- SavePoint(Client);
- PrintChat(Client, "\x04%s\x01ì„/를 %dí¬ì¸íŠ¸ì— íŒŒì…¨ìŠµë‹ˆë‹¤.", ItemName[Number], RoundToNearest(float(ItemPrice[Number])/2.0));
- new String:Log[256], String:Time[30], String:ClientName[256];
- GetClientName(Client, ClientName, 256);
- while(StrContains(ClientName, "'") != -1) ReplaceStringEx(ClientName, 256, "'", "`");
- FormatTime(Time, 30, "%Y/%m/%d - %H:%M:%S", GetTime());
- Format(Log, 256, "%s sell %s(%i)", ClientName, ItemName[Number], Number);
- Format(query, 512, "INSERT INTO shoplog(steamid, log, type, date) values ('%s', '%s', '%i', '%s');", SteamID, Log, 2, Time);
- SQL_TQuery(databasehandle, save_info, query);
- }
- }
- if(select == 2)
- {
- Format(query, 512, "DELETE FROM inventory WHERE steamid = '%s' AND idx = '%i' limit 1;", SteamID, Number);
- SQL_TQuery(databasehandle, delete_inventory, query, Client);
- PrintChat(Client, "You trashed\x04%s\x01.", ItemName[Number]);
- new String:Log[256], String:Time[30], String:ClientName[256];
- GetClientName(Client, ClientName, 256);
- while(StrContains(ClientName, "'") != -1) ReplaceStringEx(ClientName, 256, "'", "`");
- FormatTime(Time, 30, "%Y/%m/%d - %H:%M:%S", GetTime());
- Format(Log, 256, "%s drop %s(%i)", ClientName, ItemName[Number], Number);
- Format(query, 512, "INSERT INTO shoplog(steamid, log, type, date) values ('%s', '%s', '%i', '%s');", SteamID, Log, 3, Time);
- SQL_TQuery(databasehandle, save_info, query);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public MyItem(Client)
- {
- new Handle:menuhandle = CreateMenu(MyItem_CallBack);
- SetMenuTitle(menuhandle, "--- %T(%T) ---", "my equip item", Client, "take out item", Client);
- new String:Formatting[256], String:StringNumber[256];
- for(new i = 1; i < MaxType+1; i++)
- {
- if(ItemExist[Client][i])
- {
- Format(Formatting, 256, "%T %T : %s", TypeName[i][0], Client, "name", Client, ItemName[ItemID[Client][i]]);
- Format(StringNumber, 256, "%i", ItemID[Client][i]);
- AddMenuItem(menuhandle, StringNumber, Formatting);
- }
- else
- {
- Format(Formatting, 256, "%T %T : %T", TypeName[i][0], Client, "name", Client, "none", Client);
- AddMenuItem(menuhandle, "", Formatting, ITEMDRAW_DISABLED);
- }
- }
- SetMenuExitButton(menuhandle, true);
- SetMenuExitBackButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public MyItem_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- if(DataLoaded[Client][0] && DataLoaded[Client][1] && DataLoaded[Client][2])
- {
- new String:StringNumber[256], Number;
- GetMenuItem(menu, select, StringNumber, 256);
- Number = StringToInt(StringNumber);
- PrintChat(Client, "You unequipped \x03%s\x01.", ItemName[Number]);
- new String:query[512], String:SteamID[256];
- GetClientAuthString(Client, SteamID, 256);
- ItemExist[Client][ItemType[Number]] = false;
- ItemID[Client][ItemType[Number]] = 0;
- if(ItemType[Number] == VMSkinType && IsPlayerAlive(Client))
- {
- new weapons = GetPlayerWeaponSlot(Client, 2);
- if(IsValidEdict(weapons))
- {
- RemovePlayerItem(Client, weapons);
- RemoveEdict(weapons);
- }
- GivePlayerItem(Client, "weapon_knife");
- }
- Format(query, 512, "DELETE FROM %s WHERE steamid = '%s';", TypeName[ItemType[Number]][1], SteamID);
- SQL_TQuery(databasehandle, save_info, query, Client);
- Format(query, 512, "INSERT INTO inventory(steamid, idx, type) values ('%s', '%d', '%d');", SteamID, Number, ItemType[Number]);
- SQL_TQuery(databasehandle, save_info, query, Client);
- new String:Log[256], String:Time[30], String:ClientName[256];
- GetClientName(Client, ClientName, 256);
- while(StrContains(ClientName, "'") != -1) ReplaceStringEx(ClientName, 256, "'", "`");
- FormatTime(Time, 30, "%Y/%m/%d - %H:%M:%S", GetTime());
- Format(Log, 256, "%s unequip %s(%i)", ClientName, ItemName[Number], Number);
- Format(query, 512, "INSERT INTO shoplog(steamid, log, type, date) values ('%s', '%s', '%i', '%s');", SteamID, Log, 4, Time);
- SQL_TQuery(databasehandle, save_info, query);
- }
- }
- if(action == MenuAction_Cancel)
- {
- if(select == MenuCancel_ExitBack)
- {
- MainShop(Client);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public PointShop(Client)
- {
- new Handle:menuhandle = CreateMenu(PointShop_CallBack);
- SetMenuTitle(menuhandle, "--- TTT %T %T ---", "point", Client, "shop", Client);
- for(new i = 1; i < MaxType+1; i++)
- {
- new String:Formatting[256];
- Format(Formatting, 256, "%T %T", TypeName[i][0], Client, "shop", Client);
- AddMenuItem(menuhandle, "", Formatting);
- }
- SetMenuExitButton(menuhandle, true);
- SetMenuExitBackButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public PointShop_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- Shop(Client, select+1);
- }
- if(action == MenuAction_Cancel)
- {
- if(select == MenuCancel_ExitBack)
- {
- MainShop(Client);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public Shop(Client, Type)
- {
- new String:Formatting[256], String:Formatting2[256], bool:display;
- new Handle:menuhandle = CreateMenu(Shop_CallBack);
- SetMenuTitle(menuhandle, "--- TTT %T %T ---", "point", Client, "shop", Client);
- for(new i;i < MAX_ITEMS; i++)
- {
- if(ItemType[i] == Type && ItemPrice[i] && !IsVIPItem[i])
- {
- Format(Formatting, 256, "%i", i);
- if(IsRestrictItem[i])
- {
- if(RestrictItem[Client][i])
- {
- Format(Formatting2, 256, "%s %i%T(Cant buy anymore.)", ItemName[i], ItemPrice[i], "point", Client);
- AddMenuItem(menuhandle, Formatting, Formatting2, ITEMDRAW_DISABLED);
- }
- else if(Point[Client] >= ItemPrice[i])
- {
- Format(Formatting2, 256, "%s %i%T", ItemName[i], ItemPrice[i], "point", Client);
- AddMenuItem(menuhandle, Formatting, Formatting2);
- }
- else
- {
- Format(Formatting2, 256, "%s %i%T(You don't have enough points.)", ItemName[i], ItemPrice[i], "point", Client);
- AddMenuItem(menuhandle, Formatting, Formatting2, ITEMDRAW_DISABLED);
- }
- }
- else
- {
- if(Point[Client] >= ItemPrice[i])
- {
- Format(Formatting2, 256, "%s %i%T", ItemName[i], ItemPrice[i], "point", Client);
- AddMenuItem(menuhandle, Formatting, Formatting2);
- }
- else
- {
- Format(Formatting2, 256, "%s %i%T(You don't have enough points.)", ItemName[i], ItemPrice[i], "point", Client);
- AddMenuItem(menuhandle, Formatting, Formatting2, ITEMDRAW_DISABLED);
- }
- }
- display = true;
- }
- }
- SetMenuExitButton(menuhandle, true);
- SetMenuExitBackButton(menuhandle, true);
- if(!display)
- {
- Format(Formatting2, 256, "%T", "no items available", Client);
- AddMenuItem(menuhandle, "", Formatting2, ITEMDRAW_DISABLED);
- }
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public Shop_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:StringNumber[256], Number;
- GetMenuItem(menu, select, StringNumber, 256);
- Number = StringToInt(StringNumber);
- if(Point[Client] >= ItemPrice[Number])
- {
- new String:query[512], String:SteamID[256];
- GetClientAuthString(Client, SteamID, 256);
- Point[Client] -= ItemPrice[Number];
- SavePoint(Client);
- Format(query, 512, "INSERT INTO inventory(steamid, idx, type) values ('%s', '%d', '%d');", SteamID, Number, ItemType[Number]);
- SQL_TQuery(databasehandle, save_info, query, Client);
- PrintChat(Client, "You bought \x05%s.", ItemName[Number]);
- Inventory(Client);
- new String:Log[256], String:Time[30], String:ClientName[256];
- GetClientName(Client, ClientName, 256);
- while(StrContains(ClientName, "'") != -1) ReplaceStringEx(ClientName, 256, "'", "`");
- FormatTime(Time, 30, "%Y/%m/%d - %H:%M:%S", GetTime());
- Format(Log, 256, "%s buy %s(%i)", ClientName, ItemName[Number], Number);
- Format(query, 512, "INSERT INTO shoplog(steamid, log, type, date) values ('%s', '%s', '%i', '%s');", SteamID, Log, 0, Time);
- SQL_TQuery(databasehandle, save_info, query);
- if(IsRestrictItem[Number])
- {
- Format(query, 512, "INSERT INTO restrictitem(steamid, idx) values ('%s', '%d');", SteamID, Number);
- SQL_TQuery(databasehandle, save_info, query, Client);
- RestrictItem[Client][Number] = true;
- }
- }
- }
- if(action == MenuAction_Cancel)
- {
- if(select == MenuCancel_ExitBack)
- {
- PointShop(Client);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public Option(Client)
- {
- new Handle:menuhandle = CreateMenu(Option_CallBack);
- SetMenuTitle(menuhandle, "--- TTT %T %T(%T) ---", "point", Client, "shop", Client, "option", Client);
- for(new i = 1; i < MaxType+1; i++)
- {
- new String:Formatting[256], String:Formatting2[256];
- Format(Formatting, 256, "%i", i);
- Format(Formatting2, 256, "%T %T/%T", TypeName[i][0], Client, "on", Client, "off", Client);
- AddMenuItem(menuhandle, Formatting, Formatting2);
- }
- SetMenuExitButton(menuhandle, true);
- SetMenuExitBackButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public Option_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:StringType[256], Type;
- GetMenuItem(menu, select, StringType, 256);
- Type = StringToInt(StringType);
- if(ItemExist[Client][Type])
- {
- new String:SteamID[256], String:query[512];
- GetClientAuthString(Client, SteamID, 256);
- ItemOn[Client][Type] = !ItemOn[Client][Type];
- Format(query, 512, "UPDATE %s SET options = '%i' WHERE steamid = '%s';", TypeName[Type][1], ItemOn[Client][Type], SteamID);
- SQL_TQuery(databasehandle, save_info, query, Client);
- if(ItemOn[Client][Type])
- {
- PrintChat(Client, "\x05%T %T", TypeName[Type][0], Client, "on", Client);
- }
- else
- {
- PrintChat(Client, "\x05%T %T", TypeName[Type][0], Client, "off", Client);
- }
- if(Type == VMSkinType)
- {
- if(IsPlayerAlive(Client))
- {
- new weapons = GetPlayerWeaponSlot(Client, 2);
- if(IsValidEdict(weapons))
- {
- RemovePlayerItem(Client, weapons);
- RemoveEdict(weapons);
- }
- GivePlayerItem(Client, "weapon_knife");
- }
- }
- }
- else
- {
- PrintChat(Client, "\x05%T%T", TypeName[Type][0], Client, "does not exist", Client);
- }
- Option(Client);
- }
- if(action == MenuAction_Cancel)
- {
- if(select == MenuCancel_ExitBack)
- {
- MainShop(Client);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public CounterMarket(Client)
- {
- new Handle:menuhandle = CreateMenu(CounterMarket_CallBack), String:Translate_Formatting[128];
- SetMenuTitle(menuhandle, "--- %T ---", "flea market", Client);
- Format(Translate_Formatting, 128, "%T", "buy", Client);
- AddMenuItem(menuhandle, "", Translate_Formatting);
- Format(Translate_Formatting, 128, "%T", "sell", Client);
- AddMenuItem(menuhandle, "", Translate_Formatting);
- AddMenuItem(menuhandle, "", "See my selling items");
- SetMenuExitButton(menuhandle, true);
- SetMenuExitBackButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public CounterMarket_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:SteamID[256], String:query[512];
- GetClientAuthString(Client, SteamID, 256);
- if(select == 0)
- {
- Format(query, 512, "SELECT * FROM countermarket ORDER BY id ASC;");
- SQL_TQuery(databasehandle, CounterMarket_Buy, query, Client);
- }
- if(select == 1)
- {
- Format(query, 512, "SELECT * FROM inventory WHERE steamid = '%s' ORDER BY idx ASC;", SteamID);
- SQL_TQuery(databasehandle, CounterMarket_Sell, query, Client);
- }
- if(select == 2)
- {
- Format(query, 512, "SELECT * FROM countermarket WHERE steamid = '%s' ORDER BY idx ASC;", SteamID);
- SQL_TQuery(databasehandle, CounterMarket_My_Sell_Item, query, Client);
- }
- }
- if(action == MenuAction_Cancel)
- {
- if(select == MenuCancel_ExitBack)
- {
- MainShop(Client);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public CounterMarket_Buy(Handle:owner, Handle:hndl, const String:error[], any:Client)
- {
- if(hndl == INVALID_HANDLE)
- {
- PrintChat(Client, "\x03No Available Items.");
- CounterMarket(Client);
- return;
- }
- new String:Formatting[256], String:Formatting2[256], bool:display, count;
- new counted = SQL_GetRowCount(hndl);
- new Handle:menuhandle = CreateMenu(CounterMarket_Buy_CallBack);
- SetMenuTitle(menuhandle, "--- User Market Place (Buy) ---");
- if(counted > 0)
- {
- if(SQL_HasResultSet(hndl))
- {
- while(SQL_FetchRow(hndl))
- {
- decl String:Uploader[256], String:SteamID[256];
- SQL_FetchString(hndl, 2, Uploader, 256);
- SQL_FetchString(hndl, 1, SteamID, 256);
- Format(Formatting, 256, "%i^%i^%s^%i", SQL_FetchInt(hndl, 3), SQL_FetchInt(hndl, 4), SteamID, SQL_FetchInt(hndl, 0));
- Format(Formatting2, 256, "Name : %s\n%s - %iPoint", Uploader, ItemName[SQL_FetchInt(hndl, 3)], SQL_FetchInt(hndl, 4));
- if(Point[Client] >= SQL_FetchInt(hndl, 4)) AddMenuItem(menuhandle, Formatting, Formatting2);
- else AddMenuItem(menuhandle, Formatting, Formatting2, ITEMDRAW_DISABLED);
- if(count % 4 != 3) AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- count++;
- if(!display)
- {
- display = true;
- }
- }
- }
- }
- if(display)
- {
- SetMenuExitButton(menuhandle, true);
- SetMenuExitBackButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- else
- {
- PrintChat(Client, "\x03No Available Items.");
- CounterMarket(Client);
- }
- }
- public CounterMarket_Buy_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:StringNumber[256], String:EString[4][128];
- GetMenuItem(menu, select, StringNumber, 256);
- if(StrEqual(StringNumber, "")) return;
- ExplodeString(StringNumber, "^", EString, 4, 128);
- CheckBuy(Client, EString[0], EString[1], EString[2], EString[3]);
- }
- if(action == MenuAction_Cancel)
- {
- if(select == MenuCancel_ExitBack)
- {
- CounterMarket(Client);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public CheckBuy(Client, String:Number[128], String:Price[128], String:SteamID[128], String:ID[128])
- {
- new String:Formatting[256];
- Format(Formatting, 256, "%s^%s^%s^%s", Number, Price, SteamID, ID);
- new Handle:menuhandle = CreateMenu(CheckBuy_CallBack);
- SetMenuTitle(menuhandle, "-- Confirm --\n%s %s points", ItemName[StringToInt(Number)], Price);
- AddMenuItem(menuhandle, Formatting, "Yes");
- AddMenuItem(menuhandle, Formatting, "No");
- SetMenuExitButton(menuhandle, false);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public CheckBuy_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:StringNumber[256], String:EString[4][128];
- GetMenuItem(menu, select, StringNumber, 256);
- ExplodeString(StringNumber, "^", EString, 4, 128);
- new String:query[512], String:SteamID[256];
- GetClientAuthString(Client, SteamID, 256);
- if(select == 0)
- {
- if(Point[Client] >= StringToInt(EString[1]))
- {
- new Handle:pack = CreateDataPack();
- WritePackCell(pack, Client);
- WritePackString(pack, EString[0]);
- WritePackString(pack, EString[1]);
- WritePackString(pack, EString[2]);
- WritePackString(pack, EString[3]);
- Format(query, 512, "SELECT * FROM countermarket ORDER BY id ASC;");
- SQL_TQuery(databasehandle, CheckBuy_LastCheck, query, pack);
- }
- }
- if(select == 1)
- {
- Format(query, 512, "SELECT * FROM countermarket ORDER BY id ASC;");
- SQL_TQuery(databasehandle, CounterMarket_Buy, query, Client);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public CheckBuy_LastCheck(Handle:owner, Handle:hndl, const String:error[], any:pack)
- {
- ResetPack(pack);
- new Client = ReadPackCell(pack);
- new String:EString[4][128];
- ReadPackString(pack, EString[0], 128);
- ReadPackString(pack, EString[1], 128);
- ReadPackString(pack, EString[2], 128);
- ReadPackString(pack, EString[3], 128);
- new bool:CheckExist;
- if(hndl == INVALID_HANDLE)
- {
- PrintChat(Client, "\x03아무런 ì•„ì´í…œì„ íŒë§¤í•˜ì§€ 않습니다.");
- CounterMarket(Client);
- return;
- }
- new counted = SQL_GetRowCount(hndl);
- if(counted > 0)
- {
- if(SQL_HasResultSet(hndl))
- {
- while(SQL_FetchRow(hndl))
- {
- if(SQL_FetchInt(hndl, 0) == StringToInt(EString[3]))
- {
- new String:query[512], String:SteamID[256];
- GetClientAuthString(Client, SteamID, 256);
- Point[Client] -= StringToInt(EString[1]);
- SavePoint(Client);
- Format(query, 512, "INSERT INTO inventory(steamid, idx, type) values ('%s', '%d', '%d');", SteamID, StringToInt(EString[0]), ItemType[StringToInt(EString[0])]);
- SQL_TQuery(databasehandle, save_info, query, Client);
- PrintChat(Client, "\x07FF3A3A%s\x01를 거래장터ì—서 \x07FF3A3A%ií¬ì¸íЏ\x01ì˜ ê°€ê²©ì— êµ¬ë§¤í•˜ì…¨ìŠµë‹ˆë‹¤.", ItemName[StringToInt(EString[0])], StringToInt(EString[1]));
- Inventory(Client);
- Format(query, 512, "DELETE FROM countermarket WHERE steamid = '%s' AND id = '%i' limit 1;", EString[2], StringToInt(EString[3]));
- SQL_TQuery(databasehandle, save_info, query);
- Format(query, 512, "SELECT * FROM info WHERE steamid = '%s';", EString[2]);
- SQL_TQuery(databasehandle, GetUploader, query, StringToInt(EString[1]));
- CheckExist = true;
- new String:Log[256], String:Time[30], String:ClientName[256];
- GetClientName(Client, ClientName, 256);
- while(StrContains(ClientName, "'") != -1) ReplaceStringEx(ClientName, 256, "'", "`");
- FormatTime(Time, 30, "%Y/%m/%d - %H:%M:%S", GetTime());
- 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]));
- Format(query, 512, "INSERT INTO shoplog(steamid, log, type, date) values ('%s', '%s', '%i', '%s');", SteamID, Log, 8, Time);
- SQL_TQuery(databasehandle, save_info, query);
- 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]));
- Format(query, 512, "INSERT INTO shoplog(steamid, log, type, date) values ('%s', '%s', '%i', '%s');", EString[2], Log, 9, Time);
- SQL_TQuery(databasehandle, save_info, query);
- }
- }
- }
- }
- if(!CheckExist)
- {
- PrintChat(Client, "\x05다른 누군가가 ì´ë¯¸ 사셨습니다.");
- }
- }
- public GetUploader(Handle:owner, Handle:hndl, const String:error[], any:price)
- {
- new String:SteamID[256], target = -1;
- new counted = SQL_GetRowCount(hndl);
- if(counted > 0)
- {
- if(SQL_HasResultSet(hndl))
- {
- while(SQL_FetchRow(hndl))
- {
- SQL_FetchString(hndl, 1, SteamID, sizeof(SteamID));
- for(new i = 1; i <= MaxClients; i++)
- {
- if(IsClientInGame(i))
- {
- new String:TargetSteamID[256];
- GetClientAuthString(i, TargetSteamID, 256);
- if(StrEqual(TargetSteamID, SteamID, false))
- {
- target = i;
- }
- }
- }
- if(target == -1)
- {
- new String:query[512];
- Format(query, 512, "UPDATE info SET point = '%i' WHERE steamid = '%s';", SQL_FetchInt(hndl, 3)+price, SteamID);
- SQL_TQuery(databasehandle, save_info, query, target);
- }
- else
- {
- new String:query[512];
- PrintChat(target, "\x05누군가가 ìœ ì €ê±°ëž˜ìž¥í„°ì˜ ë‹¹ì‹ ì˜ ì•„ì´í…œì„ 구매하셨습니다.(수ìµê¸ˆ:%i)", price);
- Point[target] += price;
- SavePoint(target);
- Format(query, 512, "UPDATE info SET point = '%i' WHERE steamid = '%s';", Point[target], SteamID);
- SQL_TQuery(databasehandle, save_info, query, target);
- break;
- }
- }
- }
- }
- }
- public CounterMarket_Sell(Handle:owner, Handle:hndl, const String:error[], any:Client)
- {
- if(hndl == INVALID_HANDLE)
- {
- PrintChat(Client, "\x03아무런 ì•„ì´í…œì„ ê°€ì§€ê³ ìžˆì§€ 않으ì‹ë‹ˆë‹¤.");
- CounterMarket(Client);
- return;
- }
- new String:Formatting[256], String:Formatting2[256], bool:display;
- new counted = SQL_GetRowCount(hndl);
- new Handle:menuhandle = CreateMenu(CounterMarket_Sell_CallBack);
- SetMenuTitle(menuhandle, "--- ìœ ì € 거래 장터 (íŒë‹ˆë‹¤) ---");
- if(counted > 0)
- {
- if(SQL_HasResultSet(hndl))
- {
- while(SQL_FetchRow(hndl))
- {
- Format(Formatting, 256, "%i", SQL_FetchInt(hndl, 2));
- Format(Formatting2, 256, "%s", ItemName[SQL_FetchInt(hndl, 2)]);
- if(!IsVIPItem[SQL_FetchInt(hndl, 2)]) AddMenuItem(menuhandle, Formatting, Formatting2);
- else AddMenuItem(menuhandle, Formatting, Formatting2, ITEMDRAW_DISABLED);
- if(!display)
- {
- display = true;
- }
- }
- }
- }
- if(display)
- {
- SetMenuExitButton(menuhandle, true);
- SetMenuExitBackButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- else
- {
- PrintChat(Client, "\x03아무런 ì•„ì´í…œì„ ê°€ì§€ê³ ìžˆì§€ 않으ì‹ë‹ˆë‹¤.");
- CounterMarket(Client);
- }
- }
- public CounterMarket_Sell_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:StringNumber[256];
- GetMenuItem(menu, select, StringNumber, 256);
- SellPoint[Client] = 0;
- CheckSell(Client, StringNumber);
- }
- if(action == MenuAction_Cancel)
- {
- if(select == MenuCancel_ExitBack)
- {
- CounterMarket(Client);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public CheckSell(Client, String:Number[256])
- {
- new String:Formatting[256];
- Format(Formatting, 256, "%s", Number);
- new Handle:menuhandle = CreateMenu(CheckSell_CallBack);
- SetMenuTitle(menuhandle, "-- í™•ì¸ ìž‘ì—… --\n%s %ií¬ì¸íŠ¸ì— íŒŒì‹œê² ìŠµë‹ˆê¹Œ?", ItemName[StringToInt(Number)], SellPoint[Client]);
- AddMenuItem(menuhandle, Formatting, "네");
- AddMenuItem(menuhandle, Formatting, "íŒë§¤ë¥¼ 취소합니다.");
- AddMenuItem(menuhandle, Formatting, "+1í¬ì¸íЏ");
- AddMenuItem(menuhandle, Formatting, "+10í¬ì¸íЏ");
- AddMenuItem(menuhandle, Formatting, "+100í¬ì¸íЏ");
- AddMenuItem(menuhandle, Formatting, "+1000í¬ì¸íЏ");
- AddMenuItem(menuhandle, Formatting, "+1ë§Œí¬ì¸íЏ");
- AddMenuItem(menuhandle, Formatting, "+10ë§Œí¬ì¸íЏ");
- AddMenuItem(menuhandle, Formatting, "+100ë§Œí¬ì¸íЏ");
- SetMenuPagination(menuhandle, MENU_NO_PAGINATION);
- SetMenuExitButton(menuhandle, false);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public CheckSell_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:StringNumber[256];
- GetMenuItem(menu, select, StringNumber, 256);
- new String:query[512], String:SteamID[256];
- GetClientAuthString(Client, SteamID, 256);
- if(select == 0)
- {
- Format(query, 512, "DELETE FROM inventory WHERE steamid = '%s' AND idx = '%i' limit 1;", SteamID, StringToInt(StringNumber));
- SQL_TQuery(databasehandle, save_info, query, Client);
- PrintChat(Client, "\x07FF3A3A%s\x01를 거래장터ì—서 \x07FF3A3A%ií¬ì¸íЏ\x01ì˜ ê°€ê²©ì— íŒë§¤í•©ë‹ˆë‹¤.", ItemName[StringToInt(StringNumber)], SellPoint[Client]);
- Format(query, 512, "INSERT INTO countermarket(steamid, idx, price) values ('%s', '%d', '%d');", SteamID, StringToInt(StringNumber), SellPoint[Client]);
- SQL_TQuery(databasehandle, save_info, query);
- ChangeNickname(Client);
- new String:Log[256], String:Time[30], String:ClientName[256];
- GetClientName(Client, ClientName, 256);
- while(StrContains(ClientName, "'") != -1) ReplaceStringEx(ClientName, 256, "'", "`");
- FormatTime(Time, 30, "%Y/%m/%d - %H:%M:%S", GetTime());
- Format(Log, 256, "%s countermarket upload %s(%i) price %i", ClientName, ItemName[StringToInt(StringNumber)], StringToInt(StringNumber), SellPoint[Client]);
- Format(query, 512, "INSERT INTO shoplog(steamid, log, type, date) values ('%s', '%s', '%i', '%s');", SteamID, Log, 7, Time);
- SQL_TQuery(databasehandle, save_info, query);
- }
- if(select == 1)
- {
- Format(query, 512, "SELECT * FROM inventory WHERE steamid = '%s' ORDER BY idx ASC;", SteamID);
- SQL_TQuery(databasehandle, CounterMarket_Sell, query, Client);
- }
- if(select >= 2)
- {
- new calcultae = 1;
- for(new i = 2; i < select; i++)
- {
- calcultae *= 10;
- }
- SellPoint[Client] += calcultae;
- }
- if(select > 1)
- {
- CheckSell(Client, StringNumber);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public CounterMarket_My_Sell_Item(Handle:owner, Handle:hndl, const String:error[], any:Client)
- {
- if(hndl == INVALID_HANDLE)
- {
- PrintChat(Client, "\x03아무런 ì•„ì´í…œì„ íŒë§¤í•˜ê³ 있지 않습니다.");
- CounterMarket(Client);
- return;
- }
- new String:Formatting[256], String:Formatting2[256], bool:display;
- new counted = SQL_GetRowCount(hndl);
- new Handle:menuhandle = CreateMenu(CounterMarket_My_Sell_Item_CallBack);
- SetMenuTitle(menuhandle, "--- ë‚´ê°€ íŒ”ê³ ìžˆëŠ” 물건들 (í´ë¦í•˜ë©´ 회수ë©ë‹ˆë‹¤.) ---");
- if(counted > 0)
- {
- if(SQL_HasResultSet(hndl))
- {
- while(SQL_FetchRow(hndl))
- {
- decl String:SteamID[256];
- SQL_FetchString(hndl, 1, SteamID, 256);
- Format(Formatting, 256, "%i^%i^%s^%i^0", SQL_FetchInt(hndl, 3), SQL_FetchInt(hndl, 4), SteamID, SQL_FetchInt(hndl, 0));
- Format(Formatting2, 256, "%s - %ií¬ì¸íЏ", ItemName[SQL_FetchInt(hndl, 3)], SQL_FetchInt(hndl, 4));
- AddMenuItem(menuhandle, Formatting, Formatting2);
- if(!display)
- {
- display = true;
- }
- }
- }
- }
- if(display)
- {
- SetMenuExitButton(menuhandle, true);
- SetMenuExitBackButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- else
- {
- PrintChat(Client, "\x03아무런 ì•„ì´í…œì„ íŒë§¤í•˜ê³ 있지 않습니다.");
- CounterMarket(Client);
- }
- }
- public CounterMarket_Admin_Sell_Item(Handle:owner, Handle:hndl, const String:error[], any:Client)
- {
- if(hndl == INVALID_HANDLE)
- {
- PrintChat(Client, "\x03아무런 ì•„ì´í…œì„ íŒë§¤í•˜ê³ 있지 않습니다.");
- CounterMarket(Client);
- return;
- }
- new String:Formatting[256], String:Formatting2[256], bool:display;
- new counted = SQL_GetRowCount(hndl);
- new Handle:menuhandle = CreateMenu(CounterMarket_My_Sell_Item_CallBack);
- SetMenuTitle(menuhandle, "--- íŒ”ê³ ìžˆëŠ” 물건들 (í´ë¦í•˜ë©´ 회수ë©ë‹ˆë‹¤.) ---");
- if(counted > 0)
- {
- if(SQL_HasResultSet(hndl))
- {
- while(SQL_FetchRow(hndl))
- {
- decl String:SteamID[256];
- SQL_FetchString(hndl, 1, SteamID, 256);
- Format(Formatting, 256, "%i^%i^%s^%i^1", SQL_FetchInt(hndl, 3), SQL_FetchInt(hndl, 4), SteamID, SQL_FetchInt(hndl, 0));
- Format(Formatting2, 256, "%s - %ií¬ì¸íЏ", ItemName[SQL_FetchInt(hndl, 3)], SQL_FetchInt(hndl, 4));
- AddMenuItem(menuhandle, Formatting, Formatting2);
- if(!display)
- {
- display = true;
- }
- }
- }
- }
- if(display)
- {
- SetMenuExitButton(menuhandle, true);
- SetMenuExitBackButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- else
- {
- PrintChat(Client, "\x03아무런 ì•„ì´í…œì„ íŒë§¤í•˜ê³ 있지 않습니다.");
- CounterMarket(Client);
- }
- }
- public CounterMarket_My_Sell_Item_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:StringNumber[256], String:EString[5][128];
- GetMenuItem(menu, select, StringNumber, 256);
- ExplodeString(StringNumber, "^", EString, 5, 128);
- CheckCancel(Client, EString[0], EString[1], EString[2], EString[3], EString[4]);
- }
- if(action == MenuAction_Cancel)
- {
- if(select == MenuCancel_ExitBack)
- {
- CounterMarket(Client);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public CheckCancel(Client, String:Number[128], String:Price[128], String:SteamID[128], String:ID[128], String:Check[128])
- {
- new String:Formatting[256];
- Format(Formatting, 256, "%s^%s^%s^%s", Number, SteamID, ID, Check);
- new Handle:menuhandle = CreateMenu(CheckCancel_CallBack);
- SetMenuTitle(menuhandle, "-- í™•ì¸ ìž‘ì—… --\n%s %sí¬ì¸íЏ\níšŒìˆ˜í•˜ì‹œê² ìŠµë‹ˆê¹Œ?", ItemName[StringToInt(Number)], Price);
- AddMenuItem(menuhandle, Formatting, "네");
- AddMenuItem(menuhandle, Formatting, "아니오");
- SetMenuExitButton(menuhandle, false);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public CheckCancel_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:StringNumber[256], String:EString[4][128];
- GetMenuItem(menu, select, StringNumber, 256);
- ExplodeString(StringNumber, "^", EString, 4, 128);
- new String:query[512], String:SteamID[256];
- GetClientAuthString(Client, SteamID, 256);
- if(select == 0)
- {
- new Handle:pack = CreateDataPack();
- WritePackCell(pack, Client);
- WritePackString(pack, EString[0]);
- WritePackString(pack, EString[1]);
- WritePackString(pack, EString[2]);
- WritePackString(pack, EString[3]);
- Format(query, 512, "SELECT * FROM countermarket WHERE steamid = '%s' AND id = '%i' ORDER BY idx ASC;", EString[1], StringToInt(EString[2]));
- SQL_TQuery(databasehandle, CheckCancel_LastCheck, query, pack);
- }
- if(select == 1)
- {
- if(!StringToInt(EString[3]))
- {
- Format(query, 512, "SELECT * FROM countermarket WHERE steamid = '%s' ORDER BY idx ASC;", SteamID);
- SQL_TQuery(databasehandle, CounterMarket_My_Sell_Item, query, Client);
- }
- else SQL_TQuery(databasehandle, CounterMarket_Admin_Sell_Item, "SELECT * FROM countermarket ORDER BY idx ASC;", Client);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public CheckCancel_LastCheck(Handle:owner, Handle:hndl, const String:error[], any:pack)
- {
- ResetPack(pack);
- new Client = ReadPackCell(pack);
- new String:EString[4][128];
- ReadPackString(pack, EString[0], 128);
- ReadPackString(pack, EString[1], 128);
- ReadPackString(pack, EString[2], 128);
- ReadPackString(pack, EString[3], 128);
- new bool:CheckExist;
- if(hndl == INVALID_HANDLE)
- {
- PrintChat(Client, "\x03아무런 ì•„ì´í…œì„ íŒë§¤í•˜ì§€ 않습니다.");
- CounterMarket(Client);
- return;
- }
- new counted = SQL_GetRowCount(hndl);
- if(counted > 0)
- {
- if(SQL_HasResultSet(hndl))
- {
- while(SQL_FetchRow(hndl))
- {
- if(SQL_FetchInt(hndl, 0) == StringToInt(EString[2]))
- {
- new String:query[512], String:SteamID[256];
- GetClientAuthString(Client, SteamID, 256);
- Format(query, 512, "INSERT INTO inventory(steamid, idx, type) values ('%s', '%d', '%d');", EString[1], StringToInt(EString[0]), ItemType[StringToInt(EString[0])]);
- SQL_TQuery(databasehandle, save_info, query, Client);
- new Handle:pack2 = CreateDataPack();
- WritePackCell(pack2, Client);
- WritePackString(pack2, EString[3]);
- Format(query, 512, "DELETE FROM countermarket WHERE steamid = '%s' AND id = '%i' limit 1;", EString[1], StringToInt(EString[2]));
- SQL_TQuery(databasehandle, delete_countermarket_item, query, pack2);
- CheckExist = true;
- new String:Log[256], String:Time[30], String:ClientName[256];
- GetClientName(Client, ClientName, 256);
- while(StrContains(ClientName, "'") != -1) ReplaceStringEx(ClientName, 256, "'", "`");
- FormatTime(Time, 30, "%Y/%m/%d - %H:%M:%S", GetTime());
- Format(Log, 256, "%s receive by admin %s(%i) at countermarket", ClientName, ItemName[StringToInt(EString[0])], StringToInt(EString[0]));
- Format(query, 512, "INSERT INTO shoplog(steamid, log, type, date) values ('%s', '%s', '%i', '%s');", EString[1], Log, 6, Time);
- SQL_TQuery(databasehandle, save_info, query);
- }
- }
- }
- }
- if(!CheckExist)
- {
- PrintChat(Client, "\x05다른 누군가가 ì´ë¯¸ 사셨습니다.");
- }
- }
- public top9(Handle:owner, Handle:hndl, const String:error[], any:Client)
- {
- if(hndl == INVALID_HANDLE)
- {
- return;
- }
- new counted = SQL_GetRowCount(hndl), Handle:menuhandle = CreateMenu(NULL_CallBack), String:Formatting[256];
- SetMenuTitle(menuhandle, "-- Top 9 --");
- if(counted > 0)
- {
- if(SQL_HasResultSet(hndl))
- {
- while(SQL_FetchRow(hndl))
- {
- SQL_FetchString(hndl, 2, Formatting, 256);
- if(!StrEqual(Formatting, "")) Format(Formatting, 256, "%s - %i", Formatting, SQL_FetchInt(hndl, 3));
- else Format(Formatting, 256, "ë‹‰ë„¤ìž„ì´ ë“±ë¡ë˜ì§€ 않았습니다 - %i", SQL_FetchInt(hndl, 3));
- AddMenuItem(menuhandle, "", Formatting, ITEMDRAW_DISABLED);
- }
- }
- }
- SetMenuPagination(menuhandle, MENU_NO_PAGINATION);
- SetMenuExitButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public ShopLog_Year(Client, bool:Target)
- {
- new Handle:menuhandle;
- if(Target)
- menuhandle = CreateMenu(ShopLog_Year_CallBack2);
- else
- menuhandle = CreateMenu(ShopLog_Year_CallBack);
- SetMenuTitle(menuhandle, "Set year.(Log)");
- AddMenuItem(menuhandle, "2012", "2012");
- AddMenuItem(menuhandle, "2013", "2013");
- SetMenuExitButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public ShopLog_Year_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:info[256];
- GetMenuItem(menu, select, info, 256);
- ShopLog_Month(Client, info, false);
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public ShopLog_Year_CallBack2(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:info[256];
- GetMenuItem(menu, select, info, 256);
- ShopLog_Month(Client, info, true);
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public ShopLog_Month(Client, String:info[256], bool:Target)
- {
- new Handle:menuhandle;
- if(Target)
- menuhandle = CreateMenu(ShopLog_Month_CallBack2);
- else
- menuhandle = CreateMenu(ShopLog_Month_CallBack);
- SetMenuTitle(menuhandle, "Set month.(Log):%s", info);
- new String:Formatting[256], String:Formatting2[256];
- for(new i=1; i<=12; i++)
- {
- if(i < 10) Format(Formatting, 256, "%s/0%i", info, i);
- else Format(Formatting, 256, "%s/%i", info, i);
- Format(Formatting2, 256, "%i Month", i);
- AddMenuItem(menuhandle, Formatting, Formatting2);
- }
- SetMenuExitButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public ShopLog_Month_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:info[256];
- GetMenuItem(menu, select, info, 256);
- ShopLog_Day(Client, info);
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public ShopLog_Month_CallBack2(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:info[256];
- GetMenuItem(menu, select, info, 256);
- ShopLog_Type(Client, info, true);
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public ShopLog_Day(Client, String:info[256])
- {
- new Handle:menuhandle = CreateMenu(ShopLog_Day_CallBack);
- SetMenuTitle(menuhandle, "Set day.(Log):%s", info);
- new String:Formatting[256], String:Formatting2[256];
- AddMenuItem(menuhandle, info, "See day logs");
- for(new i=1; i<=31; i++)
- {
- if(i < 10) Format(Formatting, 256, "%s/0%i", info, i);
- else Format(Formatting, 256, "%s/%i", info, i);
- Format(Formatting2, 256, "%i Days", i);
- AddMenuItem(menuhandle, Formatting, Formatting2);
- }
- SetMenuExitButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public ShopLog_Day_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:info[256];
- GetMenuItem(menu, select, info, 256);
- if(select == 0)
- {
- ShopLog_Type(Client, info);
- }
- else
- {
- ShopLog_Hour(Client, info);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public ShopLog_Hour(Client, String:info[256])
- {
- new Handle:menuhandle = CreateMenu(ShopLog_Hour_CallBack);
- SetMenuTitle(menuhandle, "Set hours.(Log):%s", info);
- new String:Formatting[256], String:Formatting2[256];
- AddMenuItem(menuhandle, info, "See hour log");
- for(new i=1; i<=24; i++)
- {
- if(i < 10) Format(Formatting, 256, "%s - 0%i", info, i);
- else Format(Formatting, 256, "%s - %i", info, i);
- Format(Formatting2, 256, "%i Hour", i);
- AddMenuItem(menuhandle, Formatting, Formatting2);
- }
- SetMenuExitButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public ShopLog_Hour_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:info[256];
- GetMenuItem(menu, select, info, 256);
- if(select == 0)
- {
- ShopLog_Type(Client, info);
- }
- else
- {
- ShopLog_Minute(Client, info);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public ShopLog_Minute(Client, String:info[256])
- {
- new Handle:menuhandle = CreateMenu(ShopLog_Minute_CallBack);
- SetMenuTitle(menuhandle, "Set minutes.(Log):%s", info);
- new String:Formatting[256], String:Formatting2[256];
- AddMenuItem(menuhandle, info, "See minute log");
- for(new i; i<=59; i++)
- {
- if(i < 10) Format(Formatting, 256, "%s:0%i", info, i);
- else Format(Formatting, 256, "%s:%i", info, i);
- Format(Formatting2, 256, "%i Min", i);
- AddMenuItem(menuhandle, Formatting, Formatting2);
- }
- SetMenuExitButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public ShopLog_Minute_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:info[256];
- GetMenuItem(menu, select, info, 256);
- ShopLog_Type(Client, info);
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- stock ShopLog_Type(Client, String:info[256], bool:Target=false)
- {
- new Handle:menuhandle;
- if(Target)
- menuhandle = CreateMenu(ShopLog_Type_CallBack2);
- else
- menuhandle = CreateMenu(ShopLog_Type_CallBack);
- SetMenuTitle(menuhandle, "로그 íƒ€ìž…ì„ ì •í•˜ì„¸ìš”.(로그):%s", info);
- AddMenuItem(menuhandle, info, "ì „ì²´ 로그 보기");
- AddMenuItem(menuhandle, info, "사기 로그 보기");
- AddMenuItem(menuhandle, info, "사용하기 로그 보기");
- AddMenuItem(menuhandle, info, "팔기 로그 보기");
- AddMenuItem(menuhandle, info, "버리기 로그 보기");
- AddMenuItem(menuhandle, info, "ì°©ìš©í•´ì œí•˜ê¸° 로그 보기");
- AddMenuItem(menuhandle, info, "ì„ ë¬¼í•˜ê¸° 로그 보기");
- AddMenuItem(menuhandle, info, "ì„ ë¬¼ë°›ê¸° 로그 보기");
- AddMenuItem(menuhandle, info, "ìœ ì €ê±°ëž˜ì‹œìž¥ 업로드 로그 보기");
- AddMenuItem(menuhandle, info, "ìœ ì €ê±°ëž˜ì‹œìž¥ 사기 로그 보기");
- AddMenuItem(menuhandle, info, "ìœ ì €ê±°ëž˜ì‹œìž¥ 팔기 로그 보기");
- SetMenuExitButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- public ShopLog_Type_CallBack(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:info[256], String:SteamID[256], String:query[512];
- GetMenuItem(menu, select, info, 256);
- GetClientAuthString(Client, SteamID, 256);
- if(!select)
- {
- new Handle:pack = CreateDataPack();
- WritePackCell(pack, Client);
- WritePackString(pack, info);
- Format(query, 512, "SELECT * FROM shoplog WHERE steamid = '%s';", SteamID);
- SQL_TQuery(databasehandle, ShowShopLog, query, pack);
- }
- else
- {
- new String:Formatting[256];
- Format(Formatting, 256, "SELECT * FROM shoplog WHERE type = '%i' AND steamid = '%s';", select-1, SteamID);
- new Handle:pack = CreateDataPack();
- WritePackCell(pack, Client);
- WritePackString(pack, info);
- SQL_TQuery(databasehandle, ShowShopLog, Formatting, pack);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public ShopLog_Type_CallBack2(Handle:menu, MenuAction:action, Client, select)
- {
- if(action == MenuAction_Select)
- {
- new String:info[256], String:query[512];
- GetMenuItem(menu, select, info, 256);
- if(!select)
- {
- new Handle:pack = CreateDataPack();
- WritePackCell(pack, Client);
- WritePackString(pack, info);
- Format(query, 512, "SELECT * FROM shoplog WHERE steamid = '%s';", LastSteamID[Client]);
- SQL_TQuery(databasehandle, ShowShopLog, query, pack);
- }
- else
- {
- new String:Formatting[256];
- Format(Formatting, 256, "SELECT * FROM shoplog WHERE type = '%i' AND steamid = '%s';", select-1, LastSteamID[Client]);
- new Handle:pack = CreateDataPack();
- WritePackCell(pack, Client);
- WritePackString(pack, info);
- SQL_TQuery(databasehandle, ShowShopLog, Formatting, pack);
- }
- }
- if(action == MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
- public ShowShopLog(Handle:owner, Handle:handle, const String:error[], any:pack)
- {
- ResetPack(pack);
- new Client = ReadPackCell(pack);
- new String:Time[128], String:Date[128], String:Log[256], bool:check, count;
- ReadPackString(pack, Time, 128);
- if(handle == INVALID_HANDLE)
- {
- LogError("Show ShopLog Error: %s", error);
- PrintChat(Client, "Show ShopLog Error");
- }
- else if(SQL_GetRowCount(handle))
- {
- new Handle:menuhandle = CreateMenu(NULL_CallBack);
- SetMenuTitle(menuhandle, "ShopLog : %s", Time);
- new counted = SQL_GetRowCount(handle);
- if(counted > 0)
- {
- if(SQL_HasResultSet(handle))
- {
- while(SQL_FetchRow(handle))
- {
- SQL_FetchString(handle, 4, Date, 128);
- if(StrContains(Date, Time, false) == 0)
- {
- SQL_FetchString(handle, 2, Log, 256);
- if(count % 3 != 0)
- {
- AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- AddMenuItem(menuhandle, "NULL", "NULL", ITEMDRAW_SPACER);
- }
- Format(Log, 256, "%s{%s}", Log, Date);
- AddMenuItem(menuhandle, Log, Log, ITEMDRAW_DISABLED);
- check = true;
- count++;
- }
- }
- }
- }
- if(check)
- {
- SetMenuExitButton(menuhandle, true);
- DisplayMenu(menuhandle, Client, MENU_TIME_FOREVER);
- }
- else PrintChat(Client, "해당 로그가 존재하지 않습니다.");
- }
- }
- stock ChangeNickname(Client, type=0)
- {
- if(JoinCheck(Client))
- {
- new String:ClientName[256], String:query[512], String:SteamID[256];
- GetClientName(Client, ClientName, 256);
- GetClientAuthString(Client, SteamID, 256);
- if(type % 2 == 1) ClientName[strlen(ClientName)-1] = '\x0';
- if(type >= 2) ClientName[strlen(ClientName)-2] = '\x0';
- Format(query, 512, "UPDATE info SET nick = '%s' WHERE steamid = '%s';", ClientName, SteamID);
- if(!type) SQL_TQuery(databasehandle, check_error_nick, query, Client);
- if(type == 1) SQL_TQuery(databasehandle, check_error_nick2, query, Client);
- if(type == 2) SQL_TQuery(databasehandle, check_error_nick3, query, Client);
- if(type == 3) SQL_TQuery(databasehandle, save_info, query, Client);
- Format(query, 512, "UPDATE countermarket SET nick = '%s' WHERE steamid = '%s';", ClientName, SteamID);
- if(!type) SQL_TQuery(databasehandle, save_info_nolog, query, Client);
- if(type == 1) SQL_TQuery(databasehandle, save_info_nolog, query, Client);
- if(type == 2) SQL_TQuery(databasehandle, save_info_nolog, query, Client);
- if(type == 3) SQL_TQuery(databasehandle, save_info_nolog, query, Client);
- }
- }
- public check_error_nick(Handle:owner, Handle:hndl, const String:error[], any:Client)
- {
- if(hndl == INVALID_HANDLE) ChangeNickname(Client, 1);
- }
- public check_error_nick2(Handle:owner, Handle:hndl, const String:error[], any:Client)
- {
- if(hndl == INVALID_HANDLE) ChangeNickname(Client, 2);
- }
- public check_error_nick3(Handle:owner, Handle:hndl, const String:error[], any:Client)
- {
- if(hndl == INVALID_HANDLE) ChangeNickname(Client, 3);
- }
- stock SavePoint(Client)
- {
- if(DataLoaded[Client][0] && DataLoaded[Client][1] && DataLoaded[Client][2])
- {
- new String:query[512], String:SteamID[256];
- GetClientAuthString(Client, SteamID, 256);
- Format(query, 512, "UPDATE info SET point = '%i' WHERE steamid = '%s';", Point[Client], SteamID);
- SQL_TQuery(databasehandle, save_info, query, Client);
- }
- }
- stock SaveKarma(Client)
- {
- if(DataLoaded[Client][0] && DataLoaded[Client][1] && DataLoaded[Client][2])
- {
- new String:query[512], String:SteamID[256];
- GetClientAuthString(Client, SteamID, 256);
- Format(query, 512, "UPDATE info SET karma = '%i' WHERE steamid = '%s';", Karma[Client], SteamID);
- SQL_TQuery(databasehandle, save_info, query, Client);
- }
- }
- public GetPlayerMaxSpeed(client, &Float:MaxSpeed)
- {
- static OldButtons[MAXPLAYERS+1], Float:LastDashTime[MAXPLAYERS+1], bool:IsDash[MAXPLAYERS+1];
- if(JoinCheck(client))
- {
- if(IsPlayerAlive(client))
- {
- new weapons = GetEntPropEnt(client, Prop_Data, "m_hActiveWeapon"), buttons = GetClientButtons(client);
- if(IsValidEdict(weapons) && RPG[weapons]) MaxSpeed -= MaxSpeed/30.0;
- else MaxSpeed -= MaxSpeed/20.0;
- if(!(OldButtons[client] & IN_FORWARD) && buttons & IN_FORWARD && SpeedBoots[client])
- {
- if(!IsDash[client])
- {
- if((LastDashTime[client] == 0.0 || FloatSub(GetEngineTime(), LastDashTime[client]) > 0.2)) LastDashTime[client] = GetEngineTime();
- else if(FloatSub(GetEngineTime(), LastDashTime[client]) <= 2.0) IsDash[client] = true;
- }
- }
- if((IsDash[client] && !(buttons & IN_FORWARD)) || !SpeedBoots[client]) IsDash[client] = false;
- if(IsDash[client] && !IsJihad[client]) MaxSpeed *= 1.6;
- OldButtons[client] = buttons;
- }
- else
- {
- OldButtons[client] = 0;
- LastDashTime[client] = 0.0;
- IsDash[client] = false;
- }
- }
- }
- 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:...)
- {
- new Handle:hudhandle = INVALID_HANDLE;
- if(client == 0) hudhandle = StartMessageAll("HudMsg");
- else hudhandle = StartMessageOne("HudMsg", client);
- new String:txt[255];
- VFormat(txt, sizeof(txt), msg, 13);
- if(hudhandle != INVALID_HANDLE)
- {
- BfWriteByte(hudhandle, channel);
- BfWriteFloat(hudhandle, x);
- BfWriteFloat(hudhandle, y);
- // ë‘번째 색깔
- BfWriteByte(hudhandle, firstcolor[0]);
- BfWriteByte(hudhandle, firstcolor[1]);
- BfWriteByte(hudhandle, firstcolor[2]);
- BfWriteByte(hudhandle, firstcolor[3]);
- // 초기 색깔
- BfWriteByte(hudhandle, secondcolor[0]);
- BfWriteByte(hudhandle, secondcolor[1]);
- BfWriteByte(hudhandle, secondcolor[2]);
- BfWriteByte(hudhandle, secondcolor[3]);
- BfWriteByte(hudhandle, effect);
- BfWriteFloat(hudhandle, fadein);
- BfWriteFloat(hudhandle, fadeout);
- BfWriteFloat(hudhandle, holdtime);
- BfWriteFloat(hudhandle, fxtime);
- BfWriteString(hudhandle, txt);
- EndMessage();
- }
- }
- stock CreateWire(corpse, Float:position[3])
- {
- new socket = CreateEntityByName("prop_physics"), String:TargetName[256], String:RagdollTargetName[256];
- GetEntPropString(corpse, Prop_Data, "m_iName", RagdollTargetName, 256);
- Format(TargetName, 256, "%s%i", RagdollTargetName, socket);
- DispatchKeyValueVector(socket, "origin", position);
- DispatchKeyValue(socket, "targetname", TargetName);
- DispatchKeyValue(socket, "model", "models/props/cs_italy/orange.mdl");
- DispatchSpawn(socket);
- SetEntityModel(socket, "models/props/cs_italy/orange.mdl");
- TeleportEntity(socket, position, NULL_VECTOR, NULL_VECTOR);
- SetEntityMoveType(socket, MOVETYPE_NONE);
- SetEntProp(socket, Prop_Data, "m_takedamage", 0);
- Phys_EnableMotion(socket, false);
- SetEntityRenderMode(socket, RENDER_TRANSCOLOR);
- SetEntityRenderColor(socket, 255, 255, 255, 0);
- SetEntData(socket, CollOff, 2, 4, true);
- new move = CreateEntityByName("move_rope"), String:Rope1TargetName[256], String:Rope2TargetName[256], Float:RagdollPosition[3];
- new move2 = CreateEntityByName("keyframe_rope");
- Format(Rope1TargetName, 256, "%s%i", RagdollTargetName, move);
- GetEntPropVector(corpse, Prop_Send, "m_vecOrigin", RagdollPosition);
- Format(Rope2TargetName, 256, "%s%i", RagdollTargetName, move2);
- DispatchKeyValue(move, "targetname", Rope1TargetName);
- DispatchKeyValue(move, "NextKey", Rope2TargetName);
- DispatchKeyValue(move, "MoveSpeed", "64");
- DispatchKeyValue(move, "Slack", "1");
- DispatchKeyValue(move, "Type", "0");
- DispatchKeyValue(move, "Subdiv", "2");
- DispatchKeyValue(move, "Barbed", "0");
- DispatchKeyValue(move, "Width", "1");
- DispatchKeyValue(move, "TextureScale", "1");
- DispatchKeyValue(move, "Collide", "1");
- DispatchKeyValue(move, "Breakable", "1");
- DispatchKeyValue(move, "RopeMaterial", "cable/rope.vmt");
- DispatchKeyValue(move, "NoWind", "0");
- DispatchKeyValue(move, "PositionInterpolator", "2");
- DispatchKeyValueVector(move, "origin", RagdollPosition);
- DispatchSpawn(move);
- SetEntProp(move, Prop_Send, "m_iRopeMaterialModelIndex", PrecacheModel("cable/rope.vmt", true));
- TeleportEntity(move, RagdollPosition, NULL_VECTOR, NULL_VECTOR);
- IsRope[move] = true;
- DispatchKeyValue(move2, "targetname", Rope2TargetName);
- DispatchKeyValue(move2, "MoveSpeed", "64");
- DispatchKeyValue(move2, "Slack", "1");
- DispatchKeyValue(move2, "Type", "0");
- DispatchKeyValue(move2, "Subdiv", "4");
- DispatchKeyValue(move2, "Barbed", "0");
- DispatchKeyValue(move2, "Width", "1");
- DispatchKeyValue(move2, "TextureScale", "1");
- DispatchKeyValue(move2, "Collide", "1");
- DispatchKeyValue(move2, "Breakable", "1");
- DispatchKeyValue(move2, "RopeMaterial", "cable/rope.vmt");
- DispatchKeyValue(move2, "NoWind", "0");
- DispatchKeyValue(move2, "PositionInterpolator", "2");
- DispatchKeyValueVector(move2, "origin", position);
- DispatchSpawn(move2);
- SetEntProp(move2, Prop_Send, "m_iRopeMaterialModelIndex", PrecacheModel("cable/rope.vmt", true));
- TeleportEntity(move2, position, NULL_VECTOR, NULL_VECTOR);
- IsRope[move2] = true;
- SetEntPropEnt(move, Prop_Send, "m_hStartPoint", corpse);
- SetEntPropEnt(move, Prop_Send, "m_hEndPoint", move2);
- SetEntPropVector(move, Prop_Send, "m_vecOrigin", RagdollPosition);
- SetEntPropVector(move2, Prop_Send, "m_vecOrigin", position);
- for(new i; i<4; i++)
- {
- if(!Wire[corpse][i][0] && !Wire[corpse][i][1] && !Wire[corpse][i][2])
- {
- Wire[corpse][i][0] = EntRefToEntIndex(socket);
- Wire[corpse][i][1] = move;
- Wire[corpse][i][2] = move2;
- new Handle:pack = CreateDataPack();
- WritePackCell(pack, corpse);
- WritePackCell(pack, i);
- WritePackFloat(pack, position[0]);
- WritePackFloat(pack, position[1]);
- WritePackFloat(pack, position[2]);
- CreateTimer(0.1, RopeThink, pack, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE|TIMER_DATA_HNDL_CLOSE);
- break;
- }
- }
- Phys_CreateLengthConstraint(socket, corpse, INVALID_HANDLE, NULL_VECTOR, NULL_VECTOR, 30.0);
- }
- public Action:RopeThink(Handle:timer, Handle:pack)
- {
- ResetPack(pack);
- new corpse = ReadPackCell(pack);
- new number = ReadPackCell(pack);
- new Float:position[4][3];
- position[number][0] = ReadPackFloat(pack);
- position[number][1] = ReadPackFloat(pack);
- position[number][2] = ReadPackFloat(pack);
- if(chosen && IsValidEdict(corpse))
- {
- new Float:entityposition[3], Float:entityposition2[3];
- GetEntPropVector(EntIndexToEntRef(corpse), Prop_Send, "m_vecOrigin", entityposition);
- GetEntPropVector(corpse, Prop_Send, "m_vecOrigin", entityposition2);
- if(Wire[corpse][number][0] && Wire[corpse][number][1] && Wire[corpse][number][2] && IsValidEdict(Wire[corpse][number][1]) && IsValidEdict(Wire[corpse][number][2]))
- {
- if(GetVectorDistance(position[number], entityposition, false) > 300.0)
- {
- AcceptEntityInput(Wire[corpse][number][0], "Kill");
- AcceptEntityInput(Wire[corpse][number][1], "Break");
- AcceptEntityInput(Wire[corpse][number][2], "Break");
- CreateTimer(1.0, DeleteEntity, Wire[corpse][number][1]);
- CreateTimer(1.0, DeleteEntity, Wire[corpse][number][2]);
- IsRope[Wire[corpse][number][1]] = false;
- IsRope[Wire[corpse][number][2]] = false;
- Wire[corpse][number][0] = 0;
- Wire[corpse][number][1] = 0;
- Wire[corpse][number][2] = 0;
- return Plugin_Stop;
- }
- }
- }
- else
- {
- for(new i; i<4; i++)
- {
- if(Wire[corpse][i][0] && Wire[corpse][i][1] && Wire[corpse][i][2] && IsValidEdict(Wire[corpse][i][1]) && IsValidEdict(Wire[corpse][i][2]))
- {
- AcceptEntityInput(Wire[corpse][i][0], "Kill");
- AcceptEntityInput(Wire[corpse][i][1], "Break");
- AcceptEntityInput(Wire[corpse][i][2], "Break");
- CreateTimer(1.0, DeleteEntity, Wire[corpse][i][1]);
- CreateTimer(1.0, DeleteEntity, Wire[corpse][i][2]);
- IsRope[Wire[corpse][number][1]] = false;
- IsRope[Wire[corpse][number][2]] = false;
- Wire[corpse][i][0] = 0;
- Wire[corpse][i][1] = 0;
- Wire[corpse][i][2] = 0;
- }
- }
- return Plugin_Stop;
- }
- return Plugin_Continue;
- }
- public Action:SetClientiClip2_Pre(Handle:timer, Handle:pack)
- {
- ResetPack(pack);
- new Client = ReadPackCell(pack);
- new ammo = ReadPackCell(pack);
- new weapons = ReadPackCell(pack);
- if(JoinCheck(Client) && IsPlayerAlive(Client) && IsValidEdict(weapons) && IsValidEntity(weapons))
- {
- SetClientiClip2(weapons, Client, ammo);
- }
- }
- stock SetClientiClip2(weapon, Client, ammo)
- {
- new type = GetEntData(weapon, AmmoType);
- if(type > 0 && type < 11)
- {
- SetEntData(Client, Ammo+(type<<2), ammo, 4, true);
- }
- }
- stock GetClientiClip2(weapon, Client)
- {
- new type = GetEntData(weapon, AmmoType);
- if(type > 0 && type < 11)
- {
- return GetEntData(Client, Ammo+(type<<2), 4);
- }
- return -1;
- }
- #define FFADE_IN 0x0001 // Just here so we don't pass 0 into the function
- #define FFADE_OUT 0x0002 // Fade out (not in)
- #define FFADE_MODULATE 0x0004 // Modulate (don't blend)
- #define FFADE_STAYOUT 0x0008 // ignores the duration, stays faded out until new ScreenFade message received
- #define FFADE_PURGE 0x0010 // Purges all other fades, replacing them with this one
- stock PerformFade(client, duration, const color[4])
- {
- new Handle:hFadeClient=StartMessageOne("Fade",client);
- BfWriteShort(hFadeClient,duration); // FIXED 16 bit, with SCREENFADE_FRACBITS fractional, seconds duration
- BfWriteShort(hFadeClient,0); // FIXED 16 bit, with SCREENFADE_FRACBITS fractional, seconds duration until reset (fade & hold)
- BfWriteShort(hFadeClient,(FFADE_PURGE)); // fade type (in / out)
- BfWriteByte(hFadeClient,color[0]); // fade red
- BfWriteByte(hFadeClient,color[1]); // fade green
- BfWriteByte(hFadeClient,color[2]); // fade blue
- BfWriteByte(hFadeClient,color[3]); // fade alpha
- EndMessage();
- }
- stock makeZombie(Client)
- {
- new Float:position[3];
- GetClientAbsOrigin(Client, position);
- position[2] -= 50.0;
- new monster = Zombie_Spawn(position, "models/zombie/Poison.mdl", ZombieSeekThink, "npc_zombie", "Idle01");
- Ragdoll[Client] = monster;
- SDKHook(monster, SDKHook_OnTakeDamage, ZombieDamageHook);
- }
- stock Zombie_Spawn(Float:vEntPosition[3], String:model[128], SDKHookCB:ThinkFunction, String:classname[32], String:idleAnimation[])
- {
- decl String:entIndex[6];
- new monster = CreateEntityByName("hostage_entity");
- new monster_tmp = CreateEntityByName("prop_dynamic_ornament");
- IntToString(monster_tmp, entIndex, sizeof(entIndex)-1);
- DispatchKeyValue(monster, "classname", classname);
- DispatchKeyValue(monster, "targetname", entIndex);
- DispatchKeyValue(monster, "disableshadows", "1");
- DispatchKeyValueFloat(monster, "friction", 1.2);
- DispatchSpawn(monster);
- SetEntProp(monster, Prop_Data, "m_iHealth", 3000);
- SetEntityModel(monster, "models/blackout.mdl");
- // Create the animated monster
- DispatchKeyValue(monster_tmp, "model", model);
- DispatchKeyValue(monster_tmp, "DefaultAnim", idleAnimation);
- DispatchSpawn(monster_tmp);
- // Set Position of the Hostage
- TeleportEntity(monster, vEntPosition, NULL_VECTOR, NULL_VECTOR);
- // Parent
- SetVariantString(entIndex);
- AcceptEntityInput(monster_tmp, "SetParent");
- SetVariantString(entIndex);
- AcceptEntityInput(monster_tmp, "SetAttached");
- TeleportEntity(monster, vEntPosition, NULL_VECTOR, NULL_VECTOR);
- SDKHook(monster, SDKHook_Think, ThinkFunction);
- return monster;
- }
- public ZombieSeekThink(monster)
- {
- new Float:curtime = GetEngineTime();
- if(FloatSub(NextThink[monster], curtime) <= 0.0) IsAttack[monster] = false;
- decl target;
- decl Float:vClientPosition[3], Float:vEntPosition[3];
- BaseNPC_Think(monster, target);
- GetEntPropVector(monster, Prop_Send, "m_vecOrigin", vEntPosition);
- if(target > 0 && JoinCheck(target))
- {
- GetClientEyePosition(target, vClientPosition);
- new Float:distance = GetVectorDistance(vClientPosition, vEntPosition, false);
- if(distance < 125.0 && BaseNPC_CanSeeEachOther(monster, target) && !IsAttack[monster])
- {
- BaseNPC_SetAnimation(monster, "melee_01", 2.0);
- EmitSoundToAll("npc/zombie/claw_strike1.wav", monster);
- IsAttack[monster] = true;
- if(monster && target) makeDamage(target, target, 12, DMG_ACID, 1.0, vClientPosition);
- }
- else if(FloatSub(NextThink[monster], curtime) <= 0.0)
- {
- switch (GetRandomInt(0, 2))
- {
- case 0:
- {
- BaseNPC_SetAnimation(monster, "Walk", 2.5);
- EmitSoundToAll("npc/zombie/foot1.wav", monster);
- }
- case 1:
- {
- BaseNPC_SetAnimation(monster, "Walk", 2.5);
- EmitSoundToAll("npc/zombie/foot2.wav", monster);
- }
- case 2:
- {
- BaseNPC_SetAnimation(monster, "Walk", 2.5);
- EmitSoundToAll("npc/zombie/foot3.wav", monster);
- }
- }
- }
- }
- else
- {
- BaseNPC_SetAnimation(monster, "Idle01", 3.0);
- }
- }
- stock bool:BaseNPC_Think(monster, &target, Float:height=60.0)
- {
- new Float:entityposition[3], Float:ClientPosition[3], Float:dist;
- GetEntPropVector(monster, Prop_Send, "m_vecOrigin", entityposition);
- for(new i = 1; i <= MaxClients; i++)
- {
- if(IsClientConnected(i) && IsClientInGame(i) && IsPlayerAlive(i))
- {
- GetClientEyePosition(i, ClientPosition);
- new Float:distance = GetVectorDistance(entityposition, ClientPosition, false);
- if(BaseNPC_CanSeeEachOther(monster, i, height))
- {
- if(dist == 0.0 || dist > distance)
- {
- SetEntDataEnt2(monster, gLeaderOffset, i);
- target = i;
- dist = distance;
- }
- }
- }
- }
- }
- stock BaseNPC_CanSeeEachOther(monster, target, Float:monsterheight = 60.0)
- {
- new Float:vMonsterPosition[3], Float:vTargetPosition[3];
- GetEntPropVector(monster, Prop_Send, "m_vecOrigin", vMonsterPosition);
- vMonsterPosition[2] += monsterheight;
- if(JoinCheck(target))
- {
- GetClientEyePosition(target, vTargetPosition);
- new Handle:trace = TR_TraceRayFilterEx(vMonsterPosition, vTargetPosition, MASK_SOLID_BRUSHONLY, RayType_EndPoint, tracerayfilternotdefault);
- if(TR_DidHit(trace))
- {
- CloseHandle(trace);
- return false;
- }
- CloseHandle(trace);
- return true;
- }
- return false;
- }
- stock Action:BaseNPC_SetAnimation(monster, String:animation[32], Float:animtime = 0.0)
- {
- new String:edictname[32];
- GetEdictClassname(monster, edictname, 32);
- if(!IsValidEdict(monster) || !IsValidEntity(monster) || StrContains(edictname, "npc_") == -1)
- {
- return;
- }
- decl String:tmp[32];
- GetEntPropString(monster, Prop_Data, "m_iName", tmp, sizeof(tmp));
- new monster_tmp = StringToInt(tmp);
- SetVariantString(animation);
- AcceptEntityInput(monster_tmp, "SetAnimation");
- NextThink[monster] = GetEngineTime() + animtime;
- }
- stock bool:BaseNPC_Hurt(monster, attacker, damage = 0, String:sound[32])
- {
- new String:edictname[32];
- GetEdictClassname(attacker, edictname, 32);
- if(!StrEqual(edictname, "player")) return false;
- new health = GetEntProp(monster, Prop_Data, "m_iHealth") - damage;
- SetEntProp(monster, Prop_Data, "m_iHealth", health);
- new Float:vEntPosition[3];
- GetEntPropVector(monster, Prop_Send, "m_vecOrigin", vEntPosition);
- EmitSoundToAll(sound, 0, SNDCHAN_AUTO, SNDLEVEL_NORMAL, SND_NOFLAGS, SNDVOL_NORMAL, SNDPITCH_NORMAL, -1, vEntPosition);
- if(!GetEntDataEnt2(monster, gLeaderOffset)) SetEntDataEnt2(monster, gLeaderOffset, attacker);
- if(health <= 0) return true;
- else return false;
- }
- stock BaseNPC_Death(monster)
- {
- if(IsValidEntity(monster) && IsValidEdict(monster))
- {
- decl String:tmp[32], Float:Pos[3], Float:Angle[3];
- GetEntPropString(monster, Prop_Data, "m_iName", tmp, sizeof(tmp));
- GetEntPropVector(monster, Prop_Send, "m_vecOrigin", Pos);
- GetEntPropVector(monster, Prop_Send, "m_angRotation", Angle);
- new monster_tmp = StringToInt(tmp);
- SetEntityMoveType(monster, MOVETYPE_VPHYSICS);
- AcceptEntityInput(monster, "Kill");
- AcceptEntityInput(monster_tmp, "Kill");
- //래그ëŒì€ 프ë¡ì´ 무난함
- new ragdoll = CreateEntityByName("prop_ragdoll"), String:TargetName[256];
- Format(TargetName, 256, "%i", ragdoll);
- DispatchKeyValue(ragdoll, "targetname", TargetName);
- DispatchKeyValue(ragdoll, "model", "models/zombie/Poison.mdl");
- DispatchSpawn(ragdoll);
- SetEntProp(ragdoll, Prop_Send, "m_CollisionGroup", 2);
- SetEntityModel(ragdoll, "models/zombie/Poison.mdl");
- Pos[2] += 30.0;
- SetEntPropVector(ragdoll, Prop_Send, "m_vecOrigin", Pos);
- TeleportEntity(ragdoll, Pos, Angle, NULL_VECTOR);
- }
- }
- public Action:SoundCallBackHook(clients[64], &numClients, String:sample[PLATFORM_MAX_PATH], &entity, &channel, &Float:volume, &level, &pitch, &flags)
- {
- if(StrEqual(sample, "items/itempickup.wav")) return Plugin_Handled;//ì•„ì´í…œ 살때 사운드를 안들리게 막아준다.
- if(StrEqual(sample, "weapons/ClipEmpty_Rifle.wav")) return Plugin_Handled;//F1, F2키 ëˆŒë €ì„때 나오는 사운드를 막아준다.
- new Owner = GetEntPropEnt(entity, Prop_Send, "m_hOwnerEntity");
- if(Owner > 0 && Owner <= MaxClients)
- {
- if(!StrContains(sample, "weapons/knife/knife_slash"))
- {
- EmitSoundToAll("weapons/iceaxe/iceaxe_swing1.wav", Owner, channel, level, flags, volume);
- return Plugin_Handled;
- }
- if(StrEqual(sample, "weapons/knife/knife_stab.wav"))
- {
- EmitSoundToAll("tttmusic/body_medium_impact_hard6.wav", Owner, channel, level, flags, volume);
- return Plugin_Handled;
- }
- if(StrEqual(sample, "weapons/knife/knife_hitwall1.wav"))
- {
- EmitSoundToAll("weapons/knife/knife_hitwall1.wav", Owner, channel, level, flags, volume);
- return Plugin_Handled;
- }
- else if(!StrContains(sample, "weapons/knife/knife_hit"))
- {
- new String:StringSound[32];
- Format(StringSound, 32, "weapons/knife/knife_hit%i.wav", GetRandomInt(1, 4));
- EmitSoundToAll(StringSound, Owner, channel, level, flags, volume);
- return Plugin_Handled;
- }
- }
- if(StrContains(sample, "player/death") == 0) return Plugin_Handled;
- return Plugin_Continue;
- }
- public Action:TE_Hook_ShotgunShot(const String:te_name[], const Players[], numClients, Float:delay)
- {
- new Client = TE_ReadNum("m_iPlayer")+1;
- new weapons = GetEntPropEnt(Client, Prop_Data, "m_hActiveWeapon"), String:classname[32];
- if(weapons > 0 && IsValidEdict(weapons)) GetEdictClassname(weapons, classname, 32);
- if(TE_ReadNum("m_iMode") < 2)
- {
- if(StrEqual(classname, "weapon_awp", false) && Silenced_Sniper_Rifle[weapons])
- {
- new Float:Vector[3], Float:angle[3], seedvalue;
- GetClientEyePosition(Client, Vector);
- GetClientEyeAngles(Client, angle);
- seedvalue = TE_ReadNum("m_iSeed");
- TE_Start("Shotgun Shot");
- TE_WriteVector("m_vecOrigin", Vector);
- TE_WriteFloat("m_vecAngles[0]", angle[0]);
- TE_WriteFloat("m_vecAngles[1]", angle[1]);
- TE_WriteFloat("m_fInaccuracy", 0.0);
- TE_WriteFloat("m_fSpread", 0.0);
- TE_WriteNum("m_iPlayer", Client-1);
- TE_WriteNum("m_iMode", 3);
- TE_WriteNum("m_iSeed", seedvalue);
- TE_WriteNum("m_iWeaponID", 21);
- TE_SendToAll();
- return Plugin_Stop;
- }
- if(StrEqual(classname, "weapon_p228", false))
- {
- new Float:Vector[3], Float:angle[3], seedvalue;
- GetClientEyePosition(Client, Vector);
- GetClientEyeAngles(Client, angle);
- seedvalue = TE_ReadNum("m_iSeed");
- TE_Start("Shotgun Shot");
- TE_WriteVector("m_vecOrigin", Vector);
- TE_WriteFloat("m_vecAngles[0]", angle[0]);
- TE_WriteFloat("m_vecAngles[1]", angle[1]);
- TE_WriteFloat("m_fInaccuracy", 0.0);
- TE_WriteFloat("m_fSpread", 0.0);
- TE_WriteNum("m_iPlayer", Client-1);
- TE_WriteNum("m_iMode", 2);
- TE_WriteNum("m_iSeed", seedvalue);
- TE_WriteNum("m_iWeaponID", 4);
- TE_SendToAll();
- return Plugin_Stop;
- }
- }
- return Plugin_Continue;
- }
- stock CalculateHour(year, month, day, hour, plushour, &returnyear, &returnmonth, &returnday, &returnhour)
- {
- new bool:loop;
- returnyear = year;
- returnmonth = month;
- returnday = day;
- returnhour = hour + plushour;
- while(!loop)
- {
- loop = true;
- if(returnhour >= 24)
- {
- returnday += 1;
- returnhour -= 24;
- loop = false;
- }
- if(month == 2)
- {
- if((returnyear % 400 == 0 && returnyear % 100 == 0) || (returnyear % 100 != 0 && returnyear % 4 == 0))//윤년ì¼ë•Œ
- {
- if(returnday > 29)
- {
- returnmonth += 1;
- returnday -= 29;
- loop = false;
- }
- }
- else//ìœ¤ë…„ì´ ì•„ë‹ë•Œ
- {
- if(returnday > 28)
- {
- returnmonth += 1;
- returnday -= 28;
- loop = false;
- }
- }
- }
- else if((returnmonth <= 7 && returnmonth % 2 == 1) || (returnmonth > 7 && returnmonth % 2 == 0))//31ì¼ì´ë©´
- {
- if(returnday > 31)
- {
- returnmonth += 1;
- returnday -= 31;
- loop = false;
- }
- }
- else//30ì¼ì´ë©´
- {
- if(returnday > 30)
- {
- returnmonth += 1;
- returnday -= 30;
- loop = false;
- }
- }
- if(returnmonth > 12)
- {
- returnyear += 1;
- returnmonth -= 12;
- loop = false;
- }
- }
- }
- stock Due_VIP_Check(Client, year, month, day, hour, minute)
- {
- if(IsClientInGame(Client))
- {
- 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;
- new String:SteamID[256];
- GetClientAuthString(Client, SteamID, 256);
- FormatTime(Time_Year, 30, "%Y", GetTime());
- FormatTime(Time_Month, 30, "%m", GetTime());
- FormatTime(Time_Day, 30, "%d", GetTime());
- FormatTime(Time_Hour, 30, "%H", GetTime());
- FormatTime(Time_Minute, 30, "%M", GetTime());
- if(StringToInt(Time_Year) > year)
- {
- Remove = true;
- }
- else if(StringToInt(Time_Year) == year)
- {
- if(StringToInt(Time_Month) > month)
- {
- Remove = true;
- }
- else if(StringToInt(Time_Month) == month)
- {
- if(StringToInt(Time_Day) > day)
- {
- Remove = true;
- }
- else if(StringToInt(Time_Day) == day)
- {
- if(StringToInt(Time_Hour) > hour)
- {
- Remove = true;
- }
- else if(StringToInt(Time_Hour) == hour)
- {
- if(StringToInt(Time_Minute) >= minute)
- {
- Remove = true;
- }
- }
- }
- }
- }
- if(Remove)
- {
- Format(query, 512, "DELETE FROM vip WHERE steamid = '%s';", SteamID);
- SQL_TQuery(databasehandle, save_info, query, Client);
- PrintChat(Client, "\x07FFFFFFVIP Time is done.");
- if(VIP[Client]) VIP[Client] = 0;
- }
- }
- }
- stock GetPlayerStuckEnt(client)
- {
- decl Float:vecMin[3], Float:vecMax[3], Float:vecOrigin[3];
- GetClientMins(client, vecMin);
- GetClientMaxs(client, vecMax);
- GetClientAbsOrigin(client, vecOrigin);
- TR_TraceHullFilter(vecOrigin, vecOrigin, vecMin, vecMax, MASK_PLAYERSOLID, tracerayfilteronlyplayer2, client);
- return TR_GetEntityIndex();
- }
- MountLadder(client)
- {
- //LogMessage("Client %i: MountLadder", client);
- //SetEntityMoveType(client, MOVETYPE_NONE);
- //SetEntityMoveType(client, MOVETYPE_FLY);
- //SetEntPropFloat(client, Prop_Data, "m_flFriction", 0.001);
- //SetEntityGravity(client, 0.0);
- SDKHook(client, SDKHook_PreThink, MoveOnLadder);
- }
- DismountLadder(client)
- {
- //LogMessage("Client %i: DismountLadder", client);
- SetEntityMoveType(client, MOVETYPE_WALK);
- //SetEntPropFloat(client, Prop_Data, "m_flFriction", 1.0);
- SDKUnhook(client, SDKHook_PreThink, MoveOnLadder);
- }
- public MoveOnLadder(client)
- {
- new Float:speed = GetEntPropFloat(client, Prop_Send, "m_flMaxspeed");
- decl buttons;
- buttons = GetClientButtons(client);
- decl Float:origin[3];
- GetClientAbsOrigin(client, origin);
- new bool:movingUp = (origin[2] > lastZ[client]);
- lastZ[client] = origin[2];
- decl Float:angles[3];
- GetClientEyeAngles(client, angles);
- decl Float:velocity[3];
- SetEntityMoveType(client, MOVETYPE_WALK);
- if(buttons & IN_FORWARD || buttons & IN_JUMP) {
- velocity[0] = speed * Cosine(DegToRad(angles[1]));
- velocity[1] = speed * Sine(DegToRad(angles[1]));
- velocity[2] = -1 * speed * Sine(DegToRad(angles[0]));
- // Soldier and heavy do not achieve the required velocity to get off the
- // ground. The calculation below provides a boost when necessary.
- if (!movingUp && angles[0] < -25.0 && velocity[2] > 0 && velocity[2] < 200.0) {
- //LogMessage("Client %i: BOOST", client);
- // is friction on different surfaces an issue?
- velocity[2] = 200.1;
- }
- //LogMessage("Client %i: Forward %f %f", client, angles[0], velocity[2]);
- } else if(buttons & IN_MOVELEFT) {
- velocity[0] = speed * Cosine(DegToRad(angles[1] + 45));
- velocity[1] = speed * Sine(DegToRad(angles[1] + 45));
- velocity[2] = -1 * speed * Sine(DegToRad(angles[0]));
- //LogMessage("Client %i: Left", client);
- } else if(buttons & IN_MOVERIGHT) {
- velocity[0] = speed * Cosine(DegToRad(angles[1] - 45));
- velocity[1] = speed * Sine(DegToRad(angles[1] - 45));
- velocity[2] = -1 * speed * Sine(DegToRad(angles[0]));
- //LogMessage("Client %i: Right", client);
- } else if(buttons & IN_BACK) {
- velocity[0] = -1 * speed * Cosine(DegToRad(angles[1]));
- velocity[1] = -1 * speed * Sine(DegToRad(angles[1]));
- velocity[2] = speed * Sine(DegToRad(angles[0]));
- //LogMessage("Client %i: Backwards", client);
- } else {
- velocity[0] = 0.0;
- velocity[1] = 0.0;
- velocity[2] = 0.0;
- //LogMessage("Client %i: Hold", client);
- SetEntityMoveType(client, MOVETYPE_FLY);
- }
- TeleportEntity(client, origin, NULL_VECTOR, velocity);
- }
- public Action:ShowMOTD(Handle:timer, any:Client)
- {
- ShowLongMOTD(Client,"Title","motd2", false);
- }
- ShowLongMOTD(client,const String:title[],const String:panel[], bool:see)
- {
- new Handle:kv = CreateKeyValues("data");
- KvSetString(kv,"title",title);
- KvSetString(kv,"type","1");
- KvSetString(kv,"msg",panel);
- ShowVGUIPanel(client,"info",kv,see);
- CloseHandle(kv);
- }
- bool:SetLongMOTD(const String:panel[],const String:text[])
- {
- new table = FindStringTable("InfoPanel");
- if(table != INVALID_STRING_TABLE)
- {
- new len = strlen(text);
- new str = FindStringIndex(table,panel);
- new bool:locked = LockStringTables(false);
- if(str == INVALID_STRING_INDEX || str == 65535)//for some reason it keeps returning 65535
- {
- AddToStringTable(table,panel,text,len);
- }
- else
- {
- SetStringTableData(table,str,text,len);
- }
- LockStringTables(locked);
- return true;
- }
- return false;
- }
- public Action:DrawZone(Handle:timer, any:Client)
- {
- new Float:EndPos[3];
- GetClientAbsOrigin(Client, EndPos);
- new Float:CalculatePos1[3], Float:CalculatePos2[3], Float:CalculatePos3[3], Float:CalculatePos4[3], Float:CalculatePos5[3], Float:CalculatePos6[3], lasercolor[4];
- lasercolor[0] = GetRandomInt(0, 255);
- lasercolor[1] = GetRandomInt(0, 255);
- lasercolor[2] = GetRandomInt(0, 255);
- lasercolor[3] = 255;
- CalculatePos1[0] = EndPos[0];
- CalculatePos1[1] = StartPos[1];
- CalculatePos1[2] = StartPos[2];
- CalculatePos2[0] = StartPos[0];
- CalculatePos2[1] = EndPos[1];
- CalculatePos2[2] = StartPos[2];
- CalculatePos3[0] = EndPos[0];
- CalculatePos3[1] = EndPos[1];
- CalculatePos3[2] = StartPos[2];
- CalculatePos4[0] = EndPos[0];
- CalculatePos4[1] = StartPos[1];
- CalculatePos4[2] = EndPos[2];
- CalculatePos5[0] = StartPos[0];
- CalculatePos5[1] = StartPos[1];
- CalculatePos5[2] = EndPos[2];
- CalculatePos6[0] = StartPos[0];
- CalculatePos6[1] = EndPos[1];
- CalculatePos6[2] = EndPos[2];
- TE_SetupBeamPoints(StartPos, CalculatePos1, PrecacheModel("materials/sprites/laser.vmt"), 0, 0, 0, 0.1, 2.0, 2.0, 0, 0.0, lasercolor, 0);
- TE_SendToAll();
- TE_SetupBeamPoints(StartPos, CalculatePos2, PrecacheModel("materials/sprites/laser.vmt"), 0, 0, 0, 0.1, 2.0, 2.0, 0, 0.0, lasercolor, 0);
- TE_SendToAll();
- TE_SetupBeamPoints(StartPos, CalculatePos5, PrecacheModel("materials/sprites/laser.vmt"), 0, 0, 0, 0.1, 2.0, 2.0, 0, 0.0, lasercolor, 0);
- TE_SendToAll();
- TE_SetupBeamPoints(CalculatePos1, CalculatePos3, PrecacheModel("materials/sprites/laser.vmt"), 0, 0, 0, 0.1, 2.0, 2.0, 0, 0.0, lasercolor, 0);
- TE_SendToAll();
- TE_SetupBeamPoints(CalculatePos1, CalculatePos4, PrecacheModel("materials/sprites/laser.vmt"), 0, 0, 0, 0.1, 2.0, 2.0, 0, 0.0, lasercolor, 0);
- TE_SendToAll();
- TE_SetupBeamPoints(CalculatePos2, CalculatePos3, PrecacheModel("materials/sprites/laser.vmt"), 0, 0, 0, 0.1, 2.0, 2.0, 0, 0.0, lasercolor, 0);
- TE_SendToAll();
- TE_SetupBeamPoints(CalculatePos2, CalculatePos6, PrecacheModel("materials/sprites/laser.vmt"), 0, 0, 0, 0.1, 2.0, 2.0, 0, 0.0, lasercolor, 0);
- TE_SendToAll();
- TE_SetupBeamPoints(CalculatePos3, EndPos, PrecacheModel("materials/sprites/laser.vmt"), 0, 0, 0, 0.1, 2.0, 2.0, 0, 0.0, lasercolor, 0);
- TE_SendToAll();
- TE_SetupBeamPoints(CalculatePos4, CalculatePos5, PrecacheModel("materials/sprites/laser.vmt"), 0, 0, 0, 0.1, 2.0, 2.0, 0, 0.0, lasercolor, 0);
- TE_SendToAll();
- TE_SetupBeamPoints(CalculatePos4, EndPos, PrecacheModel("materials/sprites/laser.vmt"), 0, 0, 0, 0.1, 2.0, 2.0, 0, 0.0, lasercolor, 0);
- TE_SendToAll();
- TE_SetupBeamPoints(CalculatePos5, CalculatePos6, PrecacheModel("materials/sprites/laser.vmt"), 0, 0, 0, 0.1, 2.0, 2.0, 0, 0.0, lasercolor, 0);
- TE_SendToAll();
- TE_SetupBeamPoints(CalculatePos6, EndPos, PrecacheModel("materials/sprites/laser.vmt"), 0, 0, 0, 0.1, 2.0, 2.0, 0, 0.0, lasercolor, 0);
- TE_SendToAll();
- }
- stock CreateRotatingTrail(Client)
- {
- new Float:resultposition[3];
- GetClientAbsOrigin(Client, resultposition);
- resultposition[2] += 5.0;
- new String:steamid2[64];
- GetClientAuthString(Client, steamid2, 64);
- new String:steamid3[64];
- new func_rotating = CreateEntityByName("func_rotating");
- DispatchKeyValueVector(func_rotating, "origin", resultposition);
- Format(steamid3, 64, "%s%i", steamid2, GetRandomInt(0, 99999));
- DispatchKeyValue(func_rotating, "targetname", steamid3);
- DispatchKeyValue(func_rotating, "renderfx", "0");
- DispatchKeyValue(func_rotating, "rendermode", "0");
- DispatchKeyValue(func_rotating, "renderamt", "255");
- DispatchKeyValue(func_rotating, "rendercolor", "255 255 255");
- DispatchKeyValue(func_rotating, "maxspeed", "400");
- DispatchKeyValue(func_rotating, "friction", "20");
- DispatchKeyValue(func_rotating, "dmg", "0");
- DispatchKeyValue(func_rotating, "solid", "0");
- DispatchKeyValue(func_rotating, "spawnflags", "64");
- DispatchSpawn(func_rotating);
- if(GetPlayerWeaponSlot(Client, 4) == -1)
- GivePlayerItem(Client, "weapon_c4");
- resultposition[0] += 40.0;
- new trail = CreateEntityByName("env_spritetrail");
- DispatchKeyValueVector(trail,"Origin", resultposition);
- DispatchKeyValue(trail, "lifetime", "0.4");
- DispatchKeyValue(trail, "startwidth", "15.0");
- DispatchKeyValue(trail, "endwidth", "5.0");
- DispatchKeyValue(trail, "spritename", "materials/sprites/laser.vmt");
- DispatchKeyValue(trail, "renderamt", "255");
- DispatchKeyValue(trail, "rendercolor", "255 255 255");
- DispatchKeyValue(trail, "rendermode", "5");
- DispatchSpawn(trail);
- SetVariantString(steamid3);
- AcceptEntityInput(trail, "SetParent");
- AcceptEntityInput(trail, "ShowSprite");
- AcceptEntityInput(func_rotating, "Start");
- DispatchKeyValue(GetPlayerWeaponSlot(Client, 4), "targetname", steamid2);
- SetVariantString(steamid2);
- AcceptEntityInput(func_rotating, "SetParent");
- resultposition[0] -= 80.0;
- trail = CreateEntityByName("env_spritetrail");
- DispatchKeyValueVector(trail,"Origin", resultposition);
- DispatchKeyValue(trail, "lifetime", "0.4");
- DispatchKeyValue(trail, "startwidth", "15.0");
- DispatchKeyValue(trail, "endwidth", "5.0");
- DispatchKeyValue(trail, "spritename", "materials/sprites/laser.vmt");
- DispatchKeyValue(trail, "renderamt", "255");
- DispatchKeyValue(trail, "rendercolor", "255 255 255");
- DispatchKeyValue(trail, "rendermode", "5");
- DispatchSpawn(trail);
- SetVariantString(steamid3);
- AcceptEntityInput(trail, "SetParent");
- AcceptEntityInput(trail, "ShowSprite");
- AcceptEntityInput(func_rotating, "Start");
- DispatchKeyValue(GetPlayerWeaponSlot(Client, 4), "targetname", steamid2);
- SetVariantString(steamid2);
- AcceptEntityInput(func_rotating, "SetParent");
- resultposition[0] += 40.0;
- resultposition[1] -= 40.0;
- trail = CreateEntityByName("env_spritetrail");
- DispatchKeyValueVector(trail,"Origin", resultposition);
- DispatchKeyValue(trail, "lifetime", "0.4");
- DispatchKeyValue(trail, "startwidth", "15.0");
- DispatchKeyValue(trail, "endwidth", "5.0");
- DispatchKeyValue(trail, "spritename", "materials/sprites/laser.vmt");
- DispatchKeyValue(trail, "renderamt", "255");
- DispatchKeyValue(trail, "rendercolor", "255 255 255");
- DispatchKeyValue(trail, "rendermode", "5");
- DispatchSpawn(trail);
- SetVariantString(steamid3);
- AcceptEntityInput(trail, "SetParent");
- AcceptEntityInput(trail, "ShowSprite");
- AcceptEntityInput(func_rotating, "Start");
- DispatchKeyValue(GetPlayerWeaponSlot(Client, 4), "targetname", steamid2);
- SetVariantString(steamid2);
- AcceptEntityInput(func_rotating, "SetParent");
- resultposition[1] += 80.0;
- trail = CreateEntityByName("env_spritetrail");
- DispatchKeyValueVector(trail,"Origin", resultposition);
- DispatchKeyValue(trail, "lifetime", "0.4");
- DispatchKeyValue(trail, "startwidth", "15.0");
- DispatchKeyValue(trail, "endwidth", "5.0");
- DispatchKeyValue(trail, "spritename", "materials/sprites/laser.vmt");
- DispatchKeyValue(trail, "renderamt", "255");
- DispatchKeyValue(trail, "rendercolor", "255 255 255");
- DispatchKeyValue(trail, "rendermode", "5");
- DispatchSpawn(trail);
- SetVariantString(steamid3);
- AcceptEntityInput(trail, "SetParent");
- AcceptEntityInput(trail, "ShowSprite");
- AcceptEntityInput(func_rotating, "Start");
- DispatchKeyValue(GetPlayerWeaponSlot(Client, 4), "targetname", steamid2);
- SetVariantString(steamid2);
- AcceptEntityInput(func_rotating, "SetParent");
- }
- stock CreateRotatingTrail2(Client)
- {
- new Float:resultposition[3];
- GetClientAbsOrigin(Client, resultposition);
- resultposition[2] += 35.0;
- new String:steamid2[64];
- GetClientAuthString(Client, steamid2, 64);
- new String:steamid3[64];
- VIP_Trails_RotatingEntity[Client] = CreateEntityByName("func_rotating");
- DispatchKeyValueVector(VIP_Trails_RotatingEntity[Client], "origin", resultposition);
- Format(steamid3, 64, "%s%i", steamid2, GetRandomInt(0, 99999));
- DispatchKeyValue(VIP_Trails_RotatingEntity[Client], "targetname", steamid3);
- DispatchKeyValue(VIP_Trails_RotatingEntity[Client], "renderfx", "0");
- DispatchKeyValue(VIP_Trails_RotatingEntity[Client], "rendermode", "0");
- DispatchKeyValue(VIP_Trails_RotatingEntity[Client], "renderamt", "255");
- DispatchKeyValue(VIP_Trails_RotatingEntity[Client], "rendercolor", "255 255 255");
- DispatchKeyValue(VIP_Trails_RotatingEntity[Client], "maxspeed", "400");
- DispatchKeyValue(VIP_Trails_RotatingEntity[Client], "friction", "20");
- DispatchKeyValue(VIP_Trails_RotatingEntity[Client], "dmg", "0");
- DispatchKeyValue(VIP_Trails_RotatingEntity[Client], "solid", "0");
- DispatchKeyValue(VIP_Trails_RotatingEntity[Client], "spawnflags", "64");
- DispatchSpawn(VIP_Trails_RotatingEntity[Client]);
- if(GetPlayerWeaponSlot(Client, 4) == -1)
- GivePlayerItem(Client, "weapon_c4");
- resultposition[0] += 40.0;
- new trail = CreateEntityByName("env_spritetrail");
- DispatchKeyValueVector(trail,"Origin", resultposition);
- DispatchKeyValue(trail, "lifetime", "0.4");
- DispatchKeyValue(trail, "startwidth", "20.0");
- DispatchKeyValue(trail, "endwidth", "10.0");
- DispatchKeyValue(trail, "spritename", "materials/sprites/laser.vmt");
- DispatchKeyValue(trail, "renderamt", "255");
- DispatchKeyValue(trail, "rendercolor", "255 0 0");
- DispatchKeyValue(trail, "rendermode", "5");
- DispatchSpawn(trail);
- SetVariantString(steamid3);
- AcceptEntityInput(trail, "SetParent");
- AcceptEntityInput(trail, "ShowSprite");
- AcceptEntityInput(VIP_Trails_RotatingEntity[Client], "Start");
- DispatchKeyValue(GetPlayerWeaponSlot(Client, 4), "targetname", steamid2);
- SetVariantString(steamid2);
- AcceptEntityInput(VIP_Trails_RotatingEntity[Client], "SetParent");
- resultposition[2] -= 15.0;
- resultposition[0] -= 80.0;
- trail = CreateEntityByName("env_spritetrail");
- DispatchKeyValueVector(trail,"Origin", resultposition);
- DispatchKeyValue(trail, "lifetime", "0.4");
- DispatchKeyValue(trail, "startwidth", "20.0");
- DispatchKeyValue(trail, "endwidth", "10.0");
- DispatchKeyValue(trail, "spritename", "materials/sprites/laser.vmt");
- DispatchKeyValue(trail, "renderamt", "255");
- DispatchKeyValue(trail, "rendercolor", "255 255 0");
- DispatchKeyValue(trail, "rendermode", "5");
- DispatchSpawn(trail);
- SetVariantString(steamid3);
- AcceptEntityInput(trail, "SetParent");
- AcceptEntityInput(trail, "ShowSprite");
- AcceptEntityInput(VIP_Trails_RotatingEntity[Client], "Start");
- DispatchKeyValue(GetPlayerWeaponSlot(Client, 4), "targetname", steamid2);
- SetVariantString(steamid2);
- AcceptEntityInput(VIP_Trails_RotatingEntity[Client], "SetParent");
- resultposition[2] -= 15.0;
- resultposition[0] += 40.0;
- resultposition[1] -= 40.0;
- trail = CreateEntityByName("env_spritetrail");
- DispatchKeyValueVector(trail,"Origin", resultposition);
- DispatchKeyValue(trail, "lifetime", "0.4");
- DispatchKeyValue(trail, "startwidth", "20.0");
- DispatchKeyValue(trail, "endwidth", "10.0");
- DispatchKeyValue(trail, "spritename", "materials/sprites/laser.vmt");
- DispatchKeyValue(trail, "renderamt", "255");
- DispatchKeyValue(trail, "rendercolor", "0 255 0");
- DispatchKeyValue(trail, "rendermode", "5");
- DispatchSpawn(trail);
- SetVariantString(steamid3);
- AcceptEntityInput(trail, "SetParent");
- AcceptEntityInput(trail, "ShowSprite");
- AcceptEntityInput(VIP_Trails_RotatingEntity[Client], "Start");
- DispatchKeyValue(GetPlayerWeaponSlot(Client, 4), "targetname", steamid2);
- SetVariantString(steamid2);
- AcceptEntityInput(VIP_Trails_RotatingEntity[Client], "SetParent");
- resultposition[2] -= 15.0;
- resultposition[1] += 80.0;
- trail = CreateEntityByName("env_spritetrail");
- DispatchKeyValueVector(trail,"Origin", resultposition);
- DispatchKeyValue(trail, "lifetime", "0.4");
- DispatchKeyValue(trail, "startwidth", "15.0");
- DispatchKeyValue(trail, "endwidth", "6.0");
- DispatchKeyValue(trail, "spritename", "materials/sprites/laser.vmt");
- DispatchKeyValue(trail, "renderamt", "255");
- DispatchKeyValue(trail, "rendercolor", "0 0 255");
- DispatchKeyValue(trail, "rendermode", "5");
- DispatchSpawn(trail);
- SetVariantString(steamid3);
- AcceptEntityInput(trail, "SetParent");
- AcceptEntityInput(trail, "ShowSprite");
- AcceptEntityInput(VIP_Trails_RotatingEntity[Client], "Start");
- DispatchKeyValue(GetPlayerWeaponSlot(Client, 4), "targetname", steamid2);
- SetVariantString(steamid2);
- AcceptEntityInput(VIP_Trails_RotatingEntity[Client], "SetParent");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement