Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- #include <sdkhooks>
- #include <sdktools>
- #include <codmod>
- #include <cstrike>
- #include <emitsoundany>
- #include <timor2>
- #pragma tabsize 0
- new const String:nazwa[] = "[S-VIP] Ares";
- new const String:bronie[] = "#weapon_m4a1#weapon_elite";
- new const inteligencja = 0;
- new const zdrowie = 30;
- new const obrazenia = 10;
- new const wytrzymalosc = 10;
- new const kondycja = 0;
- #define WEAPON "weapon_knife" // weapon to replace
- #define PREFIX "\x01\x0B \x02[cs-placzabaw.pl]\x01"
- #define HOOK_REFRESH_TIME 0.1
- #define MODEL_BEAM "materials/sprites/purplelaser1.vmt"
- #define HOOK_SOUND "surf_dzwieki/ropesound.mp3"
- #define MODEL_BEAM "materials/sprites/purplelaser1.vmt"
- ConVar g_PredkoscPrzyciaganie;
- ConVar g_PredkoscPrzyciaganieInt;
- ConVar g_CzasObrazenia;
- ConVar g_CzasObrazeniaInt;
- ConVar g_Obrazenia;
- ConVar g_ObrazeniaInt;
- new bool:ma_klase[65];
- int ladunek[65];
- int g_iPlayerTime[MAXPLAYERS];
- ////
- int g_iSprite;
- int cel;
- int uzycie[MAXPLAYERS + 1];
- new zablokowane[MAXPLAYERS + 1];
- int g_iHooked[MAXPLAYERS + 1];
- int g_iHook[MAXPLAYERS + 1] = { INVALID_ENT_REFERENCE, ... };
- int g_iHookProp[MAXPLAYERS + 1] = { INVALID_ENT_REFERENCE, ... };
- bool g_bHooked[MAXPLAYERS + 1];
- Handle g_hTimerHook[MAXPLAYERS + 1] = { INVALID_HANDLE, ... };
- Handle timer_handler[MAXPLAYERS+1];
- Handle liczenie_handler[MAXPLAYERS+1];
- Handle obrazenia_handler[MAXPLAYERS+1];
- public bool:TraceRayFilter(ent, contents)
- {
- return false;
- }
- public Plugin:myinfo =
- {
- name = nazwa,
- author = "Linux`",
- description = "Cod Item",
- version = "1.0",
- url = "http://steamcommunity.com/id/linux2006"
- };
- public OnPluginStart()
- {
- CreateTimer(0.01, RegisterStart, 0);
- HookEvent("player_spawn", OdrodzenieGracza);
- HookEvent("player_death", SmiercGracza);
- g_PredkoscPrzyciaganie = CreateConVar("ares_predkoscprzyciaganie", "0.5", "0.5+(cod_get_user_maks_intelligence(hooker)/30.0)");
- g_PredkoscPrzyciaganieInt = CreateConVar("ares_predkoscprzyciaganieint", "30.0", "jak wyzej");
- g_CzasObrazenia = CreateConVar("ares_czasobrazenia", "0.8", "0.8-(cod_get_user_maks_intelligence(client)/100.0)");
- g_CzasObrazeniaInt = CreateConVar("ares_czasobrazeniaint", "100", "jak wyzej");
- g_Obrazenia = CreateConVar("ares_obrazenia", "5", "5+(cod_get_user_maks_intelligence(client)/10)");
- g_ObrazeniaInt = CreateConVar("ares_obrazeniaint", "10", "jak wyzej");
- AutoExecConfig(true, "ares", "sourcemod/surfklasy");
- char aresopis[52];
- Format(aresopis, sizeof(aresopis), "Number of player spawns: %i", "aresopis")
- }
- public void OnMapStart()
- {
- AddFileToDownloadsTable("sound/surf_dzwieki/ropesound.mp3");
- PrecacheSoundAny(HOOK_SOUND, true);
- g_iSprite = PrecacheModel(MODEL_BEAM);
- }
- public Action:RegisterStart(Handle:timer)
- {
- cod_register_class(nazwa, aresopis, bronie, inteligencja, zdrowie, obrazenia, wytrzymalosc, kondycja);
- }
- public cod_class_enabled(client)
- {
- if(GetUserFlagBits(client) & ADMFLAG_CUSTOM1)
- {
- ma_klase[client] = true;
- PrintToChat(client, "%s ARES", PREFIX);
- PrintToChat(client, "%s Wyceluj w przeciwnika i użyj mocy, aby się do niego przyciągnąć i zadawać mu regularnie obrażenia!", PREFIX);
- PrintToChat(client, "%s Prędkość przyciągania, częstotliwość zadawanych obrażeń i ich siłę determinuje inteligencja.", PREFIX);
- PrintToChat(client, "%s Użyj mocy będąc przyczepionym, aby się odczepić.", PREFIX);
- PrintToChat(client, "%s Miłej gry! Odwiedź czasem nasze forum i zostaw po sobie ślad! :)", PREFIX);
- ladunek[client] = 0;
- g_bHooked[client] = false;
- timer_handler[client] = CreateTimer(0.1, HudTextTimer, client, TIMER_REPEAT);
- return COD_CONTINUE;
- }
- PrintToChat(client, "%s Klasa dostępna tylko dla posiadaczy S-VIP", PREFIX);
- return COD_STOP;
- }
- public Action:HudTextTimer(Handle:timer, any:client)
- {
- if(IsPlayerAlive(client))
- {
- SetHudTextParams(-1.0, 0.75, 0.2, 255, 0, 0, 160);
- ShowHudText(client, -1, "ŁADUNKI : %i", ladunek[client]);
- }
- }
- public cod_class_disabled(client)
- {
- ma_klase[client] = false;
- ClearTimer(timer_handler[client]);
- }
- public cod_class_skill_used(client)
- {
- if(IsFreezeTime() || !IsPlayerAlive(client))
- return COD_CONTINUE;
- if(!zablokowane[client])
- {
- if(g_iPlayerTime[client]>=GetTime())
- PrintToChat(client, "%s Musisz poczekać, żeby się odczepić!", PREFIX);
- else
- {
- if (!g_bHooked[client])
- {
- if(ladunek[client] >= 1)
- {
- ScorpionHookOn(client)
- uzycie[client]++;
- return COD_CONTINUE;
- }
- }
- if(g_bHooked[client])
- {
- ScorpionHookOff(client);
- uzycie[client]++;
- return COD_CONTINUE;
- }
- }
- }
- else
- PrintToChat(client, "%s Kolego, wyłącz te macro albo przestań pić kawę!", PREFIX)
- return COD_CONTINUE;
- }
- public Action:SmiercGracza(Handle:event, String:name[], bool:dontBroadcast)
- {
- new client = GetClientOfUserId(GetEventInt(event, "userid"));
- new killer = GetClientOfUserId(GetEventInt(event, "attacker"));
- if(!IsValidClient(killer) || !ma_klase[killer])
- return Plugin_Continue;
- if(!IsValidClient(client) || !IsPlayerAlive(killer))
- return Plugin_Continue;
- if(GetClientTeam(client) == GetClientTeam(killer))
- return Plugin_Continue;
- ClearTimer(liczenie_handler[client])
- ladunek[killer]++;
- PrintToChat(killer, "%s Otrzymałeś ładunek. Ilość posiadanych ładunków : %i", PREFIX, ladunek[killer]);
- return Plugin_Continue;
- }
- public Action:OdrodzenieGracza(Handle:event, String:name[], bool:dontBroadcast)
- {
- new client = GetClientOfUserId(GetEventInt(event, "userid"));
- if(!IsValidClient(client) || !ma_klase[client])
- return Plugin_Continue;
- g_iPlayerTime[client] = 0;
- g_bHooked[client] = false;
- g_iPlayerTime[client] = GetTime()+8;
- liczenie_handler[client] = CreateTimer(1.0, Liczenie, client, TIMER_REPEAT);
- return Plugin_Continue;
- }
- public Action:Liczenie(Handle timer, any client)
- {
- if (uzycie[client] >= 10)
- {
- uzycie[client] = 0;
- CreateTimer(1.0, Odblokuj, client);
- zablokowane[client] = true;
- }
- uzycie[client] = 0;
- }
- public Action:Odblokuj(Handle timer, any client)
- {
- zablokowane[client] = false;
- }
- public void OnGameFrame()
- {
- //This is to make the player run smoothly off the ground, csgo make u stick to the ground unless u get high enough force of the ground
- for (int i = 1; i <= MaxClients; i++)
- {
- if(IsValidClient(i))
- {
- int victim = GetClientOfUserId(g_iHooked[i]);
- if (IsValidClient(victim))
- SetEntPropEnt(victim, Prop_Data, "m_hGroundEntity", -1);
- }
- }
- }
- public Action Timer_Hook(Handle timer, any data)
- {
- // Drags player to you
- int hooker = GetClientOfUserId(data);
- int victim = GetClientOfUserId(g_iHooked[hooker]);
- if (!IsPlayerAlive(victim) || !IsPlayerAlive(hooker))
- {
- ScorpionHookOff(hooker);
- g_hTimerHook[hooker] = INVALID_HANDLE;
- return Plugin_Stop;
- }
- float victimVel[3];
- float hookerPos[3], victimPos[3], eyePos[3];
- GetClientAbsOrigin(hooker, victimPos);
- GetClientAbsOrigin(victim, hookerPos);
- GetClientEyePosition(victim, eyePos);
- eyePos[2] -= 40.0;
- int color[4] = { 255, 0, 0, 255 };
- float x = GetRandomFloat(-1.0, 1.0);
- float dir[3];
- dir[0] = x;
- dir[1] = x;
- dir[2] = x;
- TE_SetupBloodSprite(eyePos, dir, color, 500, g_iSprite, g_iSprite);
- TE_SendToAll();
- float distance = GetVectorDistance(hookerPos, victimPos);
- if ( distance > 5 )
- {
- float fl_Time = distance / 1000.0;
- victimVel[0] = (hookerPos[0] - victimPos[0]) / fl_Time;
- victimVel[1] = (hookerPos[1] - victimPos[1]) / fl_Time;
- victimVel[2] = (hookerPos[2] - victimPos[2]) / fl_Time;
- }
- else
- {
- victimVel[0] = 0.0;
- victimVel[1] = 0.0;
- victimVel[2] = 0.0;
- }
- new Float:szybkosc = g_PredkoscPrzyciaganie.IntValue+(cod_get_user_maks_intelligence(hooker)/g_PredkoscPrzyciaganieInt.FloatValue);
- ScaleVector(victimVel, szybkosc);
- TeleportEntity(hooker, NULL_VECTOR, NULL_VECTOR, victimVel);
- return Plugin_Continue;
- }
- stock void CreateHookBeam(int client, int victim)
- {
- //BEAM
- int beam = CreateEntityByName("env_beam");
- char color[16];
- Format(color, sizeof(color), "255 255 25 255");
- SetEntityModel(beam, MODEL_BEAM); // This is where you would put the texture, ie "sprites/laser.vmt" or whatever.
- DispatchKeyValue(beam, "rendercolor", color );
- DispatchKeyValue(beam, "renderamt", "200");
- DispatchKeyValue(beam, "decalname", "Bigshot");
- DispatchKeyValue(beam, "life", "0");
- DispatchKeyValue(beam, "TouchType", "0");
- DispatchSpawn(beam);
- SetEntPropEnt(beam, Prop_Send, "m_hAttachEntity", client);
- SetEntPropEnt(beam, Prop_Send, "m_hAttachEntity", victim, 1);
- SetEntProp(beam, Prop_Send, "m_nNumBeamEnts", 2);
- SetEntProp(beam, Prop_Send, "m_nBeamType", 2);
- SetEntPropFloat(beam, Prop_Data, "m_fWidth", 5.0);
- SetEntPropFloat(beam, Prop_Data, "m_fEndWidth", 5.0);
- ActivateEntity(beam);
- AcceptEntityInput(beam, "TurnOn");
- g_iHook[client] = EntIndexToEntRef(beam);
- }
- stock void CreateEmptyHook(int client)
- {
- float startPos[3];
- GetClientAbsOrigin(client, startPos);
- startPos[2] += 40.0;
- float eyeAngles[3];
- GetClientEyeAngles(client, eyeAngles);
- float endPos[3];
- Handle trace = TR_TraceRayFilterEx(startPos, eyeAngles, MASK_ALL, RayType_Infinite, TraceFilterNotSelf, client);
- if(TR_DidHit(trace))
- TR_GetEndPosition(endPos, trace);
- CloseHandle(trace);
- //BEAM
- int beam = CreateEntityByName("env_beam");
- char color[16];
- Format(color, sizeof(color), "255 255 25 255");
- SetEntityModel(beam, MODEL_BEAM); // This is where you would put the texture, ie "sprites/laser.vmt" or whatever.
- DispatchKeyValue(beam, "rendercolor", color );
- DispatchKeyValue(beam, "renderamt", "200");
- DispatchKeyValue(beam, "decalname", "Bigshot");
- DispatchKeyValue(beam, "life", "0");
- DispatchKeyValue(beam, "TouchType", "0");
- DispatchSpawn(beam);
- TeleportEntity(beam, startPos, NULL_VECTOR, NULL_VECTOR);
- //PROP
- int prop = CreateEntityByName("info_target");
- DispatchSpawn(prop);
- TeleportEntity(prop, endPos, NULL_VECTOR, NULL_VECTOR);
- //PROP END
- SetEntPropEnt(beam, Prop_Send, "m_hAttachEntity", beam);
- SetEntPropEnt(beam, Prop_Send, "m_hAttachEntity", prop, 1);
- SetEntProp(beam, Prop_Send, "m_nNumBeamEnts", 2);
- SetEntProp(beam, Prop_Send, "m_nBeamType", 2);
- SetEntPropFloat(beam, Prop_Data, "m_fWidth", 5.0);
- SetEntPropFloat(beam, Prop_Data, "m_fEndWidth", 5.0);
- ActivateEntity(beam);
- AcceptEntityInput(beam, "TurnOn");
- SetVariantString("!activator");
- AcceptEntityInput(beam, "SetParent", client);
- g_iHookProp[client] = EntIndexToEntRef(prop);
- g_iHook[client] = EntIndexToEntRef(beam);
- }
- public void ScorpionHookOff(int client)
- {
- g_bHooked[client] = false;
- int hook = EntRefToEntIndex(g_iHook[client]);
- if(hook != INVALID_ENT_REFERENCE)
- AcceptEntityInput(hook, "Kill");
- g_iHook[client] = INVALID_ENT_REFERENCE;
- int prop = EntRefToEntIndex(g_iHookProp[client]);
- if(prop != INVALID_ENT_REFERENCE)
- AcceptEntityInput(prop, "Kill");
- g_iHookProp[client] = INVALID_ENT_REFERENCE;
- ClearTimer(obrazenia_handler[client]);
- g_iHooked[client] = INVALID_ENT_REFERENCE;
- }
- public bool TraceFilterNotSelf(int entityhit, int mask, any entity)
- {
- if(entity == 0 && entityhit != entity)
- return true;
- return false;
- }
- stock void ScorpionHookOn(int client)
- {
- int target = GetClientAimTarget(client, true);
- cel = target;
- if (IsValidClient(target))
- {
- if(!IsPlayerAlive(target))
- return;
- if(GetClientTeam(client) == GetClientTeam(target))
- return;
- g_iPlayerTime[client]=GetTime()+2;
- ladunek[client]--;
- float pos[3], victimPos[3];
- GetClientEyePosition(target, victimPos);
- GetClientEyePosition(client, pos);
- new Float:CzasObrazenia = g_CzasObrazenia.FloatValue-(cod_get_user_maks_intelligence(client)/g_CzasObrazeniaInt.IntValue);
- obrazenia_handler[client] = CreateTimer(CzasObrazenia, ZadawajObrazenia, client, TIMER_REPEAT);
- EmitAmbientSoundAny(HOOK_SOUND, pos,_,_,_,6.0);
- EmitSoundToClientAny(target, HOOK_SOUND);
- CreateHookBeam(client, target);
- g_iHooked[client] = GetClientUserId(target);
- g_bHooked[client] = true;
- g_hTimerHook[client] = CreateTimer(HOOK_REFRESH_TIME, Timer_Hook, GetClientUserId(client), TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE);
- }
- else
- {
- CreateEmptyHook(client);
- g_bHooked[client] = true;
- }
- }
- public Action:ZadawajObrazenia(Handle timer, any client)
- {
- new obrazeniauderzenie = g_Obrazenia.IntValue+(cod_get_user_maks_intelligence(client)/g_ObrazeniaInt.IntValue);
- cod_inflict_damage(cel, client, obrazeniauderzenie);
- }
- stock ClearTimer(&Handle:timer)
- {
- if (timer != INVALID_HANDLE)
- {
- KillTimer(timer);
- timer = INVALID_HANDLE;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement