- #include <sourcemod>
- #include <sdktools>
- #include <sdkhooks>
- #include <colors>
- #include <cssclantags>
- #include <smlib>
- #define NAME "CSS Throwing Knives"
- #define VERSION "1.2.2b"
- #define KNIFE_MDL "models/weapons/w_knife_ct.mdl"
- #define KNIFEHIT_SOUND "weapons/knife/knife_hit3.wav"
- #define TRAIL_MDL "materials/sprites/lgtning.vmt"
- #define TRAIL_COLOR {177, 177, 177, 117}
- #define ADD_OUTPUT "OnUser1 !self:Kill::1.5:1"
- #define COUNT_TXT "Il vous reste %i couteaux a lancer"
- new Handle:g_CVarEnable;
- new Handle:g_CVarEnableDev;
- new bool:g_bDev;
- new Handle:g_hLethalArray;
- new Handle:g_CVarVelocity;
- new Float:g_fVelocity;
- new Handle:g_CVarKnives;
- new Handle:g_CVarDamage;
- new String:g_sDamage[8];
- new Handle:g_CVarHSDamage;
- new String:g_sHSDamage[8];
- new Handle:g_CVarSteal;
- new Handle:g_CVarTrail;
- new bool:g_bTrail;
- new Handle:g_CVarNoBlock;
- new bool:g_bNoBlock;
- new Handle:g_CVarDisplay;
- new g_iDisplay;
- new Handle:g_CVarFF;
- new const Float:g_fSpin[3] = {4877.4, 0.0, 0.0};
- new const Float:g_fMinS[3] = {-24.0, -24.0, -24.0};
- new const Float:g_fMaxS[3] = {24.0, 24.0, 24.0};
- new g_iKnives[MAXPLAYERS+1];
- new g_iKnifeMI;
- new g_iPointHurt;
- new g_iEnvBlood;
- new g_iTrailMI;
- new Handle:g_hKTForward;
- new Handle:g_hKHForward;
- new Handle:g_hKKForward;
- #define MAX_RADIUS 50000.0
- public Plugin:myinfo =
- {
- name = "Plugin VIP complet",
- author = "Tom'77",
- description = "Plugin qui donne plusieurs avantages aux VIP",
- version = "1.0",
- url = "http://config-serv-css.tk/vip.rar"
- };
- public OnPluginStart()
- {
- HookEvent("player_spawn",Event_PlayerSpawn)
- HookEvent("smokegrenade_detonate",TeleHe);
- }
- public Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
- {
- new client = GetClientOfUserId(GetEventInt(event, "userid"));
- if(GetClientTeam(client) > 1 && GetUserFlagBits(client) & ADMFLAG_CUSTOM1)
- {
- CreateTimer(2.0,give_cash,any:client);
- PrintToChat(client, "\x04[VIP] \x03Ton accès VIP est activé, tu as bien reçu ta flashbang, ta semtex et ta fumigène jette la et tu seras téléporté là où elle explosera.");
- PrintToChat(client, "\x04[VIP] \x03Tu as aussi reçu un ClanTag VIP, un petit peu de vitesse en plus, 50HP et 100 d'armure.");
- Client_PrintKeyHintText(client, "[VIP by Tom'77]\n\nSemtex, flash et fumi téléport\n50HP et 100 d'armure\nClanTag et 16.000$\n\n=> Tout ça est activé <=");
- GivePlayerItem(client,"weapon_smokegrenade");
- GivePlayerItem(client,"weapon_hegrenade");
- GivePlayerItem(client,"weapon_flashbang");
- new vie = GetClientHealth(client);
- vie += 50;
- SetEntityHealth(client,vie);
- new armor = GetClientArmor(client);
- armor += 100;
- Client_SetArmor(client, armor);
- SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.2);
- }
- }
- public Action:TeleHe(Handle:event,String:name[], bool:dontBroadcast)
- {
- if(GetClientTeam(client) > 1 && GetUserFlagBits(client) & ADMFLAG_CUSTOM1)
- {
- new client = GetClientOfUserId(GetEventInt(event, "userid"));
- new Float:vec[3];
- GetClientAbsOrigin(client, vec);
- vec[0] = GetEventFloat(event, "x");
- vec[1] = GetEventFloat(event, "y");
- vec[2] = GetEventFloat(event, "z");
- TeleportEntity(client, vec, NULL_VECTOR, NULL_VECTOR);
- PrintToChat(client, "\x04[VIP] \x03Tu as été téléporté !");
- }
- }
- public Action:give_cash(Handle:timer, any:client)
- {
- if(GetClientTeam(client) > 1 && GetUserFlagBits(client) & ADMFLAG_CUSTOM1)
- {
- SetEntProp(client, Prop_Send, "m_iAccount", 16000);
- PrintToChat(client, "\x04[VIP] \x03Tu as bien reçu tes 16.000$.");
- }
- public OnClientSettingsChanged(client)
- {
- if(GetClientTeam(client) > 1 && GetUserFlagBits(client) & ADMFLAG_CUSTOM1)
- {
- change_tag(client);
- }
- public Action:PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
- {
- change_tag(GetClientOfUserId(GetEventInt(event, "userid")));
- }
- public change_tag(client)
- {
- if (IsClientInGame(client))
- {
- CS_SetClientClanTag(client, "Vip - ");
- }
- }
- public Event_GrenadeBounce(Handle:event, const String:name[], bool:dontBroadcast)
- {
- new iClient = GetClientOfUserId(GetEventInt(event, "userid")),
- iGrenade = GetGrenade(iClient);
- if(!iGrenade)
- return;
- decl String:sClass[32];
- GetEdictClassname(iGrenade, sClass, sizeof(sClass));
- if(StrEqual(sClass, "hegrenade_projectile"))
- {
- StickGrenade(iClient, iGrenade);
- SetEntityMoveType(iGrenade, MOVETYPE_NONE);
- }
- }
- GetGrenade(iClient)
- {
- decl String:sClass[2][32] = {"flashbang_projectile", "hegrenade_projectile"};
- for(new i = 0, iGrenade = -1; i < sizeof(sClass); i++)
- {
- while((iGrenade = FindEntityByClassname(iGrenade, sClass[i])) != -1)
- {
- if(GetEntPropEnt(iGrenade, Prop_Send, "m_hThrower") == iClient)
- return iGrenade;
- }
- }
- return 0;
- }
- StickGrenade(iClient, iGrenade)
- {
- decl Float:flClientOrigin[3], Float:flDistance, Float:flOrigin[3];
- GetEntPropVector(iGrenade, Prop_Send, "m_vecOrigin", flOrigin);
- new iNear, Float:flMaxRadius = MAX_RADIUS;
- for(new i = 1; i <= MaxClients; i++)
- {
- if(!IsClientInGame(i) || !IsPlayerAlive(i))
- continue;
- GetEntPropVector(i, Prop_Send, "m_vecOrigin", flClientOrigin);
- flDistance = GetVectorDistance(flClientOrigin, flOrigin);
- if(flDistance <= flMaxRadius)
- {
- flMaxRadius = flDistance;
- iNear = i;
- }
- }
- if(!iNear)
- return;
- decl String:sClass[32];
- GetEdictClassname(iGrenade, sClass, sizeof(sClass));
- if(StrEqual(sClass, "hegrenade_projectile"))
- {
- SetEntPropFloat(iGrenade, Prop_Send, "m_DmgRadius", 350.0);
- if(iClient == iNear || iClient != iNear)
- {
- SetEntityMoveType(iGrenade, MOVETYPE_NONE);
- SetVariantString("!activator");
- AcceptEntityInput(iGrenade, "SetParent", iNear);
- SetVariantString("idle");
- AcceptEntityInput(iGrenade, "SetAnimation");
- SetEntProp(iGrenade, Prop_Data, "m_nSolidType", 0);
- SetEntPropVector(iGrenade, Prop_Send, "m_angRotation", Float:{0.0, 0.0, 0.0});
- if(iClient != iNear) CPrintToChatAll("\x04%N \x03a lancé une Semtex sur \x04%N\x03! Ecartez-vous!",iClient,iNear);
- }
- }
- }