Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma semicolon 1
- #define DEBUG
- #define PLUGIN_AUTHOR ""
- #define PLUGIN_VERSION ""
- #include <sourcemod>
- #include <sdktools>
- #include <smlib>
- #include <cstrike>
- #include <sdkhooks>
- #define DecoyGrenade_Offset 18 // (18 * 4)
- EngineVersion g_Game;
- char g_sEggConfig[PLATFORM_MAX_PATH];
- int g_iPlayerPrevButtons[MAXPLAYERS + 1];
- bool OnVamp[MAXPLAYERS+1];
- Handle TIMER_REMOVEDRUGS[MAXPLAYERS+1] = INVALID_HANDLE;
- bool isOneHitKnifer[MAXPLAYERS+1];
- bool isVampire[MAXPLAYERS+1];
- bool isInvisible[MAXPLAYERS+1];
- bool bTookEgg = false;
- public Plugin myinfo =
- {
- name = "",
- author = PLUGIN_AUTHOR,
- description = "",
- version = PLUGIN_VERSION,
- url = ""
- };
- public void OnPluginStart()
- {
- /*if(GetTime() > 1543536000)
- {
- SetFailState("Time's up!");
- return;
- }*/
- g_Game = GetEngineVersion();
- if(g_Game != Engine_CSGO)
- {
- SetFailState("This plugin is for CSGO/CSS only.");
- }
- BuildPath(Path_SM, g_sEggConfig, sizeof(g_sEggConfig), "configs/eggs/eggs.cfg");
- HookEvent("round_start", Event_RoundStart, EventHookMode_PostNoCopy);
- HookEvent("player_spawn", Event_PlayerSpawn);
- for(new i=1;i <= MaxClients;i++)
- {
- if(!IsClientInGame(i))
- continue;
- OnClientPutInServer(i);
- }
- }
- public OnClientPutInServer(client)
- {
- SDKHook(client, SDKHook_OnTakeDamage, Event_OnTakeDamage);
- //SDKHook(client, SDKHook_SetTransmit, Event_ShouldSeeTarget);
- }
- public OnClientDisconnected(client)
- {
- if(TIMER_REMOVEDRUGS[client] != INVALID_HANDLE)
- {
- CloseHandle(TIMER_REMOVEDRUGS[client]);
- TIMER_REMOVEDRUGS[client] = INVALID_HANDLE;
- }
- }
- /*
- public Action:Hook_ShouldSeePlayer(client, viewer)
- {
- if(!isInvisible[client]
- else if(!IsPlayerAlive(viewer))
- return Plugin_Continue;
- else if(GetClientTeam(client) == GetClientTeam(viewer))
- return Plugin_Continue;
- }
- */
- public Action:Event_OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
- {
- if(victim == 0)
- return Plugin_Continue;
- else if(!IsValidPlayer(attacker))
- return Plugin_Continue;
- if(isVampire[attacker])
- SetEntProp(attacker, Prop_Send, "m_iHealth", GetEntProp(attacker, Prop_Send, "m_iHealth") + RoundFloat(damage));
- if(isOneHitKnifer[attacker])
- {
- damage = 65535.0;
- return Plugin_Changed;
- }
- return Plugin_Continue;
- }
- public void OnMapStart()
- {
- for(new i=0;i < MAXPLAYERS+1;i++)
- {
- isOneHitKnifer[i] = false;
- isVampire[i] = false;
- isInvisible[i] = false;
- }
- AddFileToDownloadsTable("materials/models/custom_prop/IDEAS/banner/8TanLRyg.vmt");
- AddFileToDownloadsTable("materials/models/custom_prop/IDEAS/banner/8TanLRyg.vtf");
- AddFileToDownloadsTable("models/custom_prop/IDEAS/banner/banner.dx90.vtx");
- AddFileToDownloadsTable("models/custom_prop/IDEAS/banner/banner.mdl");
- AddFileToDownloadsTable("sound/ideas/Bonus.wav");
- PrecacheSound("ideas/Bonus.wav");
- }
- public Action Event_PlayerSpawn(Event event, const char[] name, bool dontBroadcast)
- {
- int client = GetClientOfUserId(event.GetInt("userid"));
- if(client != 0)
- {
- isOneHitKnifer[client] = false;
- isVampire[client] = false;
- isInvisible[client] = false;
- if(TIMER_REMOVEDRUGS[client] != INVALID_HANDLE)
- {
- CloseHandle(TIMER_REMOVEDRUGS[client]);
- TIMER_REMOVEDRUGS[client] = INVALID_HANDLE;
- }
- }
- }
- public Action Event_RoundStart(Handle event, const char[] name, bool dontBroadcast)
- {
- bTookEgg = false;
- for(int i = 0; i <= MaxClients; i++) OnVamp[i] = false;
- CreateTimer(0.3, Remove_TakenEggs);
- }
- public Action Remove_TakenEggs(Handle tmr, any client)
- {
- KeyValues kv = CreateKeyValues("Eggs");
- kv.ImportFromFile(g_sEggConfig);
- if (kv.GotoFirstSubKey())
- {
- do
- {
- char found[10];
- kv.GetString("found", found, sizeof(found));
- int ifound = StringToInt(found);
- if(ifound == 1)
- {
- char nameinconfig[120];
- kv.GetSectionName(nameinconfig, sizeof(nameinconfig));
- int ent = 0;
- while ((ent = FindEntityByClassname(ent, "prop_dynamic")) != INVALID_ENT_REFERENCE) {
- if(IsValidEntity(ent) && IsValidEdict(ent)) {
- char entglobaname[50];
- Entity_GetGlobalName(ent, entglobaname, sizeof(entglobaname));
- if (StrEqual(entglobaname, nameinconfig)) {
- if(IsValidEntity(ent)) {
- Entity_Kill(ent);
- }
- }
- }
- }
- }
- } while (kv.GotoNextKey());
- delete kv;
- }
- }
- public Action OnPlayerRunCmd(int client, int &iButtons, int &iImpulse, float fVelocity[3], float fAngles[3], int &iWeapon)
- {
- new PrevButtons = g_iPlayerPrevButtons[client];
- g_iPlayerPrevButtons[client] = iButtons;
- if(IsClientInGame(client) && IsPlayerAlive(client))
- {
- if(!(PrevButtons & IN_USE) && iButtons & IN_USE)
- {
- int egg = GetTargetBlock(client);
- if(IsValidEntity(egg))
- {
- float EggOrg[3];
- float PlayerOrg[3];
- GetEntPropVector(egg, Prop_Send, "m_vecOrigin", EggOrg);
- GetClientAbsOrigin(client, PlayerOrg);
- float distance = GetVectorDistance(EggOrg, PlayerOrg);
- if(distance < 80.0)
- {
- if(bTookEgg)
- {
- PrintToChat(client, "[IDEAS BONUS]\x07 Only one bonus is given per round, try the next round");
- return Plugin_Continue;
- }
- new randomOpponent = GetRandomEnemy(client);
- if(randomOpponent == -1)
- return Plugin_Continue;
- bTookEgg = true;
- char eggname[120];
- Entity_GetGlobalName(egg, eggname, sizeof(eggname));
- char username[128];
- char steamid64[40];
- char founder[168];
- GetClientName(client, username, sizeof(username));
- GetClientAuthId(client, AuthId_SteamID64, steamid64, sizeof(steamid64));
- Format(founder, sizeof(founder), "Username: %s | SteamID64: %s", username, steamid64);
- //EggIsFound(eggname, founder);
- //RemoveEggFromMap(egg);
- /*
- PrintToChatAll("\x3 \x4 [IDEAS] \x1 --------------------------------------");
- PrintToChatAll("\x3 \x4 [IDEAS] \x1 Website: https://www.ideas-team.fr/");
- PrintToChatAll("\x3 \x4 [IDEAS] \x1 Teamspeak : ts12.verygames.net:50886");
- PrintToChatAll("\x3 \x4 [IDEAS] \x1 Our servers : ");
- PrintToChatAll("\x3 \x4 [IDEAS] \x1 Hide and Seek : 51.254.26.200:27015 ");
- PrintToChatAll("\x3 \x4 [IDEAS] \x1 AIM - AWP : 54.37.240.37:27015");
- PrintToChatAll("\x3 \x4 [IDEAS] \x1 ONLY AWP : 54.37.240.37:27015");
- PrintToChatAll("\x3 \x4 [IDEAS] \x1 --------------------------------------");
- */
- // if(GetEntProp(egg, Prop_Send, "m_iMinHealthDmg") == 5)
- {
- // SetEntProp(egg, Prop_Send, "m_iMinHealthDmg", 1);
- if(GetClientTeam(client) == CS_TEAM_T)
- {
- switch(GetRandomInt(0, 8))
- {
- case 0:
- {
- GivePlayerItem(client, "weapon_awp");
- PrintToChatAll("[IDEAS BONUS] \x01Player\x07 %N\x01 has been given an\x07 awp!", client);
- EmitSoundToAll("ideas/Bonus.wav");
- }
- case 1:
- {
- SetEntPropFloat(client, Prop_Send, "m_flLaggedMovementValue", 1.25);
- PrintToChatAll("[IDEAS BONUS] \x01Player\x07 %N\x01 has been given\x07 1.25x speed!", client);
- EmitSoundToAll("ideas/Bonus.wav");
- }
- case 2:
- {
- SetEntProp(client, Prop_Send, "m_iHealth", 400);
- PrintToChatAll("[IDEAS BONUS] \x01Player\x07 %N\x01 has been given\x07 400 HP!", client);
- EmitSoundToAll("ideas/Bonus.wav");
- }
- case 3:
- {
- SetEntProp(randomOpponent, Prop_Send, "m_iHealth", 100);
- PrintToChatAll("[IDEAS BONUS] \x01Player\x07 %N\x01 gave opponent\x07 %N \x01 100 HP", client, randomOpponent);
- EmitSoundToAll("ideas/Bonus.wav");
- }
- case 4:
- {
- new uidOpponent = GetClientUserId(randomOpponent);
- ServerCommand("sm_drug #%i 1", uidOpponent);
- TIMER_REMOVEDRUGS[randomOpponent] = CreateTimer(60.0, RemoveDrugs, uidOpponent, TIMER_FLAG_NO_MAPCHANGE);
- PrintToChatAll("[IDEAS BONUS] \x01Player\x07 %N\x01 gave opponent\x07 %N \x01 drugged vision during 1min", client, randomOpponent);
- EmitSoundToAll("ideas/Bonus.wav");
- }
- case 5:
- {
- GivePlayerItem(client, "weapon_sawedoff");
- PrintToChatAll("[IDEAS BONUS] \x01Player\x07 %N\x01 has been given \x07 sawed-off", client);
- EmitSoundToAll("ideas/Bonus.wav");
- }
- case 6:
- {
- GivePlayerItem(client, "weapon_knife");
- isOneHitKnifer[client] = true;
- PrintToChatAll("[IDEAS BONUS] \x01Player\x07 %N\x01 has been given the ability \x07to one-hit his opponents!", client);
- EmitSoundToAll("ideas/Bonus.wav");
- }
- case 7:
- {
- SetEntityRenderMode(client, RENDER_TRANSCOLOR);
- SetEntityRenderColor(client, 255, 255, 255, 40);
- PrintToChatAll("[IDEAS BONUS] \x01Player\x07 %N\x01 has been \x07 invisible", client);
- EmitSoundToAll("ideas/Bonus.wav");
- }
- case 8:
- {
- GivePlayerItem(client, "weapon_deagle");
- PrintToChatAll("[IDEAS BONUS] \x01Player\x07 %N\x01 has been given \x07 deagle", client);
- EmitSoundToAll("ideas/Bonus.wav");
- }
- }
- }
- else if(GetClientTeam(client) == CS_TEAM_CT)
- {
- switch(GetRandomInt(0, 9))
- {
- case 0:
- {
- GivePlayerItem(client, "weapon_deagle");
- PrintToChatAll("[IDEAS BONUS] \x01Player\x07 %N\x01 has been given \x07 deagle", client);
- EmitSoundToAll("ideas/Bonus.wav");
- }
- case 1:
- {
- UC_SetClientGodmode(client, true);
- PrintToChatAll("[IDEAS BONUS] \x01Player\x07 %N\x01 has been given \x07 Godmode!", client);
- EmitSoundToAll("ideas/Bonus.wav");
- }
- case 2:
- {
- ServerCommand("sm_beacon #%i", GetClientUserId(randomOpponent));
- PrintToChatAll("[IDEAS BONUS] \x01Player\x07 %N\x01 gave opponent\x07 %N \x01 beacon!", client, randomOpponent);
- EmitSoundToAll("ideas/Bonus.wav");
- }
- case 3:
- {
- SetEntProp(randomOpponent, Prop_Send, "m_iHealth", 1);
- PrintToChatAll("[IDEAS BONUS] \x01Player\x07 %N\x01 gave opponent\x07 %N \x01 1 HP!", client, randomOpponent);
- EmitSoundToAll("ideas/Bonus.wav");
- }
- case 4:
- {
- isVampire[client] = true;
- PrintToChatAll("[IDEAS BONUS] \x01Player\x07 %N\x01 has been given \x07Vampiric Life-Steal!", client);
- EmitSoundToAll("ideas/Bonus.wav");
- }
- case 5:
- {
- isOneHitKnifer[client] = true;
- PrintToChatAll("[IDEAS BONUS] \x01Player\x07 %N\x01 has been given the ability \x07to one-hit his opponents!", client);
- EmitSoundToAll("ideas/Bonus.wav");
- }
- case 6:
- {
- new uidOpponent = GetClientUserId(randomOpponent);
- ServerCommand("sm_drug #%i 1", uidOpponent);
- TIMER_REMOVEDRUGS[randomOpponent] = CreateTimer(60.0, RemoveDrugs, uidOpponent, TIMER_FLAG_NO_MAPCHANGE);
- PrintToChatAll("[IDEAS BONUS] \x01Player\x07 %N\x01 gave opponent\x07 %N \x01 drugged vision during 1min", client, randomOpponent);
- EmitSoundToAll("ideas/Bonus.wav");
- }
- case 7:
- {
- GivePlayerItem(client, "weapon_sawedoff");
- PrintToChatAll("[IDEAS BONUS] \x01Player\x07 %N\x01 has been given \x07 sawed-off", client);
- EmitSoundToAll("ideas/Bonus.wav");
- }
- case 8:
- {
- SetEntityRenderMode(client, RENDER_TRANSCOLOR);
- SetEntityRenderColor(client, 255, 255, 255, 40);
- PrintToChatAll("[IDEAS BONUS] \x01Player\x07 %N\x01 has been \x07 invisible", client);
- EmitSoundToAll("ideas/Bonus.wav");
- }
- case 9:
- {
- GivePlayerItem(client, "weapon_awp");
- PrintToChatAll("[IDEAS BONUS] \x01Player\x07 %N\x01 has been given an\x07 awp!", client);
- EmitSoundToAll("ideas/Bonus.wav");
- }
- }
- }
- }
- }
- }
- }
- }
- return Plugin_Continue;
- }
- public Action:RemoveDrugs(Handle:hTimer, UserId)
- {
- new client = GetClientOfUserId(UserId);
- if(client == 0)
- return Plugin_Stop;
- ServerCommand("sm_drug #%i 0", UserId);
- TIMER_REMOVEDRUGS[client] = INVALID_HANDLE;
- return Plugin_Stop;
- }
- int GetRandomEnemy(int client)
- {
- int clients[32], count;
- for(int i = 1; i <= MaxClients; i++)
- {
- if(IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) != GetClientTeam(client))
- {
- clients[count] = i;
- count++;
- }
- }
- return count > 0 ? clients[GetRandomInt(0, count-1)] : -1;
- }
- public void EggIsFound(char eggname[120], char founder[168])
- {
- KeyValues kv = CreateKeyValues("Eggs");
- kv.ImportFromFile(g_sEggConfig);
- if (kv.GotoFirstSubKey())
- {
- char nameinconfig[120];
- do
- {
- kv.GetSectionName(nameinconfig, sizeof(nameinconfig));
- if(StrEqual(nameinconfig, eggname))
- {
- kv.SetString("found", "1");
- kv.SetString("founder", founder);
- kv.Rewind();
- kv.ExportToFile(g_sEggConfig);
- }
- } while (kv.GotoNextKey());
- delete kv;
- }
- }
- public void RemoveEggFromMap(int entity)
- {
- if(IsValidEntity(entity))
- AcceptEntityInput(entity, "Kill");
- }
- public bool IsAdmin(int client)
- {
- if(Client_HasAdminFlags(client, ADMFLAG_GENERIC) || Client_HasAdminFlags(client, ADMFLAG_ROOT) || Client_HasAdminFlags(client, ADMFLAG_BAN))
- return true;
- else return false;
- }
- int GetTargetBlock(int client)
- {
- int entity = GetClientAimTarget(client, false);
- if (IsValidEntity(entity))
- {
- char classname[32];
- GetEdictClassname(entity, classname, 32);
- if (StrContains(classname, "prop_dynamic") != -1)
- return entity;
- }
- return -1;
- }
- stock UC_SetClientGodmode(client, bool:godmode)
- {
- if(godmode)
- SetEntProp(client, Prop_Data, "m_takedamage", 0, 1);
- else
- SetEntProp(client, Prop_Data, "m_takedamage", 2, 1);
- }
- stock bool:IsValidPlayer(client)
- {
- if(client <= 0)
- return false;
- else if(client > MaxClients)
- return false;
- return IsClientInGame(client);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement